mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkClient.REgisterHandle made static
This commit is contained in:
parent
ba00554e0c
commit
712aecb452
@ -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))
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user