mirror of
https://github.com/D1GQ/BetterAmongUs.git
synced 2026-10-19 15:51:52 +00:00
Fix custom rpc processing
This commit is contained in:
1 parent
b068725a21
commit
6f6de795dc
2 files changed
+11
-4
No files matched your search
@@ -278,7 +278,10 @@ internal static class NetworkManager
|
||||
{
|
||||
if (rpcCall == (byte)RPC.CUSTOM_RPC_CALL)
|
||||
{
|
||||
RPC.HandleCustomRPCPacked(player, reader);
|
||||
if (RPC.HandleCustomRPCPacked(player, reader))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-3
@@ -1,6 +1,6 @@
|
||||
using BetterAmongUs.Enums;
|
||||
using BetterAmongUs.Utilities;
|
||||
using BetterAmongUs.Mono.Extended;
|
||||
using BetterAmongUs.Utilities;
|
||||
using Hazel;
|
||||
|
||||
namespace BetterAmongUs.Network;
|
||||
@@ -40,10 +40,10 @@ internal static class RPC
|
||||
/// </summary>
|
||||
/// <param name="player">The player who sent the RPC message.</param>
|
||||
/// <param name="oldReader">The message reader containing the RPC data.</param>
|
||||
internal static void HandleCustomRPCPacked(PlayerControl player, MessageReader oldReader)
|
||||
internal static bool HandleCustomRPCPacked(PlayerControl player, MessageReader oldReader)
|
||||
{
|
||||
if (player == null || player.IsLocalPlayer() || player.Data == null)
|
||||
return;
|
||||
return false;
|
||||
|
||||
MessageReader reader = MessageReader.Get(oldReader);
|
||||
|
||||
@@ -63,9 +63,13 @@ internal static class RPC
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
reader.Recycle();
|
||||
return true;
|
||||
}
|
||||
|
||||
reader.Recycle();
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in new issue
Block a user