MAX_PLAYERS should update when calling CreateCustomizedLobby

it will NOT resize to default 4 when quitting the game but whatever, it should not break
This commit is contained in:
2023-03-06 20:29:13 +01:00
parent b459b310bb
commit 1f251987b1
2 changed files with 4 additions and 3 deletions

View File

@@ -166,6 +166,7 @@ namespace DevourClient.Hacks
public static void CreateCustomizedLobby(Il2CppUdpKit.Platform.Photon.PhotonRegion.Regions __region = Il2CppUdpKit.Platform.Photon.PhotonRegion.Regions.BEST_REGION, int lobbySize = 4, bool isPrivate = false) public static void CreateCustomizedLobby(Il2CppUdpKit.Platform.Photon.PhotonRegion.Regions __region = Il2CppUdpKit.Platform.Photon.PhotonRegion.Regions.BEST_REGION, int lobbySize = 4, bool isPrivate = false)
{ {
Entities.MAX_PLAYERS = lobbySize; //max players in the lobby
Il2CppUdpKit.Platform.PhotonPlatformConfig __photonPlatformConfig = new Il2CppUdpKit.Platform.PhotonPlatformConfig(); Il2CppUdpKit.Platform.PhotonPlatformConfig __photonPlatformConfig = new Il2CppUdpKit.Platform.PhotonPlatformConfig();
__photonPlatformConfig.Region = Il2CppUdpKit.Platform.Photon.PhotonRegion.regions[__region]; __photonPlatformConfig.Region = Il2CppUdpKit.Platform.Photon.PhotonRegion.regions[__region];

View File

@@ -144,10 +144,10 @@ namespace DevourClient.Helpers
public class Entities public class Entities
{ {
public const int MAX_PLAYERS = 4; //can change with new updates/new hacks public static int MAX_PLAYERS = 4; //will change by calling CreateCustomizedLobby
public static BasePlayer LocalPlayer_ = new BasePlayer(); public static BasePlayer LocalPlayer_ = new BasePlayer();
public static BasePlayer[] Players = new BasePlayer[MAX_PLAYERS]; public static BasePlayer[] Players = new BasePlayer[MAX_PLAYERS]; //i hope this doesn't break
//public static GameObject[] Players = default!; //public static GameObject[] Players = default!;
public static Il2Cpp.GoatBehaviour[] GoatsAndRats = default!; public static Il2Cpp.GoatBehaviour[] GoatsAndRats = default!;
public static Il2Cpp.SurvivalInteractable[] SurvivalInteractables = default!; public static Il2Cpp.SurvivalInteractable[] SurvivalInteractables = default!;