Fixed Steam Lobby bug, Fixed players unable to access main room
This commit is contained in:
Lachlan Leone
2022-11-02 00:00:11 +11:00
parent 5166dd427e
commit c15ed3b21d
6 changed files with 63 additions and 11 deletions
+8 -8
View File
@@ -25,14 +25,14 @@ namespace MMOKitchen
new Vector3(9f, 0f, 2f),
new Vector3(9f, 0f, -3f),
new Vector3(9f, 0f, -6f),
new Vector3(14f, 0f, 5f),
new Vector3(14f, 0f, 2f),
new Vector3(14f, 0f, -3f),
new Vector3(14f, 0f, -6f),
new Vector3(-12f, 0f, 5f),
new Vector3(-12f, 0f, 2f),
new Vector3(-12f, 0f, -3f),
new Vector3(-12f, 0f, -6f)
new Vector3(13f, 0f, 5f),
new Vector3(13f, 0f, 2f),
new Vector3(13f, 0f, -3f),
new Vector3(13f, 0f, -6f),
new Vector3(-11f, 0f, 5f),
new Vector3(-11f, 0f, 2f),
new Vector3(-11f, 0f, -3f),
new Vector3(-11f, 0f, -6f)
};
for (int i = 0; i < 12; i++)
{
+1 -1
View File
@@ -23,7 +23,7 @@ namespace MMOKitchen
garageDecorations.SetActive(false);
create.Invoke(__instance, new object[]{GameData.Main.Get<Appliance>(AssetReference.GarageDecorations), new Vector3(-8f, 0f, -2f), Vector3.forward});
Mod.Log(GameData.Main.Get<Appliance>(AssetReference.GarageDecorations).Prefab.name);
//Mod.Log(GameData.Main.Get<Appliance>(AssetReference.GarageDecorations).Prefab.name);
Entity entity = default(Entity);
entity = (Entity)create.Invoke(__instance, new object[]{GameData.Main.Get<Appliance>(AssetReference.LoadoutPedestal), new Vector3(-8.5f, 0f, -4f), Vector3.right});
EntityUtils.GetEntityManager().AddComponent<CItemPedestal>(entity);
+5 -1
View File
@@ -9,7 +9,11 @@ namespace MMOKitchen
{
public static bool Prefix(LayoutBuilder __instance, Vector2 tile1, Vector2 tile2)
{
if (tile1 == new Vector2(-11, -5) || tile1 == new Vector2(-11, -6))
//Mod.Log(tile1.ToString() + "," + tile2.ToString());
if ((tile1 == new Vector2(-11, -5) && tile2 == new Vector2(-10, -5))
|| (tile1 == new Vector2(-11, -6) && tile2 == new Vector2(-10, -6))
|| (tile1 == new Vector2(-11, -7) && tile2 == new Vector2(-10, -7))
|| (tile1 == new Vector2(-11, -8) && tile2 == new Vector2(-10, -8)))
return false;
return true;
}
+45
View File
@@ -0,0 +1,45 @@
using HarmonyLib;
using UnityEngine;
using Kitchen.Layouts.Modules;
using Kitchen;
using System.Reflection;
using Unity.Entities;
using KitchenLib.Utils;
using System.IO;
using Steamworks;
using Kitchen.NetworkSupport;
using System.Threading.Tasks;
using System;
using System.Collections.Generic;
using System.Linq;
using Kitchen.Transports;
using Steamworks.Data;
namespace MMOKitchen
{
[HarmonyPatch(typeof(SteamPlatform), "CreateNewLobby")]
public class SteamPlatform_Patch
{
public static bool Prefix(SteamPlatform __instance, Action<bool, Lobby> callback)
{
if (__instance.IsReady)
{
SteamMatchmaking.CreateLobbyAsync(12).ContinueWith(delegate(Task<Lobby?> task)
{
if (task.IsCompleted && task.Result != null)
{
Lobby valueOrDefault = task.Result.GetValueOrDefault();
__instance.CurrentInviteLobby = valueOrDefault;
//Reflection Stuff
MethodInfo performSetPermissions = AccessTools.Method(typeof(SteamPlatform), "PerformSetPermissions");
performSetPermissions.Invoke(__instance, new object[] { __instance.Permissions });
callback(true, valueOrDefault);
}else
{
callback(false, default(Lobby));
}
});
}
return false;
}
}
}