private void ProcessConnections() { while (_tcpListener.Pending()) { TcpClient tcpClient = _tcpListener.AcceptTcpClient(); DreamConnection dreamConnection = new DreamConnection(tcpClient); DreamConnections.Add(dreamConnection); } }
private void OnPacketRequestConnect(DreamConnection connection, PacketRequestConnect pRequestConnect) { if (!_ckeyToConnection.ContainsKey(pRequestConnect.CKey)) { connection.CKey = pRequestConnect.CKey; DreamConnectionRequest.Invoke(connection); } else { connection.SendPacket(new PacketConnectionResult(false, "A connection with your ckey already exists")); } }