Example #1
0
        /// <summary>
        ///
        /// </summary>
        public Zone_LoginZoneCluster(string strZoneClusterPassword, string strZonePassword)
            : base((long)ZoneOpCodeToZoneCluster.CMSG_LOGIN_ZONE_CLUSTER, 0 /*4 + ?*/)
        {
            WriterStream.Write((ushort)0 /*4 + ?*/);        // 字段大小
            WriterStream.Write((ushort)base.PacketID);      // 字段编号

            WriterStream.WriteUTF8Null(strZoneClusterPassword);
            WriterStream.WriteUTF8Null(strZonePassword);

            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(0, SeekOrigin.Begin);
            WriterStream.Write((ushort)WriterStream.Length);
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        public ZoneCluster_LoginDomain(string strDomainPassword, string strZoneClusterPassword)
            : base((long)ZoneClusterOpCodeToDomain.CMSG_LOGIN_DOMAIN, 0 /*4 + ?*/)
        {
            WriterStream.Write((ushort)0 /*4 + ?*/);        // 字段大小
            WriterStream.Write((ushort)base.PacketID);      // 字段编号

            WriterStream.WriteUTF8Null(strDomainPassword);
            WriterStream.WriteUTF8Null(strZoneClusterPassword);

            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(0, SeekOrigin.Begin);
            WriterStream.Write((ushort)WriterStream.Length);
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        public Realm_RequestSession(long iLoginId, string strAccountName)
            : base((long)RealmOpCode.SMSG_REQUEST_SESSION, 0)
        {
            WriterStream.Write((byte)RealmOpCode.SMSG_REQUEST_SESSION);
            WriterStream.Write((ushort)0);
            //////////////////////////////////////////////////////////////////////////

            WriterStream.Write((uint)iLoginId);
            WriterStream.WriteUTF8Null(strAccountName);

            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(1, SeekOrigin.Begin);
            WriterStream.Write((ushort)(WriterStream.Length - ProcessNet.REALM_HEAD_SIZE));
        }
Example #4
0
        /// <summary>
        ///
        /// </summary>
        public Word_ChannelNumMembersQueryResponse(string strChannelName, byte bFlags, uint uiNumMembers)
            : base((long)WordOpCode.SMSG_CHANNEL_NUM_MEMBERS_QUERY_RESPONSE, 0)
        {
            WriterStream.Write((ushort)0 /* 2 + ? */);                                      // Size
            WriterStream.Write((ushort)WordOpCode.SMSG_CHANNEL_NUM_MEMBERS_QUERY_RESPONSE); // ID
            //////////////////////////////////////////////////////////////////////////

            WriterStream.WriteUTF8Null(strChannelName);
            WriterStream.Write((byte)bFlags);
            WriterStream.Write((uint)uiNumMembers);

            //////////////////////////////////////////////////////////////////////////
            WriterStream.Seek(0, SeekOrigin.Begin);
            WriterStream.Write((ushort)ByteOrder.NetToHost((ushort)(WriterStream.Length - 2 /*Size本身的大小*/)));
        }
Example #5
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));
        }
Example #6
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));
        }
Example #7
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本身的大小*/)));
        }