Modded lobby auto kick fix

This commit is contained in:
D1GQ committed 2024-09-22 19:40:34 -05:00
1 parent e2499b6ea4
commit 59b055b58f
2 files changed
+12 -10

No files matched your search

+11 -10
View File
@@ -151,7 +151,7 @@ internal static class RPC
public static void HandleCustomRPC(PlayerControl player, byte callId, MessageReader oldReader)
{
if (player == null || player.IsLocalPlayer() || player.Data == null) return;
if (player == null || player.IsLocalPlayer() || player.Data == null || Enum.IsDefined(typeof(RpcCalls), callId)) return;
if (Enum.IsDefined(typeof(CustomRPC), (int)unchecked(callId)))
{
@@ -206,21 +206,22 @@ internal static class RPC
*/
}
}
try
else if (!Enum.IsDefined(typeof(CustomRPC), (int)unchecked(callId)))
{
if (!GameStates.IsTOHEHostLobby && callId is not unchecked((byte)CustomRPC.Sicko) or unchecked((byte)CustomRPC.AUM) or (byte)CustomRPC.AUMChat)
try
{
var flag = Enum.IsDefined(typeof(CustomRPC), (int)callId) || Enum.IsDefined(typeof(RpcCalls), callId);
if (!flag && player.IsHost())
if (!GameStates.IsHost && !GameStates.IsTOHEHostLobby)
{
var BAU = "<color=#278720>♻</color><color=#0ed400><b>BetterAmongUs</b></color><color=#278720>♻</color>";
Utils.DisconnectSelf($"{BAU} does not support\n<b>Modded Lobbies</b>!");
if (player.IsHost())
{
var Icon = Translator.GetString("BAUMark");
var BAU = $"<color=#278720>{Icon}</color><color=#0ed400><b>{Translator.GetString("BAU")}</b></color><color=#278720>{Icon}</color>";
Utils.DisconnectSelf(string.Format(Translator.GetString("ModdedLobbyMsg"), BAU));
}
}
}
catch { }
}
catch { }
}
public static void HandleRPC(PlayerControl player, byte callId, MessageReader oldReader)
+1
View File
@@ -15,6 +15,7 @@
"Timer": "Timer",
"SystemMessage": "System Message",
"SystemNotification": "System Notification",
"ModdedLobbyMsg": "{0} does not support\n<b>Modded Lobbies</b>",
"Player.Loading": "Loading",
"Player.NoFriendCode": "No Friend Code",