Пример #1
0
        public virtual void LogonRealm(RealmServer server)
        {
            if (object.ReferenceEquals(server, null))
                throw new ArgumentNullException("server");

            Random r = new Random();
            int clientToken = r.Next();
            byte[] passwordHash = OldAuth.DoubleHashPassword("password", clientToken, m_serverToken);
            BncsPacket pck = new BncsPacket((byte)BncsPacketId.LogonRealmEx);
            pck.InsertInt32(clientToken);
            pck.InsertByteArray(passwordHash);
            pck.InsertCString(server.Title);

            m_client.Send(pck);
        }
Пример #2
0
        private void HandleQueryRealms2(PD data)
        {
            DataReader dr = new DataReader(data.Data);
            dr.Seek(4);
            int count = dr.ReadInt32();
            RealmServer[] realms = new RealmServer[count];
            for (int i = 0; i < count; i++)
            {
                dr.Seek(4);
                string title = dr.ReadCString();
                string desc = dr.ReadCString();

                realms[i] = new RealmServer(title, desc);
            }

            AvailableRealmsEventArgs args = new AvailableRealmsEventArgs(realms) { EventData = data };
            OnRealmsRetrieved(args);
        }
Пример #3
0
        public virtual void LogonRealm(RealmServer server)
        {
            if (object.ReferenceEquals(server, null))
            {
                throw new ArgumentNullException("server");
            }

            Random r           = new Random();
            int    clientToken = r.Next();

            byte[]     passwordHash = OldAuth.DoubleHashPassword("password", clientToken, m_serverToken);
            BncsPacket pck          = new BncsPacket((byte)BncsPacketId.LogonRealmEx);

            pck.InsertInt32(clientToken);
            pck.InsertByteArray(passwordHash);
            pck.InsertCString(server.Title);

            m_client.Send(pck);
        }
Пример #4
0
        private void HandleQueryRealms2(PD data)
        {
            DataReader dr = new DataReader(data.Data);

            dr.Seek(4);
            int count = dr.ReadInt32();

            RealmServer[] realms = new RealmServer[count];
            for (int i = 0; i < count; i++)
            {
                dr.Seek(4);
                string title = dr.ReadCString();
                string desc  = dr.ReadCString();

                realms[i] = new RealmServer(title, desc);
            }

            AvailableRealmsEventArgs args = new AvailableRealmsEventArgs(realms)
            {
                EventData = data
            };

            OnRealmsRetrieved(args);
        }
Пример #5
0
 public AvailableRealmsEventArgs(RealmServer[] realms)
 {
     m_realms = realms;
 }