From 712aecb4525b2bb8aacbf9f3ee1e788f991a6e62 Mon Sep 17 00:00:00 2001 From: vis2k Date: Sun, 24 Mar 2019 20:24:30 +0100 Subject: [PATCH] NetworkClient.REgisterHandle made static --- Assets/Mirror/Runtime/NetworkClient.cs | 6 +++--- Assets/Mirror/Runtime/NetworkManager.cs | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Assets/Mirror/Runtime/NetworkClient.cs b/Assets/Mirror/Runtime/NetworkClient.cs index 6a3966f83..28120548a 100644 --- a/Assets/Mirror/Runtime/NetworkClient.cs +++ b/Assets/Mirror/Runtime/NetworkClient.cs @@ -269,7 +269,7 @@ internal void RegisterSystemHandlers(bool localClient) } [Obsolete("Use RegisterHandler 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 instead")] - public void RegisterHandler(MsgType msgType, NetworkMessageDelegate handler) + public static void RegisterHandler(MsgType msgType, NetworkMessageDelegate handler) { RegisterHandler((int)msgType, handler); } - public void RegisterHandler(Action handler) where T : IMessageBase, new() + public static void RegisterHandler(Action handler) where T : IMessageBase, new() { int msgType = MessagePacker.GetId(); if (handlers.ContainsKey(msgType)) diff --git a/Assets/Mirror/Runtime/NetworkManager.cs b/Assets/Mirror/Runtime/NetworkManager.cs index c47615d9e..1a1ee3080 100644 --- a/Assets/Mirror/Runtime/NetworkManager.cs +++ b/Assets/Mirror/Runtime/NetworkManager.cs @@ -300,11 +300,11 @@ public bool StartServer() internal void RegisterClientMessages(NetworkClient client) { - client.RegisterHandler(OnClientConnectInternal); - client.RegisterHandler(OnClientDisconnectInternal); - client.RegisterHandler(OnClientNotReadyMessageInternal); - client.RegisterHandler(OnClientErrorInternal); - client.RegisterHandler(OnClientSceneInternal); + NetworkClient.RegisterHandler(OnClientConnectInternal); + NetworkClient.RegisterHandler(OnClientDisconnectInternal); + NetworkClient.RegisterHandler(OnClientNotReadyMessageInternal); + NetworkClient.RegisterHandler(OnClientErrorInternal); + NetworkClient.RegisterHandler(OnClientSceneInternal); if (playerPrefab != null) {