/// <summary>
 /// Send Login Information
 /// </summary>
 public void SendLogin(String Account, String Password, String Nickname)
 {
     // Send Login
     CString LoginPacket = new CString () + (byte)2 + "GRNS0000" + (byte)Account.Length + Account + (byte)Password.Length + Password + (short)AppSettings.GetInstance ().NCPort + "\n"
         + (byte)PacketOut.PLAYERPROPS + (byte)0 + (byte)Nickname.Length + Nickname + "\n";
     LoginPacket.ZCompress ().PreLength ();
     this.Send (LoginPacket.Buffer);
 }
Example #2
0
        /// <summary>
        /// Encrypt Packet
        /// </summary>
        public Encrypt.Type EncryptPacket(CString Packet)
        {
            // Encryption Type
            Encrypt.Type EncryptType = Encrypt.Type.UNCOMPRESSED;
            if (Packet.Length > 0x2000)
            { // 8192
                EncryptType = Encrypt.Type.BZ2;
                Packet.BCompress();
            }
            else if (Packet.Length > 0x28)
            { // 40
                EncryptType = Encrypt.Type.ZLIB;
                Packet.WriteShort(0);
                Packet.ZCompress();
            }

            // Apply Encryption
            mCodec.Limit(EncryptType);
            mCodec.Apply(Encrypt.CryptType.ENCRYPT, Packet);
            return EncryptType;
        }
        /// <summary>
        /// Send Login Information
        /// </summary>
        public virtual void SendLogin(String Account, String Password, String Nickname, String VersionString, bool RC = false)
        {
            //Set the nickname
            //this.Nickname = Nickname;
            this._isRC = RC;
            string versionStr = VersionString;
            int versionInt = 5;

            // Key Packet // GNW03014 // G3D14097 // G3D0208A // GSERV025
            if (this.isRC)
            {

                versionInt = 6;
            }

            CString keyPacket = new CString() + (byte)versionInt + (byte)mCodec.Key + versionStr + (byte)Account.Length + Account + (byte)Password.Length + Password + new CString("win").Tokenize() + ",";

            // Unknown hash.
            keyPacket += new CString(this.GetMD5Hash("stefanisabuttmunch")).Tokenize() + ",";

            // MD5 hash.
            keyPacket += new CString(this.GetMD5Hash("unixmadlovesboys")).Tokenize() + "," + new CString(this.GetMD5Hash("suckonthis")).Tokenize() + ",";
            keyPacket += new CString("10.4.0  Darwin Kernel Version 10.4.0: Wed Oct 20 20:14:45 PDT 2010; root:xnu-1504.58.28~3/RELEASE_ARM_S5L8930X").Tokenize();
            keyPacket += "\n";

            //Console.WriteLine(keyPacket.Text);
            keyPacket.ZCompress().PreLength();
            this.Send(keyPacket.Buffer);
        }
        /// <summary>
        /// Send Login Information
        /// </summary>
        public void SendLogin(String Account, String Password, String Nickname)
        {
            //Set the nickname
            this.Nickname = Nickname;

            // Key Packet

            CString keyPacket = new CString() + (byte)0 + "rc\n!" + (byte)Account.Length + Account + (byte)Password.Length + Password + "\n";
            keyPacket.ZCompress().PreLength();
            this.Send(keyPacket.Buffer);
        }
        /// <summary>
        /// Send Login Information
        /// </summary>
        public void SendLogin(String Account, String Password, String Nickname)
        {
            //Set the nickname
            this.Nickname = Nickname;

            string versionStr = "GNW03014";
            int versionInt = 5;

            // Key Packet // GNW03014 // G3D14097 // G3D0208A // GSERV025
            if (this.form.isRC)
            {
                versionStr = "GSERV025";
                versionInt = 6;
            }

            CString keyPacket = new CString() + (byte)versionInt + (byte)mCodec.Key + versionStr + (byte)Account.Length + Account + (byte)Password.Length + Password + new CString("win").Tokenize() + ",";

            // Unknown hash.
            keyPacket += new CString(this.GetMD5Hash("unknown1")).Tokenize() + ",";

            // MD5 hash.
            keyPacket += new CString(this.GetMD5Hash("md5-1")).Tokenize() + "," + new CString(this.GetMD5Hash("md5-2")).Tokenize() + ",";
            keyPacket += new CString("10.4.0  Darwin Kernel Version 10.4.0: Wed Oct 20 20:14:45 PDT 2010; root:xnu-1504.58.28~3/RELEASE_ARM_S5L8930X").Tokenize();
            keyPacket += "\n";

            //Console.WriteLine(keyPacket.Text);
            keyPacket.ZCompress().PreLength();
            this.Send(keyPacket.Buffer);
        }