Ejemplo n.º 1
0
 public void Dispose()
 {
     if (!m_Disposed)
     {
         ClientIdentifier client = ClientStorage.GetInstance().RemoveClient(m_ListenSocket);
         this.m_PacketsHander.DirectionFilter.remove(client);
         m_ListenSocket.Disconnect(false);
         this.m_ListenSocket.Dispose();
         this.m_Disposed = true;
         this.m_Other.Dispose();
     }
 }
Ejemplo n.º 2
0
        public override void doAction(int readed)
        {
            EncodeOutgoingPacket(m_ListenSocket, ref data, ref readed);
            int newLenght = 0;

            byte[] asd      = Decompressor.Decompressor.Decompress(data, out newLenght);
            int    packetId = asd[0];

            if (packetId == 0x1C)
            {
                int    usernameLength = getIndex(asd, newLenght);
                String username       = UnicodeEncoding.ASCII.GetString(asd, 14, usernameLength).Replace((char)7, '?');
                String message        = UnicodeEncoding.ASCII.GetString(asd, 44, newLenght - 44).Replace((char)7, '?');
                Console.WriteLine("(((((((" + readed + "))))))))))" + "REMOTE" + "\n" + "NAME: " + username + " MESSAGE: " + message);

                if (worldSaveFinished(username, message))
                {
                    ClientIdentifier   client = ClientStorage.GetInstance().GetClient(m_ListenSocket);
                    Filter <Direction> f      = m_PacketsHander.DirectionFilter.get(client);
                    f.Reset();
                }
            }
        }