Upload from upload_mods.ps1
This commit is contained in:
75
Harmony/Harmony_GameStateManager.cs
Normal file
75
Harmony/Harmony_GameStateManager.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
namespace Harmony.GameStateManagerPatches
|
||||
{
|
||||
internal class GameStateManagerPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(GameStateManager))]
|
||||
[HarmonyPatch("StartGame")]
|
||||
public class StartGamePatch
|
||||
{
|
||||
public static void Postfix()
|
||||
{
|
||||
//Log.Out("GameStateManagerPatches-StartGame POST START");
|
||||
|
||||
bool optionFireManager = CustomGameOptions.GetBool("CustomFireManager");
|
||||
|
||||
if (GamePrefs.GetString(EnumGamePrefs.GameWorld) == "Empty"
|
||||
|| GamePrefs.GetString(EnumGamePrefs.GameWorld) == "Playtesting"
|
||||
|| GamePrefs.GetString(EnumGamePrefs.GameMode) == "GameModeEditWorld"
|
||||
|| !optionFireManager)
|
||||
{
|
||||
//Log.Out("GameStateManagerPatches-StartGame 1A");
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("GameStateManagerPatches-StartGame 1B");
|
||||
FireManager.Init();
|
||||
}
|
||||
|
||||
Broadcastmanager.Init();
|
||||
//GamestageManagerRebirth.Init();
|
||||
|
||||
RebirthManager.Init();
|
||||
|
||||
EntityPlayerLocal localPlayer = GameManager.Instance.World.GetPrimaryPlayer();
|
||||
|
||||
if (SingletonMonoBehaviour<ConnectionManager>.Instance.IsServer)
|
||||
{
|
||||
//Log.Out("GameStateManagerPatches-StartGame 2");
|
||||
if (!GameManager.Instance.isEditMode)
|
||||
{
|
||||
GameManager.Instance.StartCoroutine(RebirthUtilities.BuildGamestageSpawnGroups());
|
||||
//HiresManagerRebirth.Init();
|
||||
//OutbreakManagerRebirth.Init();
|
||||
//OutbreakManagerRebirth.Init();
|
||||
//ScenarioManagerRebirth.Init();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("GameStateManagerPatches-StartGame 3");
|
||||
if (localPlayer != null)
|
||||
{
|
||||
//Log.Out("GameStateManagerPatches-StartGame 4");
|
||||
//Log.Out("GameStateManagerPatches-StartGame ASKING FOR HIRES");
|
||||
//ModEvents.GameUpdate.RegisterHandler(RebirthManager.Update);
|
||||
RebirthManager.playerHires.Clear();
|
||||
RebirthManager.observers.Clear();
|
||||
SingletonMonoBehaviour<ConnectionManager>.Instance.SendToServer(NetPackageManager.GetPackage<NetPackageGetHiresRebirth>().Setup(localPlayer.entityId), false);
|
||||
RebirthUtilities.HasSelectedClass(localPlayer);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("GameStateManagerPatches-StartGame 5");
|
||||
//Log.Out("GameStateManagerPatches-StartGame COULD NOT FIND LOCAL PLAYER");
|
||||
}
|
||||
}
|
||||
|
||||
if (localPlayer != null)
|
||||
{
|
||||
RebirthUtilities.HasSelectedClass(localPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user