private static bool versionSent = false;
private static string lobbyCodeText = "";
+ [HarmonyPatch(typeof(AmongUsClient), nameof(AmongUsClient.OnPlayerJoined))]
+ public class AmongUsClientOnPlayerJoinedPatch {
+ public static void Postfix() {
+ if (PlayerControl.LocalPlayer != null) {
+ Helpers.shareGameVersion();
+ }
+ }
+ }
+
[HarmonyPatch(typeof(GameStartManager), nameof(GameStartManager.Start))]
public class GameStartManagerStartPatch {
public static void Postfix(GameStartManager __instance) {
private static string currentText = "";
public static void Prefix(GameStartManager __instance) {
- if (!AmongUsClient.Instance.AmHost || !GameData.Instance) return; // Not host or no instance
+ if (!AmongUsClient.Instance.AmHost || !GameData.Instance ) return; // Not host or no instance
update = GameData.Instance.PlayerCount != __instance.LastPlayerCount;
}
else
ver = new System.Version(major, minor, build, revision);
GameStartManagerPatch.playerVersions[clientId] = new GameStartManagerPatch.PlayerVersion(ver, guid);
-
- if (AmongUsClient.Instance.AmHost && clientId != AmongUsClient.Instance.ClientId) // Host returns version whenever another player sends one
- Helpers.shareGameVersion();
}
public static void useUncheckedVent(int ventId, byte playerId, byte isEnter) {