public void OnLostConnection(IDoubleServerClient client, DoubleServer.ClientState state) { if (state == DoubleServer.ClientState.Authenticated) { UnityFixedDispatcher.InvokeNoDelay(() => { if (_server != null) { NetworkServerClient serverClient = (NetworkServerClient)client.ExtraData; lock (UdpPayloadLock) { //Don't let the TickingThread send before the client is deinitialized _clients.Remove(serverClient); DisconnectHandler(serverClient); } } }); } }
public void OnLostConnection(IDoubleServerClient client, DoubleServer.ClientState state) { if (state != DoubleServer.ClientState.Authenticated) { return; } Player disconnectedPlayer = (Player)client.ExtraData; _players.Remove(disconnectedPlayer); _colors.Enqueue(disconnectedPlayer.Color); foreach (Player player in _players) { _server.SendTcp(player.ServerClient, buffer => { buffer.Write(false); buffer.WriteBits(disconnectedPlayer.Id, 2); }); } }
public void OnLostConnection(IDoubleServerClient client, DoubleServer.ClientState state) { Console.WriteLine($"Server lost connection to client ({state})"); }