mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkClient: removed static message caching to simplify code and reduce state
This commit is contained in:
parent
8957af215c
commit
8e7095262f
@ -37,9 +37,6 @@ public class NetworkClient
|
||||
|
||||
EndPoint m_RemoteEndPoint;
|
||||
|
||||
// static message objects to avoid runtime-allocations
|
||||
static CRCMessage s_CRCMessage = new CRCMessage();
|
||||
|
||||
NetworkMessageHandlers m_MessageHandlers = new NetworkMessageHandlers();
|
||||
protected NetworkConnection m_Connection;
|
||||
|
||||
@ -891,8 +888,9 @@ internal void RegisterSystemHandlers(bool localClient)
|
||||
|
||||
void OnCRC(NetworkMessage netMsg)
|
||||
{
|
||||
netMsg.ReadMessage(s_CRCMessage);
|
||||
NetworkCRC.Validate(s_CRCMessage.scripts, numChannels);
|
||||
CRCMessage msg = new CRCMessage();
|
||||
netMsg.ReadMessage(msg);
|
||||
NetworkCRC.Validate(msg.scripts, numChannels);
|
||||
}
|
||||
|
||||
public void RegisterHandler(short msgType, NetworkMessageDelegate handler)
|
||||
|
Loading…
Reference in New Issue
Block a user