mirror of
https://github.com/D1GQ/BetterAmongUs.git
synced 2026-10-20 01:46:19 +00:00
Modded lobby auto kick fix
This commit is contained in:
1 parent
e2499b6ea4
commit
59b055b58f
2 files changed
+12
-10
No files matched your search
+11
-10
@@ -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)
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user