Пример #1
0
        private void LoginAccountOld()
        {
            switch (m_settings.Client)
            {
            case "W2BN":
                BncsPacket pck0x29 = new BncsPacket((byte)BncsPacketId.LogonResponse);
                pck0x29.Insert(m_clientToken);
                pck0x29.Insert(m_srvToken);
                pck0x29.InsertByteArray(OldAuth.DoubleHashPassword(m_settings.Password, m_clientToken, m_srvToken));
                pck0x29.InsertCString(m_settings.Username);

                Send(pck0x29);
                break;

            case "STAR":
            case "SEXP":
            case "D2DV":
            case "D2XP":
                BncsPacket pck0x3a = new BncsPacket((byte)BncsPacketId.LogonResponse2);
                pck0x3a.Insert(m_clientToken);
                pck0x3a.Insert(m_srvToken);
                pck0x3a.InsertByteArray(OldAuth.DoubleHashPassword(
                                            m_settings.Password,
                                            m_clientToken, m_srvToken));
                pck0x3a.InsertCString(m_settings.Username);

                Send(pck0x3a);
                break;

            default:
                throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture, Strings.BnetClient_LoginAccountOld_ClientNotSupported_fmt, m_settings.Client));
            }
        }
Пример #2
0
        private async void LoginAccountOld()
        {
            switch (_settings.Client.ProductCode)
            {
            case "W2BN":
                BncsPacket pck0x29 = new BncsPacket(BncsPacketId.LogonResponse, _storage.Acquire());
                pck0x29.InsertInt32(_clientToken);
                pck0x29.InsertInt32(_srvToken);
                pck0x29.InsertByteArray(OldAuth.DoubleHashPassword(_settings.Password, _clientToken, _srvToken));
                pck0x29.InsertCString(_settings.Username);

                await pck0x29.SendAsync(_connection);

                break;

            case "STAR":
            case "SEXP":
            case "D2DV":
            case "D2XP":
                BncsPacket pck0x3a = new BncsPacket(BncsPacketId.LogonResponse2, _storage.Acquire());
                pck0x3a.InsertInt32(_clientToken);
                pck0x3a.InsertInt32(_srvToken);
                pck0x3a.InsertByteArray(OldAuth.DoubleHashPassword(_settings.Password, _clientToken, _srvToken));
                pck0x3a.InsertCString(_settings.Username);

                await pck0x3a.SendAsync(_connection);

                break;

            default:
                throw new NotSupportedException(string.Format("Client '{0}' is not supported with old-style account login.", _settings.Client.ProductCode));
            }
        }
Пример #3
0
        private void Send_SID_LOGONREALMEX(string a_sRealmTitle)
        {
            BncsPacket bncsPacket = new BncsPacket(62);

            byte[] b = OldAuth.DoubleHashPassword("password", this.g_iClientToken, this.g_iServerToken);
            bncsPacket.InsertInt32(this.g_iClientToken);
            bncsPacket.InsertByteArray(b);
            bncsPacket.InsertCString(a_sRealmTitle);
            this.SendPacket(bncsPacket.UnderlyingBuffer);
        }
Пример #4
0
        private void Send_SID_LOGONRESPONSE()
        {
            byte[] b = new byte[0];
            b = OldAuth.DoubleHashPassword(this.BnetInfo.BnetPassword, this.g_iClientToken, this.g_iServerToken);
            BncsPacket bncsPacket = new BncsPacket(58);

            bncsPacket.InsertInt32(this.g_iClientToken);
            bncsPacket.InsertInt32(this.g_iServerToken);
            bncsPacket.InsertByteArray(b);
            bncsPacket.InsertCString(this.BnetInfo.BnetUserName);
            this.SendPacket(bncsPacket.UnderlyingBuffer);
        }
Пример #5
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);
        }