예제 #1
0
        private void ProcessConnections()
        {
            while (_tcpListener.Pending())
            {
                TcpClient       tcpClient       = _tcpListener.AcceptTcpClient();
                DreamConnection dreamConnection = new DreamConnection(tcpClient);

                DreamConnections.Add(dreamConnection);
            }
        }
예제 #2
0
        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"));
            }
        }