Renamed m_MessageHandlers to messageHandlers (#708)

This commit is contained in:
rodolphito 2019-04-04 00:50:02 -07:00 committed by vis2k
parent cdeed8b558
commit 22d237505c

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
@ -8,7 +8,7 @@ public class NetworkConnection : IDisposable
{ {
public HashSet<NetworkIdentity> visList = new HashSet<NetworkIdentity>(); public HashSet<NetworkIdentity> visList = new HashSet<NetworkIdentity>();
Dictionary<int, NetworkMessageDelegate> m_MessageHandlers; Dictionary<int, NetworkMessageDelegate> messageHandlers;
public int connectionId = -1; public int connectionId = -1;
public bool isReady; public bool isReady;
@ -98,21 +98,21 @@ public void Disconnect()
internal void SetHandlers(Dictionary<int, NetworkMessageDelegate> handlers) internal void SetHandlers(Dictionary<int, NetworkMessageDelegate> handlers)
{ {
m_MessageHandlers = handlers; messageHandlers = handlers;
} }
public void RegisterHandler(short msgType, NetworkMessageDelegate handler) public void RegisterHandler(short msgType, NetworkMessageDelegate handler)
{ {
if (m_MessageHandlers.ContainsKey(msgType)) if (messageHandlers.ContainsKey(msgType))
{ {
if (LogFilter.Debug) Debug.Log("NetworkConnection.RegisterHandler replacing " + msgType); if (LogFilter.Debug) Debug.Log("NetworkConnection.RegisterHandler replacing " + msgType);
} }
m_MessageHandlers[msgType] = handler; messageHandlers[msgType] = handler;
} }
public void UnregisterHandler(short msgType) public void UnregisterHandler(short msgType)
{ {
m_MessageHandlers.Remove(msgType); messageHandlers.Remove(msgType);
} }
[Obsolete("use Send<T> instead")] [Obsolete("use Send<T> instead")]
@ -193,7 +193,7 @@ public bool InvokeHandlerNoData(int msgType)
public bool InvokeHandler(int msgType, NetworkReader reader) public bool InvokeHandler(int msgType, NetworkReader reader)
{ {
if (m_MessageHandlers.TryGetValue(msgType, out NetworkMessageDelegate msgDelegate)) if (messageHandlers.TryGetValue(msgType, out NetworkMessageDelegate msgDelegate))
{ {
NetworkMessage message = new NetworkMessage NetworkMessage message = new NetworkMessage
{ {