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;
|
EndPoint m_RemoteEndPoint;
|
||||||
|
|
||||||
// static message objects to avoid runtime-allocations
|
|
||||||
static CRCMessage s_CRCMessage = new CRCMessage();
|
|
||||||
|
|
||||||
NetworkMessageHandlers m_MessageHandlers = new NetworkMessageHandlers();
|
NetworkMessageHandlers m_MessageHandlers = new NetworkMessageHandlers();
|
||||||
protected NetworkConnection m_Connection;
|
protected NetworkConnection m_Connection;
|
||||||
|
|
||||||
@ -891,8 +888,9 @@ internal void RegisterSystemHandlers(bool localClient)
|
|||||||
|
|
||||||
void OnCRC(NetworkMessage netMsg)
|
void OnCRC(NetworkMessage netMsg)
|
||||||
{
|
{
|
||||||
netMsg.ReadMessage(s_CRCMessage);
|
CRCMessage msg = new CRCMessage();
|
||||||
NetworkCRC.Validate(s_CRCMessage.scripts, numChannels);
|
netMsg.ReadMessage(msg);
|
||||||
|
NetworkCRC.Validate(msg.scripts, numChannels);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RegisterHandler(short msgType, NetworkMessageDelegate handler)
|
public void RegisterHandler(short msgType, NetworkMessageDelegate handler)
|
||||||
|
Loading…
Reference in New Issue
Block a user