mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Type safe register/unregister handlers (#44)
This commit is contained in:
parent
f3886906ef
commit
493a295f88
@ -303,11 +303,21 @@ public void RegisterHandler(short msgType, NetworkMessageDelegate handler)
|
||||
m_MessageHandlers[msgType] = handler;
|
||||
}
|
||||
|
||||
public void RegisterHandler(MsgType msgType, NetworkMessageDelegate handler)
|
||||
{
|
||||
RegisterHandler((short)msgType, handler);
|
||||
}
|
||||
|
||||
public void UnregisterHandler(short msgType)
|
||||
{
|
||||
m_MessageHandlers.Remove(msgType);
|
||||
}
|
||||
|
||||
public void UnregisterHandler(MsgType msgType)
|
||||
{
|
||||
UnregisterHandler((short)msgType);
|
||||
}
|
||||
|
||||
internal static void AddClient(NetworkClient client)
|
||||
{
|
||||
s_Clients.Add(client);
|
||||
|
@ -535,6 +535,11 @@ public static void UnregisterHandler(short msgType)
|
||||
s_MessageHandlers.Remove(msgType);
|
||||
}
|
||||
|
||||
public static void UnregisterHandler(MsgType msgType)
|
||||
{
|
||||
UnregisterHandler((short)msgType);
|
||||
}
|
||||
|
||||
public static void ClearHandlers()
|
||||
{
|
||||
s_MessageHandlers.Clear();
|
||||
|
Loading…
Reference in New Issue
Block a user