diff --git a/RemovePlayerLimit/GenericPatches.cs b/RemovePlayerLimit/GenericPatches.cs index 5054c14..1e7a03c 100644 --- a/RemovePlayerLimit/GenericPatches.cs +++ b/RemovePlayerLimit/GenericPatches.cs @@ -4,9 +4,9 @@ namespace RemovePlayerLimit { class GenericPatches { //static sbyte UniquePlayerId = 0; - [HarmonyPatch(typeof(GameData), nameof(GameData.GetAvailableId))] + [HarmonyPatch(typeof(BAGGGBBOHOH), nameof(BAGGGBBOHOH.GetAvailableId))] public static class GameDataAvailableIdPatch { - public static bool Prefix(ref GameData __instance, ref sbyte __result) { + public static bool Prefix(ref BAGGGBBOHOH __instance, ref sbyte __result) { //__result = UniquePlayerId++; for (int i = 0; i < 128; i++) if (checkId(__instance, i)) { @@ -17,28 +17,28 @@ public static bool Prefix(ref GameData __instance, ref sbyte __result) { return false; } - static bool checkId(GameData __instance, int id) { - foreach (GameData.IHEKEPMDGIJ p in __instance.AllPlayers) - if (p.FIOIBHIDDOC == id) + static bool checkId(BAGGGBBOHOH __instance, int id) { + foreach (BAGGGBBOHOH.FGMBFCIIILC p in __instance.AllPlayers) + if (p.PAGHECLPIMH == id) return false; return true; } } - [HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.CheckColor), typeof(byte))] + [HarmonyPatch(typeof(GLHCHLEDNBA), nameof(GLHCHLEDNBA.CheckColor), typeof(byte))] public static class PlayerControlCheckColorPatch { - public static bool Prefix(PlayerControl __instance, byte GBOFPFOGPJO) { - __instance.RpcSetColor(GBOFPFOGPJO); + public static bool Prefix(GLHCHLEDNBA __instance, byte AGLNDGIHLPG) { + __instance.RpcSetColor(AGLNDGIHLPG); return false; } } - [HarmonyPatch(typeof(PlayerTab), nameof(PlayerTab.UpdateAvailableColors))] + [HarmonyPatch(typeof(DICIDCLJJFH), nameof(DICIDCLJJFH.UpdateAvailableColors))] public static class PlayerTabUpdateAvailableColorsPatch { - public static bool Prefix(PlayerTab __instance) { - PlayerControl.SetPlayerMaterialColors(PlayerControl.LocalPlayer.FIPOLMBOBHM.LHKAPPDILFP, __instance.DemoImage); - for (int i = 0; i < KMGFBENDNFO.FOJPMGJFKMB.Length; i++) - __instance.FKAFOGKGPLM.Add(i); + public static bool Prefix(DICIDCLJJFH __instance) { + GLHCHLEDNBA.SetPlayerMaterialColors(GLHCHLEDNBA.LocalPlayer.HMPLOOHMKEN.LMDCNHODEAN, __instance.DemoImage); + for (int i = 0; i < KPNJLIGHOEI.FLKMIOFABCO.Length; i++) + __instance.JBGOCGMNPBP.Add(i); return false; } } diff --git a/RemovePlayerLimit/MeetingHudPatches.cs b/RemovePlayerLimit/MeetingHudPatches.cs index c5acdb6..8d79a12 100644 --- a/RemovePlayerLimit/MeetingHudPatches.cs +++ b/RemovePlayerLimit/MeetingHudPatches.cs @@ -2,18 +2,19 @@ using HarmonyLib; using System.Linq; using Hazel; +using System.Net.NetworkInformation; namespace RemovePlayerLimit { class MeetingHudPatches { static string lastTimerText; static int currentPage = 0; static int maxPages { - get => (int)Mathf.Ceil(PlayerControl.AllPlayerControls.Count / 10f); + get => (int)Mathf.Ceil(GLHCHLEDNBA.AllPlayerControls.Count / 10f); } - [HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.Update))] + [HarmonyPatch(typeof(GPOHFPAIEMA), nameof(GPOHFPAIEMA.Update))] public static class VoteGuiPatch { - public static void Postfix(MeetingHud __instance) { + public static void Postfix(GPOHFPAIEMA __instance) { if (Input.GetKeyDown(KeyCode.UpArrow) || Input.mouseScrollDelta.y > 0f) currentPage = Mathf.Clamp(currentPage - 1, 0, maxPages - 1); else if (Input.GetKeyDown(KeyCode.DownArrow) || Input.mouseScrollDelta.y < 0f) @@ -22,9 +23,9 @@ public static void Postfix(MeetingHud __instance) { if (__instance.TimerText.Text != lastTimerText) __instance.TimerText.Text = (lastTimerText = __instance.TimerText.Text + $" ({currentPage + 1}/{maxPages})"); - PlayerVoteArea[] playerButtons = __instance.FALDLDJHDDJ.OrderBy(x => x.isDead).ToArray(); + LJEHDCNEKBG[] playerButtons = __instance.OMJGIAMFODK.OrderBy(x => x.isDead).ToArray(); int i = 0; - foreach (PlayerVoteArea button in playerButtons) { + foreach (LJEHDCNEKBG button in playerButtons) { if (i >= currentPage * 10 && i < (currentPage + 1) * 10) { button.gameObject.SetActive(true); @@ -37,21 +38,21 @@ public static void Postfix(MeetingHud __instance) { } } - [HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.OIDNFMKACJP))] + [HarmonyPatch(typeof(GPOHFPAIEMA), nameof(GPOHFPAIEMA.HMHBIBHOCDO))] public static class MeetingHudCheckForEndVotingPatch { - public static bool Prefix(MeetingHud __instance) { - if (__instance.FALDLDJHDDJ.All((PlayerVoteArea ps) => ps.isDead || ps.didVote)) { - byte[] self = calculateVotes(__instance.FALDLDJHDDJ); + public static bool Prefix(GPOHFPAIEMA __instance) { + if (__instance.OMJGIAMFODK.All((LJEHDCNEKBG ps) => ps.isDead || ps.didVote)) { + byte[] self = calculateVotes(__instance.OMJGIAMFODK); int maxIdx = indexOfMax(self, out bool tie) - 1; - GameData.IHEKEPMDGIJ exiled = GameData.Instance.GetPlayerById((byte)maxIdx); - byte[] states = __instance.FALDLDJHDDJ.Select(s => s.GetState()).ToArray(); - byte[] votes = __instance.FALDLDJHDDJ.Select(s => (byte)s.votedFor).ToArray(); + BAGGGBBOHOH.FGMBFCIIILC exiled = BAGGGBBOHOH.Instance.GetPlayerById((byte)maxIdx); + byte[] states = __instance.OMJGIAMFODK.Select(s => s.GetState()).ToArray(); + byte[] votes = __instance.OMJGIAMFODK.Select(s => (byte)s.votedFor).ToArray(); - MessageWriter messageWriter = AmongUsClient.Instance.StartRpc(__instance.NetId, 23, SendOption.Reliable); + MessageWriter messageWriter = JNFEHNLGIFF.Instance.StartRpc(__instance.NetId, 23, SendOption.Reliable); messageWriter.WriteBytesAndSize(states); messageWriter.WriteBytesAndSize(votes); //Added because of the state's 4 bit vote id limit - messageWriter.Write((exiled != null) ? exiled.FIOIBHIDDOC : byte.MaxValue); + messageWriter.Write((exiled != null) ? exiled.PAGHECLPIMH : byte.MaxValue); messageWriter.Write(tie); messageWriter.EndMessage(); @@ -60,10 +61,10 @@ public static bool Prefix(MeetingHud __instance) { return false; } - static byte[] calculateVotes(PlayerVoteArea[] states) { + static byte[] calculateVotes(LJEHDCNEKBG[] states) { byte[] self = new byte[states.Length + 1]; for (int i = 0; i < states.Length; i++) { - PlayerVoteArea playerVoteArea = states[i]; + LJEHDCNEKBG playerVoteArea = states[i]; if (playerVoteArea.didVote) if (playerVoteArea.votedFor + 1 >= 0 && playerVoteArea.votedFor + 1 < self.Length) self[playerVoteArea.votedFor + 1]++; @@ -90,24 +91,24 @@ static int indexOfMax(byte[] array, out bool tie) { } } - [HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.HandleRpc), typeof(byte), typeof(Hazel.MessageReader))] + [HarmonyPatch(typeof(GPOHFPAIEMA), nameof(GPOHFPAIEMA.HandleRpc), typeof(byte), typeof(Hazel.MessageReader))] public static class MeetingHudHandleRpcPatch { - public static bool Prefix(MeetingHud __instance, byte DNHFGLIHAFB, Hazel.MessageReader IGFFAFNNIAB) { - switch (DNHFGLIHAFB) { + public static bool Prefix(GPOHFPAIEMA __instance, byte OPCIDHAAHLI, Hazel.MessageReader DNCHPFLHHEN) { + switch (OPCIDHAAHLI) { case 22: __instance.Close(); break; case 23: { - byte[] states = IGFFAFNNIAB.ReadBytesAndSize(); - byte[] votes = IGFFAFNNIAB.ReadBytesAndSize(); - GameData.IHEKEPMDGIJ playerById = GameData.Instance.GetPlayerById(IGFFAFNNIAB.ReadByte()); - bool tie = IGFFAFNNIAB.ReadBoolean(); + byte[] states = DNCHPFLHHEN.ReadBytesAndSize(); + byte[] votes = DNCHPFLHHEN.ReadBytesAndSize(); + BAGGGBBOHOH.FGMBFCIIILC playerById = BAGGGBBOHOH.Instance.GetPlayerById(DNCHPFLHHEN.ReadByte()); + bool tie = DNCHPFLHHEN.ReadBoolean(); VotingComplete(__instance, states, votes, playerById, tie); break; } case 24: { - byte srcPlayerId = IGFFAFNNIAB.ReadByte(); - sbyte suspectPlayerId = IGFFAFNNIAB.ReadSByte(); + byte srcPlayerId = DNCHPFLHHEN.ReadByte(); + sbyte suspectPlayerId = DNCHPFLHHEN.ReadSByte(); __instance.CastVote(srcPlayerId, suspectPlayerId); break; } @@ -118,46 +119,49 @@ public static bool Prefix(MeetingHud __instance, byte DNHFGLIHAFB, Hazel.Message return false; } - public static void VotingComplete(MeetingHud __instance, byte[] states, byte[] votes, GameData.IHEKEPMDGIJ exiled, bool tie) { - if (__instance.FGFCFMNBKON == MeetingHud.IONNOOOEADE.Results) { + public static void VotingComplete(GPOHFPAIEMA __instance, byte[] states, byte[] votes, BAGGGBBOHOH.FGMBFCIIILC exiled, bool tie) { + if (__instance.FDLEFBMLMFM == GPOHFPAIEMA.DHLNNGGOJNI.Results) { return; } - __instance.FGFCFMNBKON = MeetingHud.IONNOOOEADE.Results; - __instance.JMHKAFCOGCM = __instance.discussionTimer; - __instance.BJOCHIGMCBL = exiled; - __instance.CEIGAJCFLEM = tie; + __instance.FDLEFBMLMFM = GPOHFPAIEMA.DHLNNGGOJNI.Results; + __instance.NFIBDGIOEIA = __instance.discussionTimer; + __instance.GKGOFBGECAK = exiled; + __instance.GBOFEFNNKCF = tie; __instance.SkipVoteButton.gameObject.SetActive(false); __instance.SkippedVoting.gameObject.SetActive(true); PopulateResults(__instance, states, votes); - __instance.BFHIPKBGFGF(); + __instance.LLMHJIDIDFK(); } - public static void PopulateResults(MeetingHud __instance, byte[] states, byte[] votes) { + public static void PopulateResults(GPOHFPAIEMA __instance, byte[] states, byte[] votes) { __instance.TitleText.Text = "Voting Results"; int num = 0; - for (int i = 0; i < __instance.FALDLDJHDDJ.Length; i++) { - PlayerVoteArea playerVoteArea = __instance.FALDLDJHDDJ[i]; + for (int i = 0; i < __instance.OMJGIAMFODK.Length; i++) { + LJEHDCNEKBG playerVoteArea = __instance.OMJGIAMFODK[i]; playerVoteArea.ClearForResults(); int num2 = 0; for (int j = 0; j < states.Length; j++) { if ((states[j] & 128) == 0) { //!isDead - GameData.IHEKEPMDGIJ playerById = GameData.Instance.GetPlayerById((byte)__instance.FALDLDJHDDJ[j].TargetPlayerId); + BAGGGBBOHOH.FGMBFCIIILC playerById = BAGGGBBOHOH.Instance.GetPlayerById((byte)__instance.OMJGIAMFODK[j].AGGEFFKBKLE); int votedFor = (sbyte)votes[j]; SpriteRenderer spriteRenderer = UnityEngine.Object.Instantiate(__instance.PlayerVotePrefab); - PlayerControl.SetPlayerMaterialColors((int)playerById.LHKAPPDILFP, spriteRenderer); + if (GLHCHLEDNBA.GameOptions.IAFJLBELLDA) + GLHCHLEDNBA.SetPlayerMaterialColors(KPNJLIGHOEI.BAOLBIKEKEK, spriteRenderer); + else + GLHCHLEDNBA.SetPlayerMaterialColors((int)playerById.LMDCNHODEAN, spriteRenderer); spriteRenderer.transform.localScale = Vector3.zero; - if ((int)playerVoteArea.TargetPlayerId == votedFor) { + if ((int)playerVoteArea.AGGEFFKBKLE == votedFor) { spriteRenderer.transform.SetParent(playerVoteArea.transform); - spriteRenderer.transform.localPosition = __instance.BEDJEPCINAI + new Vector3(__instance.LNFHFGONEGA.x * (float)num2, 0f, 0f); - __instance.StartCoroutine(FBBJKJLHFKF.KGIPENFLALI((float)num2 * 0.5f, spriteRenderer.transform, 0.5f)); + spriteRenderer.transform.localPosition = __instance.GOCOEAPLJFA + new Vector3(__instance.OHFLCOGINJN.x * (float)num2, 0f, 0f); + __instance.StartCoroutine(JDBGLNAEBLG.GBIKBPPNKEB((float)num2 * 0.5f, spriteRenderer.transform, 1f, 0.5f)); num2++; } else if (i == 0 && votedFor == -1) { spriteRenderer.transform.SetParent(__instance.SkippedVoting.transform); - spriteRenderer.transform.localPosition = __instance.BEDJEPCINAI + new Vector3(__instance.LNFHFGONEGA.x * (float)num, 0f, 0f); - __instance.StartCoroutine(FBBJKJLHFKF.KGIPENFLALI((float)num * 0.5f, spriteRenderer.transform, 0.5f)); + spriteRenderer.transform.localPosition = __instance.GOCOEAPLJFA + new Vector3(__instance.OHFLCOGINJN.x * (float)num, 0f, 0f); + __instance.StartCoroutine(JDBGLNAEBLG.GBIKBPPNKEB((float)num * 0.5f, spriteRenderer.transform, 1f, 0.5f)); num++; } } diff --git a/RemovePlayerLimit/RemovePlayerLimit.csproj b/RemovePlayerLimit/RemovePlayerLimit.csproj index eb97102..0514199 100644 --- a/RemovePlayerLimit/RemovePlayerLimit.csproj +++ b/RemovePlayerLimit/RemovePlayerLimit.csproj @@ -32,29 +32,29 @@ - ..\..\Among.Us.Incl.DLC.v09.22.2020s\BepInEx\core\0Harmony.dll + ..\..\Among.Us.v2020.10.22s\BepInEx\core\0Harmony.dll - ..\..\Among.Us.Incl.DLC.v09.22.2020s\BepInEx\unhollowed\Assembly-CSharp.dll + ..\..\Among.Us.v2020.10.22s\BepInEx\unhollowed\Assembly-CSharp.dll - ..\..\Among.Us.Incl.DLC.v09.22.2020s\BepInEx\core\BepInEx.Core.dll + ..\..\Among.Us.v2020.10.22s\BepInEx\core\BepInEx.Core.dll - ..\..\Among.Us.Incl.DLC.v09.22.2020s\BepInEx\core\BepInEx.Harmony.dll + ..\..\Among.Us.v2020.10.22s\BepInEx\core\BepInEx.Harmony.dll - ..\..\Among.Us.Incl.DLC.v09.22.2020s\BepInEx\core\BepInEx.IL2CPP.dll + ..\..\Among.Us.v2020.10.22s\BepInEx\core\BepInEx.IL2CPP.dll False - ..\..\Among.Us.Incl.DLC.v09.22.2020s\BepInEx\unhollowed\Hazel.dll + ..\..\Among.Us.v2020.10.22s\BepInEx\unhollowed\Hazel.dll - ..\..\Among.Us.Incl.DLC.v09.22.2020s\BepInEx\unhollowed\Il2Cppmscorlib.dll + ..\..\Among.Us.v2020.10.22s\BepInEx\unhollowed\Il2Cppmscorlib.dll - ..\..\Among.Us.Incl.DLC.v09.22.2020s\BepInEx\unhollowed\Il2CppSystem.Core.dll + ..\..\Among.Us.v2020.10.22s\BepInEx\unhollowed\Il2CppSystem.Core.dll @@ -64,17 +64,17 @@ - ..\..\Among.Us.Incl.DLC.v09.22.2020s\BepInEx\unhollowed\UnhollowerBaseLib.dll + ..\..\Among.Us.v2020.10.22s\BepInEx\unhollowed\UnhollowerBaseLib.dll - ..\..\Among.Us.Incl.DLC.v09.22.2020s\BepInEx\unhollowed\UnityEngine.dll + ..\..\Among.Us.v2020.10.22s\BepInEx\unhollowed\UnityEngine.dll False - ..\..\Among.Us.Incl.DLC.v09.22.2020s_dev\BepInEx\unhollowed\UnityEngine.CoreModule.dll + ..\..\Among.Us.v2020.10.22s\BepInEx\unhollowed\UnityEngine.CoreModule.dll - ..\..\Among.Us.Incl.DLC.v09.22.2020s\BepInEx\unhollowed\UnityEngine.InputLegacyModule.dll + ..\..\Among.Us.v2020.10.22s\BepInEx\unhollowed\UnityEngine.InputLegacyModule.dll diff --git a/RemovePlayerLimit/RemovePlayerLimitPlugin.cs b/RemovePlayerLimit/RemovePlayerLimitPlugin.cs index 027cc1b..70afdc0 100644 --- a/RemovePlayerLimit/RemovePlayerLimitPlugin.cs +++ b/RemovePlayerLimit/RemovePlayerLimitPlugin.cs @@ -5,7 +5,7 @@ using System.Reflection; namespace RemovePlayerLimit { - [BepInPlugin("it.andry08.removeplayerlimit", "Player Limit Remove", "1.2")] + [BepInPlugin("it.andry08.removeplayerlimit", "Player Limit Remove", "2.0")] public class RemovePlayerLimitPlugin : BasePlugin { static internal BepInEx.Logging.ManualLogSource Logger; @@ -14,7 +14,7 @@ public class RemovePlayerLimitPlugin : BasePlugin { public override void Load() { Logger = Log; - OPIJAMILNFD.DECPEFPMMMF = OPIJAMILNFD.DKLBMBAFBAE = Enumerable.Repeat(255, 255).ToArray(); + OEFJGMAEENB.HLNGFFNMJOP = OEFJGMAEENB.ALNGMJFMDHA = Enumerable.Repeat(255, 255).ToArray(); _harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly()); } }