protected virtual void OnDisconnect(Event e) { NetworkLogger.Log(NetworkLogEvent.ClientDisconnect); PayloadHandler.PushPayload(new ClientDisconnected { ClientId = Id }); }
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 }); } }
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); } }