Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        internal Unknown0x07E5_Action0x01Ack()
            : base(0x7E5, 9 /*6 + 3*/)
        {
            WriterStream.Write((ushort)9 /*6 + 3*/);        // ×ֶδóС
            WriterStream.Write((ushort)base.PacketID);      // ×ֶαàºÅ
            WriterStream.Write((ushort)0x00);               // ×ֶα£Áô
            //////////////////////////////////////////////////////////////////////////


            WriterStream.Write((byte)0x01);
            WriterStream.Write((ushort)0x0000);


            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(0, SeekOrigin.Begin);
            WriterStream.Write((ushort)WriterStream.Length);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        internal DeleteCharacterAck(string strCharacterName, uint iDeleteTime)
            : base(0x0714, 0 /*6 + ?*/)
        {
            WriterStream.Write((ushort)0 /*6 + ?*/);
            WriterStream.Write((ushort)base.PacketID);      // ×ֶαàºÅ
            WriterStream.Write((ushort)0x00);               // ×ֶα£Áô
            //////////////////////////////////////////////////////////////////////////


            WriterStream.Write((uint)iDeleteTime);
            WriterStream.WriteAsciiNull(strCharacterName);


            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(0, SeekOrigin.Begin);
            WriterStream.Write((ushort)WriterStream.Length);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        internal Clan0x7E0_Action0x0D_Ack(string strName)
            : base(0x7E0, 0 /*6 + ?*/)
        {
            WriterStream.Write((ushort)0 /*6 + ?*/);        // ×ֶδóС
            WriterStream.Write((ushort)base.PacketID);      // ×ֶαàºÅ
            WriterStream.Write((ushort)0x00);               // ×ֶα£Áô
            //////////////////////////////////////////////////////////////////////////


            WriterStream.Write((byte)0x0D);   //
            WriterStream.WriteAsciiNull(strName);


            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(0, SeekOrigin.Begin);
            WriterStream.Write((ushort)WriterStream.Length);
        }
Ejemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        internal ClanChatAck(string strName, string strText)
            : base(0x787, 0 /*6 + ?*/)
        {
            WriterStream.Write((ushort)0 /*6 + ?*/);        // ×ֶδóС
            WriterStream.Write((ushort)base.PacketID);      // ×ֶαàºÅ
            WriterStream.Write((ushort)0x00);               // ×ֶα£Áô
            //////////////////////////////////////////////////////////////////////////


            WriterStream.WriteAsciiNull(strName);
            WriterStream.WriteAsciiNull(strText);   //


            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(0, SeekOrigin.Begin);
            WriterStream.Write((ushort)WriterStream.Length);
        }
Ejemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        internal Clan0x7E0_Action0x83_Ack(string strCharName, long iRank)
            : base(0x7E0, 0 /*6 + ?*/)
        {
            WriterStream.Write((ushort)0 /*6 + ?*/);        // ×ֶδóС
            WriterStream.Write((ushort)base.PacketID);      // ×ֶαàºÅ
            WriterStream.Write((ushort)0x00);               // ×ֶα£Áô
            //////////////////////////////////////////////////////////////////////////


            WriterStream.Write((byte)0x83);   // up/down rank
            WriterStream.WriteAsciiNull(strCharName);
            WriterStream.Write((uint)iRank);


            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(0, SeekOrigin.Begin);
            WriterStream.Write((ushort)WriterStream.Length);
        }
Ejemplo n.º 6
0
        /// <summary>
        ///
        /// </summary>
        public Realm_LoginRealmServer()
            : base((long)RealmOpCode.SMSG_REGISTER_REALM, 0)
        {
            WriterStream.Write((byte)RealmOpCode.SMSG_REGISTER_REALM);
            WriterStream.Write((ushort)0);
            //////////////////////////////////////////////////////////////////////////

            WriterStream.WriteUTF8Null(ProcessServer.ConfigInfo.WowConfig.WorldName);
            WriterStream.WriteUTF8Null(ProcessServer.ConfigInfo.WowConfig.WorldServerHost + ":" + ProcessServer.ConfigInfo.WowConfig.WorldServerPort.ToString());
            WriterStream.WriteUTF8Null(ProcessServer.ConfigInfo.WowConfig.Icon);
            WriterStream.Write((uint)ProcessServer.ConfigInfo.WowConfig.Colour);
            WriterStream.Write((uint)ProcessServer.ConfigInfo.WowConfig.TimeZone);
            WriterStream.Write((float)ProcessServer.ConfigInfo.WowConfig.Population);

            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(1, SeekOrigin.Begin);
            WriterStream.Write((ushort)(WriterStream.Length - ProcessNet.REALM_HEAD_SIZE));
        }
Ejemplo n.º 7
0
        /// <summary>
        ///
        /// </summary>
        internal RequestWorldAck(IPEndPoint ipEndPoint, long iAccountsGuid)
            : base(0x711, 0 /*6 + ?*/)
        {
            WriterStream.Write((ushort)0 /*6 + ?*/);        // ×ֶδóС
            WriterStream.Write((ushort)base.PacketID);      // ×ֶαàºÅ
            WriterStream.Write((ushort)0x00);               // ×ֶα£Áô
            //////////////////////////////////////////////////////////////////////////


            WriterStream.Write((ushort)ipEndPoint.Port);
            WriterStream.Write((uint)iAccountsGuid);
            WriterStream.Write((uint)0x87654321);
            WriterStream.WriteAsciiNull(ipEndPoint.Address.ToString());


            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(0, SeekOrigin.Begin);
            WriterStream.Write((ushort)WriterStream.Length);
        }
Ejemplo n.º 8
0
        /// <summary>
        ///
        /// </summary>
        internal GetCharactersAck(PacketCharacter[] characterArray) : base(0x0712, 0 /*6 + ?*/)
        {
            WriterStream.Write((ushort)0 /*6 + ?*/);        // ×ֶδóС(Ö»°üÀ¨ÈËÎïµÄÊýÁ¿£¬ÏêϸÊý¾Ý²»ËµÃ÷)
            WriterStream.Write((ushort)base.PacketID);      // ×ֶαàºÅ
            WriterStream.Write((ushort)0x00);               // ×ֶα£Áô
            //////////////////////////////////////////////////////////////////////////


            WriterStream.Write((sbyte)characterArray.Length);

            for (int iIndex = 0; iIndex < characterArray.Length; iIndex++)
            {
                WriterStream.WriteAsciiNull(characterArray[iIndex].m_CharacterName);    // Character Name
                WriterStream.Write((sbyte)characterArray[iIndex].m_Sex);                // SEX
                WriterStream.Write((ushort)characterArray[iIndex].m_Level);             // LEVEL
                WriterStream.Write((ushort)characterArray[iIndex].m_ClassID);           // CLASS ID
                WriterStream.Write((uint)characterArray[iIndex].m_DeleteTime);          // DELETE TIME
                WriterStream.Write((sbyte)0x00);                                        // IS PLATINUM?  00-NO;01-YES;02-YES BUT USER IS NOT
                WriterStream.Write((uint)characterArray[iIndex].m_Face);                // FACE
                WriterStream.Write((uint)characterArray[iIndex].m_HairStyle);           // HAIR
                WriterStream.Write((ushort)characterArray[iIndex].m_Item[2].m_ItemID);  // CAP
                WriterStream.Write((ushort)characterArray[iIndex].m_Item[2].m_Refine);  // CAP REFINE
                WriterStream.Write((ushort)characterArray[iIndex].m_Item[3].m_ItemID);  // BODY
                WriterStream.Write((ushort)characterArray[iIndex].m_Item[3].m_Refine);  // BODY REFINE
                WriterStream.Write((ushort)characterArray[iIndex].m_Item[5].m_ItemID);  // GLOVES
                WriterStream.Write((ushort)characterArray[iIndex].m_Item[5].m_Refine);  // GLOVES REFINE
                WriterStream.Write((ushort)characterArray[iIndex].m_Item[6].m_ItemID);  // BOOTS
                WriterStream.Write((ushort)characterArray[iIndex].m_Item[6].m_Refine);  // BOOTS REFINE
                WriterStream.Write((ushort)characterArray[iIndex].m_Item[1].m_ItemID);  // FACE
                WriterStream.Write((ushort)characterArray[iIndex].m_Item[1].m_Refine);  // FACE REFINE
                WriterStream.Write((ushort)characterArray[iIndex].m_Item[4].m_ItemID);  // BACK
                WriterStream.Write((ushort)characterArray[iIndex].m_Item[4].m_Refine);  // BACK REFINE
                WriterStream.Write((ushort)characterArray[iIndex].m_Item[7].m_ItemID);  // WEAPON
                WriterStream.Write((ushort)characterArray[iIndex].m_Item[7].m_Refine);  // WEAPON REFINE
                WriterStream.Write((ushort)characterArray[iIndex].m_Item[8].m_ItemID);  // SUBWEAPON
                WriterStream.Write((ushort)characterArray[iIndex].m_Item[8].m_Refine);  // SUBWEAPON REFINE
            }


            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(0, SeekOrigin.Begin);
            WriterStream.Write((ushort)WriterStream.Length);
        }
Ejemplo n.º 9
0
        /// <summary>
        ///
        /// </summary>
        public Word_AuthResponsePending(uint iPosition)
            : base((long)WordOpCode.SMSG_AUTH_RESPONSE, 0)
        {
            WriterStream.Write((ushort)ByteOrder.NetToHost(16) /* 2 + 14 */); // Size
            WriterStream.Write((ushort)WordOpCode.SMSG_AUTH_RESPONSE);        // ID
            //////////////////////////////////////////////////////////////////////////

            WriterStream.Write((byte)ResponseCodes.AUTH_WAIT_QUEUE);

            WriterStream.Write((byte)0x2C);
            WriterStream.Write((byte)0x73);
            WriterStream.Write((byte)0x00);
            WriterStream.Write((byte)0x00);

            WriterStream.Write((uint)0x00);
            WriterStream.Write((byte)0x00);

            WriterStream.Write((uint)iPosition);
        }
Ejemplo n.º 10
0
        /// <summary>
        ///
        /// </summary>
        internal Friend0x7E1_Action0x02_Ack(long iCharGuid, string strName)
            : base(0x7E1, 0 /*6 + ?*/)
        {
            WriterStream.Write((ushort)0 /*6 + ?*/);        // ×ֶδóС
            WriterStream.Write((ushort)base.PacketID);      // ×ֶαàºÅ
            WriterStream.Write((ushort)0x00);               // ×ֶα£Áô
            //////////////////////////////////////////////////////////////////////////


            WriterStream.Write((byte)0x02);
            WriterStream.Write((ushort)iCharGuid);
            WriterStream.Write((byte)0x00);
            WriterStream.Write((ushort)0x0000);
            WriterStream.WriteAsciiNull(strName);


            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(0, SeekOrigin.Begin);
            WriterStream.Write((ushort)WriterStream.Length);
        }
Ejemplo n.º 11
0
        /// <summary>
        ///
        /// </summary>
        internal GetServerIPAck(ServerInfo serverInfo, int iAccountsGuid)
            : base(0x70A, 0 /*6 + ?*/)
        {
            WriterStream.Write((ushort)0 /*6 + ?*/);        // ×ֶδóС
            WriterStream.Write((ushort)base.PacketID);      // ×ֶαàºÅ
            WriterStream.Write((ushort)0x00);               // ×ֶα£Áô
            //////////////////////////////////////////////////////////////////////////


            WriterStream.Write((sbyte)serverInfo.FullPercent);
            WriterStream.Write((uint)iAccountsGuid);
            WriterStream.Write((uint)0x87654321);
            WriterStream.WriteAsciiNull(serverInfo.Address.Address.ToString());
            WriterStream.Write((ushort)serverInfo.Address.Port);


            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(0, SeekOrigin.Begin);
            WriterStream.Write((ushort)WriterStream.Length);
        }
Ejemplo n.º 12
0
        /// <summary>
        ///
        /// </summary>
        internal Clan0x7E0_Action0x33_Ack(Clan clan, long iClanRank)
            : base(0x7E0, 0 /*6 + ?*/)
        {
            WriterStream.Write((ushort)0 /*6 + ?*/);        // ×ֶδóС
            WriterStream.Write((ushort)base.PacketID);      // ×ֶαàºÅ
            WriterStream.Write((ushort)0x00);               // ×ֶα£Áô
            //////////////////////////////////////////////////////////////////////////


            WriterStream.Write((byte)0x33);                 // 0x33 you have invited to clan
            WriterStream.Write((ushort)0x09CF);
            WriterStream.Write((byte)0x00);
            WriterStream.Write((byte)0x00);

            WriterStream.Write((ushort)clan.Back);        // Clan Background
            WriterStream.Write((ushort)clan.Logo);        // Clan logo
            WriterStream.Write((byte)clan.Grade);         // Clan grade
            WriterStream.Write((byte)iClanRank);          // Clan rank (0 = red rokie / 6 = master)
            WriterStream.Write((byte)clan.CP);            // Clan Points
            WriterStream.Write((uint)0x00000000);
            WriterStream.Write((uint)0x00000000);         // Clan found
            WriterStream.Write((byte)0x00);
            WriterStream.Write((uint)0x00000000);
            WriterStream.Write((ushort)0x0000);

            for (int iIndex = 34; iIndex < 156; iIndex++)
            {
                WriterStream.Write((byte)0x00);
            }

            WriterStream.Write((ushort)0x0000);
            WriterStream.Write((byte)0x00);
            WriterStream.WriteAsciiNull(clan.ClanName);
            WriterStream.WriteAsciiNull(clan.Slogan);
            WriterStream.WriteAsciiNull(clan.News);


            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(0, SeekOrigin.Begin);
            WriterStream.Write((ushort)WriterStream.Length);
        }
Ejemplo n.º 13
0
        /// <summary>
        ///
        /// </summary>
        public Realm_RequestSessionResult(uint iSerial, WowAccount account, SecureRemotePassword srp)
            : base((long)RealmOpCode.CMSG_REQUEST_SESSION_RESULT, 0 /* ProcessNet.REALM_HEAD_SIZE + ? */)
        {
            WriterStream.Write((byte)RealmOpCode.CMSG_REQUEST_SESSION_RESULT);      // ×ֶαàºÅ
            WriterStream.Write((ushort)0);                                          // ×Ö¶ÎÊ£Óà´óС
            //////////////////////////////////////////////////////////////////////////

            WriterStream.Write((uint)iSerial);
            WriterStream.Write(true);       // ³É¹¦

            WriterStream.Write((uint)account.AccountGuid);
            WriterStream.Write((int)account.AccessLevel);
            WriterStream.Write((bool)account.IsTBC);

            byte[] byteSessionKey = srp.SessionKey.GetBytes(40);
            WriterStream.Write(byteSessionKey, 0, 40);

            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(1, SeekOrigin.Begin);
            WriterStream.Write((ushort)(WriterStream.Length - ProcessNet.REALM_HEAD_SIZE));
        }
Ejemplo n.º 14
0
        /// <summary>
        ///
        /// </summary>
        public Word_RealmSplitStateRequest(uint iUnknown)
            : base((long)WordOpCode.SMSG_REALM_SPLIT_STATE_RESPONSE, 0)
        {
            WriterStream.Write((ushort)0 /* 2 + ? */);                              // Size
            WriterStream.Write((ushort)WordOpCode.SMSG_REALM_SPLIT_STATE_RESPONSE); // ID
            //////////////////////////////////////////////////////////////////////////

            //WriterStream.Write( (uint)iUnknown );
            //WriterStream.Write( (uint)0 );

            //WriterStream.WriteUTF8Null( "01/01/01" );

            byte[] nnn = new byte[] {
                0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x30, 0x31, 0x2F, 0x30, 0x31, 0x2F, 0x30, 0x31, 0x00,
            };

            WriterStream.Write(nnn, 0, nnn.Length);

            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(0, SeekOrigin.Begin);
            WriterStream.Write((ushort)ByteOrder.NetToHost((ushort)(WriterStream.Length - 2 /*Size本身的大小*/)));
        }
Ejemplo n.º 15
0
        /// <summary>
        ///
        /// </summary>
        internal EncryptionRequestAck()
            : base(0x7FF, 34 /*6 + 28*/)
        {
            WriterStream.Write((ushort)34 /*6 + 28*/);      // ×ֶδóС
            WriterStream.Write((ushort)base.PacketID);      // ×ֶαàºÅ
            WriterStream.Write((ushort)0x00);               // ×ֶα£Áô
            //////////////////////////////////////////////////////////////////////////


            WriterStream.Write((ushort)0xAF02);
            WriterStream.Write((ushort)0xBD46);
            WriterStream.Write((ushort)0x0009);
            WriterStream.Write((ushort)0x0012);
            WriterStream.Write((byte)0x00);

            WriterStream.Write((uint)0xCDCDCDCD);
            WriterStream.Write((uint)0xCDCDCDCD);
            WriterStream.Write((uint)0xCDCDCDCD);
            WriterStream.Write((uint)0xCDCDCDCD);
            WriterStream.Write((ushort)0xCDCD);
            WriterStream.Write((byte)0xD3);
        }
Ejemplo n.º 16
0
        /// <summary>
        ///
        /// </summary>
        public CreateCharacterRej(CCLReason cclReason)
            : base(0x0713, 8 /*6 + 2*/)
        {
            WriterStream.Write((ushort)8 /*6 + 2*/);
            WriterStream.Write((ushort)base.PacketID);      // ×ֶαàºÅ
            WriterStream.Write((ushort)0x00);               // ×ֶα£Áô
            //////////////////////////////////////////////////////////////////////////


            if (cclReason == CCLReason.BadAccountName)
            {
                WriterStream.Write((ushort)4);      // ÏàͬµÄÕʺÅÃûÒѾ­´æÔÚ
            }
            else if (cclReason == CCLReason.BadCharacterName)
            {
                WriterStream.Write((ushort)2);      // ÓÎÏ·Ãû×ÖÒѾ­´æÔÚ»òÒѹýÂ˵ÄÎļþÃû
            }
            else
            {
                WriterStream.Write((ushort)0);
            }
        }
Ejemplo n.º 17
0
        /// <summary>
        ///
        /// </summary>
        internal Clan0x7E0_Action0x73_Ack(long iServerGuid, long iLevel, long iClassId, string strCharName)
            : base(0x7E0, 0 /*6 + ?*/)
        {
            WriterStream.Write((ushort)0 /*6 + ?*/);        // ×ֶδóС
            WriterStream.Write((ushort)base.PacketID);      // ×ֶαàºÅ
            WriterStream.Write((ushort)0x00);               // ×ֶα£Áô
            //////////////////////////////////////////////////////////////////////////


            WriterStream.Write((byte)0x73);
            WriterStream.Write((byte)0x00);
            WriterStream.Write((byte)iServerGuid);
            WriterStream.Write((ushort)0x0000);
            WriterStream.Write((ushort)0x0000);
            WriterStream.Write((ushort)iLevel);
            WriterStream.Write((ushort)iClassId);
            WriterStream.WriteAsciiNull(strCharName);


            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(0, SeekOrigin.Begin);
            WriterStream.Write((ushort)WriterStream.Length);
        }
Ejemplo n.º 18
0
        /// <summary>
        ///
        /// </summary>
        internal Clan0x7E0_Action0x75_Ack(long iRank, long iServerGuid, long iLevel, long iJob, string strCharName)
            : base(0x7E0, 0 /*6 + ?*/)
        {
            WriterStream.Write((ushort)0 /*6 + ?*/);        // ×ֶδóС
            WriterStream.Write((ushort)base.PacketID);      // ×ֶαàºÅ
            WriterStream.Write((ushort)0x00);               // ×ֶα£Áô
            //////////////////////////////////////////////////////////////////////////


            WriterStream.Write((byte)0x75);        // up rank
            WriterStream.Write((byte)iRank);       //
            WriterStream.Write((byte)iServerGuid); // channel
            WriterStream.Write((short)0x0000);     //
            WriterStream.Write((short)0x0000);     //
            WriterStream.Write((short)iLevel);     //
            WriterStream.Write((short)iJob);       //
            WriterStream.WriteAsciiNull(strCharName);


            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(0, SeekOrigin.Begin);
            WriterStream.Write((ushort)WriterStream.Length);
        }
Ejemplo n.º 19
0
        /// <summary>
        ///
        /// </summary>
        public Auth_RealmListResult()
            : base((long)AuthOpCode.CMSG_REALM_LIST_RESULT, 0)
        {
            WriterStream.Write((byte)AuthOpCode.CMSG_REALM_LIST_RESULT);
            WriterStream.Write((ushort)0);
            //////////////////////////////////////////////////////////////////////////

            // dunno what this is..
            WriterStream.Write((uint)0);

            Realm[] realmArrray = RealmHandler.RealmsToArray();

            WriterStream.Write((ushort)realmArrray.Length);

            foreach (Realm itemRealm in realmArrray)
            {
                WriterStream.Write((byte)itemRealm.Colour);
                WriterStream.Write((byte)0);                         // Locked Flag. if 1, then realm locked. if 2, then realm is offline
                WriterStream.Write((byte)itemRealm.Icon);

                WriterStream.WriteUTF8Null(itemRealm.Name);
                WriterStream.WriteUTF8Null(itemRealm.Address);

                WriterStream.Write((float)itemRealm.Population);     //this is population 0.5 = low 1.0 = medium 2.0 high     (float)(maxplayers / players)*2
                WriterStream.Write((byte)0);                         // Character Count 在这个服务器内创建的人物数量
                WriterStream.Write((byte)itemRealm.TimeZone);        // time zone
                WriterStream.Write((byte)0);                         // unk, may be realm number/id?
            }

            WriterStream.Write((byte)0x15);
            WriterStream.Write((byte)0);

            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(1, SeekOrigin.Begin);
            WriterStream.Write((ushort)(WriterStream.Length - 3));
        }
Ejemplo n.º 20
0
 /// <summary>
 ///
 /// </summary>
 public void Write(Packet packet)
 {
     WriterStream.Write(packet.WriterStream.ToArray(), 0, (int)packet.WriterStream.Length);
 }
Ejemplo n.º 21
0
 /// <summary>
 ///
 /// </summary>
 public Zone_PingZoneCluster()
     : base((long)ZoneOpCodeToZoneCluster.CMSG_PING_ZONE_CLUSTER, 4 /*4 + 0*/)
 {
     WriterStream.Write((ushort)4 /*4 + 0*/);        // 字段大小
     WriterStream.Write((ushort)base.PacketID);      // 字段编号
 }
Ejemplo n.º 22
0
 /// <summary>
 ///
 /// </summary>
 public Realm_Pong()
     : base((long)RealmOpCode.CMSG_PONG, 0 /* ProcessNet.REALM_HEAD_SIZE + 0 */)
 {
     WriterStream.Write((byte)RealmOpCode.CMSG_PONG);     // ×ֶαàºÅ
     WriterStream.Write((ushort)0);                       // ×Ö¶ÎÊ£Óà´óС
 }
Ejemplo n.º 23
0
        /// <summary>
        ///
        /// </summary>
        public Word_CharEnumResponse(WowCharEnumCharacterInfo[] characterInfoArray)
            : base((long)WordOpCode.SMSG_CHAR_ENUM, 0)
        {
            WriterStream.Write((ushort)0 /* 2 + ? */);                // Size
            WriterStream.Write((ushort)WordOpCode.SMSG_CHAR_ENUM);    // ID
            //////////////////////////////////////////////////////////////////////////

            WriterStream.Write((byte)characterInfoArray.Length);

            if (characterInfoArray.Length > 0)
            {
                foreach (WowCharEnumCharacterInfo wowCharacterInfo in characterInfoArray)
                {
                    WriterStream.Write((ulong)wowCharacterInfo.CharacterGuid);
                    WriterStream.WriteUTF8Null((string)wowCharacterInfo.Name);

                    WriterStream.Write((byte)wowCharacterInfo.Race);
                    WriterStream.Write((byte)wowCharacterInfo.Class);
                    WriterStream.Write((byte)wowCharacterInfo.Gender);

                    WriterStream.Write((byte)wowCharacterInfo.Skin);
                    WriterStream.Write((byte)wowCharacterInfo.Face);
                    WriterStream.Write((byte)wowCharacterInfo.HairStyle);
                    WriterStream.Write((byte)wowCharacterInfo.HairColor);
                    WriterStream.Write((byte)wowCharacterInfo.FacialHair);

                    WriterStream.Write((byte)wowCharacterInfo.Level);

                    WriterStream.Write((uint)wowCharacterInfo.ZoneId);
                    WriterStream.Write((uint)wowCharacterInfo.MapId);

                    WriterStream.Write((float)wowCharacterInfo.PositionX);
                    WriterStream.Write((float)wowCharacterInfo.PositionY);
                    WriterStream.Write((float)wowCharacterInfo.PositionZ);

                    WriterStream.Write((uint)wowCharacterInfo.GuildGuid);

                    WriterStream.Write((byte)0);
                    // 0x01
                    // 0x02
                    // 0x04 - CHAR_LOGIN_LOCKED_FOR_TRANSFER
                    // 0x08
                    // 0x10
                    // 0x20
                    // 0x40

                    byte iFlags = 0;
                    if (wowCharacterInfo.IsHideHelm == true)
                    {
                        iFlags |= 0x04;
                    }
                    if (wowCharacterInfo.IsHideCloak == true)
                    {
                        iFlags |= 0x08;
                    }
                    if (wowCharacterInfo.IsGhost == true)
                    {
                        iFlags |= 0x20;
                    }
                    if (wowCharacterInfo.IsNeedRename == true)
                    {
                        iFlags |= 0x40;
                    }
                    WriterStream.Write((byte)iFlags);

                    WriterStream.Write((byte)0xA0); // unknown

                    WriterStream.Write((byte)0);    // unknown
                    // 0x01 - CHAR_LOGIN_LOCKED_BY_BILLING

                    WriterStream.Write((byte)1);   // unknown

                    if (wowCharacterInfo.PetInfo != null)
                    {
                        WriterStream.Write((uint)wowCharacterInfo.PetInfo.PetModelId);
                        WriterStream.Write((uint)wowCharacterInfo.PetInfo.PetLevel);
                        WriterStream.Write((uint)wowCharacterInfo.PetInfo.PetFamily);
                    }
                    else
                    {
                        WriterStream.Write((uint)0);
                        WriterStream.Write((uint)0);
                        WriterStream.Write((uint)0);
                    }

                    for (int iIndex = 0; iIndex < wowCharacterInfo.Equipment.Length; iIndex++)
                    {
                        if (wowCharacterInfo.Equipment[iIndex] != null)
                        {
                            WriterStream.Write((uint)wowCharacterInfo.Equipment[iIndex].ModelID);
                            WriterStream.Write((byte)wowCharacterInfo.Equipment[iIndex].InventoryType);
                        }
                        else
                        {
                            WriterStream.Write((uint)0);
                            WriterStream.Write((byte)0);
                        }
                    }

                    WriterStream.Write((uint)0);   // first bag display id
                    WriterStream.Write((byte)0);   // first bag inventory type
                }
            }

            //byte[] nnn = new byte[] {
            //     0xD0, 0xF0, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x61, 0x69, 0x68, 0x75, 0x61, 0x6E, 0x71, 0x69, 0x6E, 0x67, 0x00, 0x0A, 0x02, 0x01, 0x00, 0x03, 0x09, 0x05, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x02, 0x00, 0x00, 0x66, 0xB6, 0x21, 0x46, 0x52, 0xAA, 0xC6, 0xC5, 0x43, 0x9C, 0x05, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB5, 0x8F, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB6, 0x8F, 0x00, 0x00, 0x07, 0xB9, 0x8F, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4C, 0x09, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
            //};

            //WriterStream.Write( nnn, 0, nnn.Length );

            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(0, SeekOrigin.Begin);
            WriterStream.Write((ushort)ByteOrder.NetToHost((ushort)(WriterStream.Length - 2 /*Size本身的大小*/)));
        }
Ejemplo n.º 24
0
 /// <summary>
 ///
 /// </summary>
 internal BufferPacket(byte[] byteBuffer, long iOffset, long iSize)
     : base(0)
 {
     WriterStream.Write(byteBuffer, (int)iOffset, (int)iSize);
 }
Ejemplo n.º 25
0
        /// <summary>
        ///
        /// </summary>
        internal AccountLoginRej(LoginReason alrReason)
            : base(0x708, 11 /*6 + 5*/)
        {
            WriterStream.Write((ushort)11 /*6 + 5*/);       // ×ֶδóС
            WriterStream.Write((ushort)base.PacketID);      // ×ֶαàºÅ
            WriterStream.Write((ushort)0x00);               // ×ֶα£Áô
            //////////////////////////////////////////////////////////////////////////


            if (alrReason == LoginReason.GeneralError)
            {
                WriterStream.Write((sbyte)0x01);
                WriterStream.Write((int)0x0);
            }
            else if (alrReason == LoginReason.NameError)
            {
                WriterStream.Write((sbyte)0x02);
                WriterStream.Write((int)0x0);
            }
            else if (alrReason == LoginReason.PasswordError)
            {
                WriterStream.Write((sbyte)0x03);
                WriterStream.Write((int)0x0);
            }
            else if (alrReason == LoginReason.InUse)
            {
                WriterStream.Write((sbyte)0x04);
                WriterStream.Write((int)0x0);
            }
            else if (alrReason == LoginReason.Blocked)
            {
                WriterStream.Write((sbyte)0x05);
                WriterStream.Write((int)0x0);
            }
            else if (alrReason == LoginReason.TopUpAccount)
            {
                WriterStream.Write((sbyte)0x06);
                WriterStream.Write((int)0x0);
            }
            else if (alrReason == LoginReason.ServerError)
            {
                WriterStream.Write((sbyte)0x07);
                WriterStream.Write((int)0x0);
            }
            else if (alrReason == LoginReason.ServerCapacityFull)
            {
                WriterStream.Write((sbyte)0x08);
                WriterStream.Write((int)0x0);
            }
            else if (alrReason == LoginReason.AccountInvalid)
            {
                WriterStream.Write((sbyte)0x09);
                WriterStream.Write((int)0x0);
            }
            else if (alrReason == LoginReason.LoginFailed)
            {
                WriterStream.Write((sbyte)0x10);
                WriterStream.Write((int)0x0);
            }
            else if (alrReason == LoginReason.IPCapacityFull)
            {
                WriterStream.Write((sbyte)0x11);
                WriterStream.Write((int)0x0);
            }
            else
            {
                WriterStream.Write((sbyte)0x05);
                WriterStream.Write((int)0x0);
            }
        }