예제 #1
0
 protected virtual void OnDisconnect(Event e)
 {
     NetworkLogger.Log(NetworkLogEvent.ClientDisconnect);
     PayloadHandler.PushPayload(new ClientDisconnected {
         ClientId = Id
     });
 }
예제 #2
0
        private void PushClientConnected(ClientAssigned p)
        {
            NetworkLogger.Log("Client connection finalized", LogCategory.Connections);
            PayloadHandler.RemoveCallback <ClientAssigned>(PushClientConnected);

            if (ClientManager.TryGetClient(p.id, out var client))
            {
                PayloadHandler.PushPayload(new ClientConnected {
                    Client = client
                });
            }
        }
예제 #3
0
        protected override void OnDisconnect(Event e)
        {
            Peer peer = e.Peer;
            uint id   = peer.ID + 1;

            if (peer.IsSet)
            {
                NetworkLogger.Log($"Client [{id}] disconnected", LogCategory.Connections);
                ClientManager?.RemoveClient(id);
                PayloadHandler.PushPayload(new ClientDisconnected {
                    ClientId = id
                });
            }
            else
            {
                NetworkLogger.Log("Unset peer disconnected!", LogCategory.Connections, LogLevel.Error);
            }
        }