Пример #1
0
        public override void OnConnect(ServerSocket parent = null)
        {
            if (ClientConnection.CurrentSession == null)
                throw new Exception("Realm connection with no session");
            var realmparent = parent as RealmClientSocket;
            if (realmparent == null)
                throw new Exception("Realm connection with non realm parent!");

            ClientConnection.CurrentSession.SetRealmInfo(realmparent.GetRealmSettings());

            Random rnd = new Random();
            Seed = (UInt32) rnd.Next();

            PacketOut p = new PacketOut(RealmOp.SMSG_AUTH_CHALLENGE);
            p.Write((int) 1);
            p.Write(Seed);

            p.Write(0xF3539DA3);
            p.Write(0x6E8547B9);
            p.Write(0x9A6AA2F8);
            p.Write(0xA4F170F4);
            p.Write(0xF3539DA3);
            p.Write(0x6E8547B9);
            p.Write(0x9A6AA2F8);
            p.Write(0xA4F170F4);

            SendPacket(p);
        }
Пример #2
0
        private void OnAccept(SocketAsyncEventArgs e)
        {
            if (e.SocketError != SocketError.Success)
            {
                return;
            }

            var newsocket = e.AcceptSocket;

            if (newsocket != null)
            {
                ServerSocket sck = new ServerSocket(newsocket);
                //inherit my packet processor
                sck.SetProcessor((PacketProcessor)Activator.CreateInstance(_processor.GetType()));
                sck._processor.ClientConnection = sck;
                sck.CreateSession();

                sck.OnConnect(this);
                sck.Read();
            }

            Accept();
        }
Пример #3
0
 public virtual void OnConnect(ServerSocket parent = null) { }
Пример #4
0
 public void SetSocket(ServerSocket s) { sock = s; }
Пример #5
0
 public void SetSocket(ServerSocket s)
 {
     ClientConnection = s;
 }
Пример #6
0
 public void SetSocket(ServerSocket s)
 {
     ClientConnection = s;
 }
Пример #7
0
 public virtual void OnConnect(ServerSocket parent = null)
 {
 }
Пример #8
0
 public SocketCommandObserver(ServerSocket s)
 {
     sock = s;
 }
Пример #9
0
 public SocketPacketObserver(ServerSocket s)
 {
     sock = s;
 }