Exemple #1
0
        public void BnlsLogonProofRequest(LogonProofRequestToken requestToken)
        {
            if (!IsConnected)
            {
                Connect();
            }

            BnlsPacket logonProof = new BnlsPacket();

            foreach (var saltData in requestToken.Salt)
            {
                logonProof.InsertInt32(saltData);
            }

            foreach (var serverKeyData in requestToken.ServerKey)
            {
                logonProof.InsertInt32(serverKeyData);
            }

            SendPacket(0x03, logonProof);
            Receive(3, requestToken);
        }
Exemple #2
0
        public void BnlsVersionCheckRequest(VersionCheckRequestToken requestToken)
        {
            if (!IsConnected)
            {
                Connect();
            }

            BnlsPacket versionCheckEx2 = new BnlsPacket();

            versionCheckEx2.InsertInt32(requestToken.Product);         // Product
            versionCheckEx2.InsertInt32(0);                            // Flags
            versionCheckEx2.InsertInt32(Environment.TickCount);        // Cookie - unused
            versionCheckEx2.InsertInt64(requestToken.FileTime);        // Filetime
            versionCheckEx2.InsertString(requestToken.VersionName);    // Version file name
            versionCheckEx2.InsertBytes(requestToken.ChecksumFormula); // Checksum Formula
            versionCheckEx2.InsertByte(0x00);

            System.Diagnostics.Debug.WriteLine("Checksum Form");
            DataFormatter.WriteToTrace(requestToken.ChecksumFormula);

            SendPacket(0x1A, versionCheckEx2); // BNLS_VERSIONCHECK
            Receive(3, requestToken);
        }
Exemple #3
0
        public void BnlsLogonChallengeRequest(LogonChallengeRequestToken requestToken)
        {
            if (!IsConnected)
            {
                Connect();
            }

            if (((BnetProduct)requestToken.Product) == BnetProduct.Warcraft3)
            {
                BnlsPacket chooseNlsRevision = new BnlsPacket();
                chooseNlsRevision.InsertInt32(0x02);

                SendPacket(0x0D, chooseNlsRevision);
                Receive(3, requestToken);
            }

            BnlsPacket logonChallenge = new BnlsPacket();

            logonChallenge.InsertString(requestToken.Username);
            logonChallenge.InsertString(requestToken.Password);

            SendPacket(0x02, logonChallenge);
            Receive(3, requestToken);
        }
        public void BnlsVersionCheckRequest(VersionCheckRequestToken requestToken)
        {
            if (!IsConnected)
            {
                Connect();
            }

            BnlsPacket versionCheckEx2 = new BnlsPacket();
            versionCheckEx2.InsertInt32(requestToken.Product); // Product
            versionCheckEx2.InsertInt32(0); // Flags
            versionCheckEx2.InsertInt32(Environment.TickCount); // Cookie - unused
            versionCheckEx2.InsertInt64(requestToken.FileTime); // Filetime
            versionCheckEx2.InsertString(requestToken.VersionName); // Version file name
            versionCheckEx2.InsertBytes(requestToken.ChecksumFormula); // Checksum Formula
            versionCheckEx2.InsertByte(0x00);

            System.Diagnostics.Debug.WriteLine("Checksum Form");
            DataFormatter.WriteToTrace(requestToken.ChecksumFormula);

            SendPacket(0x1A, versionCheckEx2); // BNLS_VERSIONCHECK 
            Receive(3, requestToken);
        }
        public void BnlsLogonChallengeRequest(LogonChallengeRequestToken requestToken)
        {
            if (!IsConnected)
            {
                Connect();
            }

            if (((BnetProduct)requestToken.Product) == BnetProduct.Warcraft3)
            {
                BnlsPacket chooseNlsRevision = new BnlsPacket();
                chooseNlsRevision.InsertInt32(0x02);

                SendPacket(0x0D, chooseNlsRevision);
                Receive(3, requestToken);
            }

            BnlsPacket logonChallenge = new BnlsPacket();
            logonChallenge.InsertString(requestToken.Username);
            logonChallenge.InsertString(requestToken.Password);

            SendPacket(0x02, logonChallenge);
            Receive(3, requestToken);
        }
        public void BnlsLogonProofRequest(LogonProofRequestToken requestToken)
        {
            if (!IsConnected)
            {
                Connect();
            }

            BnlsPacket logonProof = new BnlsPacket();

            foreach (var saltData in requestToken.Salt)
                logonProof.InsertInt32(saltData);

            foreach (var serverKeyData in requestToken.ServerKey)
                logonProof.InsertInt32(serverKeyData);

            SendPacket(0x03, logonProof);
            Receive(3, requestToken);
        }