NetworkClient.REgisterHandle made static

This commit is contained in:
vis2k 2019-03-24 20:24:30 +01:00
parent ba00554e0c
commit 712aecb452
2 changed files with 8 additions and 8 deletions

View File

@ -269,7 +269,7 @@ internal void RegisterSystemHandlers(bool localClient)
}
[Obsolete("Use RegisterHandler<T> instead")]
public void RegisterHandler(int msgType, NetworkMessageDelegate handler)
public static void RegisterHandler(int msgType, NetworkMessageDelegate handler)
{
if (handlers.ContainsKey(msgType))
{
@ -279,12 +279,12 @@ public void RegisterHandler(int msgType, NetworkMessageDelegate handler)
}
[Obsolete("Use RegisterHandler<T> instead")]
public void RegisterHandler(MsgType msgType, NetworkMessageDelegate handler)
public static void RegisterHandler(MsgType msgType, NetworkMessageDelegate handler)
{
RegisterHandler((int)msgType, handler);
}
public void RegisterHandler<T>(Action<NetworkConnection, T> handler) where T : IMessageBase, new()
public static void RegisterHandler<T>(Action<NetworkConnection, T> handler) where T : IMessageBase, new()
{
int msgType = MessagePacker.GetId<T>();
if (handlers.ContainsKey(msgType))

View File

@ -300,11 +300,11 @@ public bool StartServer()
internal void RegisterClientMessages(NetworkClient client)
{
client.RegisterHandler<ConnectMessage>(OnClientConnectInternal);
client.RegisterHandler<DisconnectMessage>(OnClientDisconnectInternal);
client.RegisterHandler<NotReadyMessage>(OnClientNotReadyMessageInternal);
client.RegisterHandler<ErrorMessage>(OnClientErrorInternal);
client.RegisterHandler<SceneMessage>(OnClientSceneInternal);
NetworkClient.RegisterHandler<ConnectMessage>(OnClientConnectInternal);
NetworkClient.RegisterHandler<DisconnectMessage>(OnClientDisconnectInternal);
NetworkClient.RegisterHandler<NotReadyMessage>(OnClientNotReadyMessageInternal);
NetworkClient.RegisterHandler<ErrorMessage>(OnClientErrorInternal);
NetworkClient.RegisterHandler<SceneMessage>(OnClientSceneInternal);
if (playerPrefab != null)
{