コード例 #1
0
ファイル: MiscHandler.cs プロジェクト: PeterG75/CypherCore
        public void SendLoadCUFProfiles()
        {
            Player player = GetPlayer();

            LoadCUFProfiles loadCUFProfiles = new LoadCUFProfiles();

            for (byte i = 0; i < PlayerConst.MaxCUFProfiles; ++i)
            {
                CUFProfile cufProfile = player.GetCUFProfile(i);
                if (cufProfile != null)
                    loadCUFProfiles.CUFProfiles.Add(cufProfile);
            }

            SendPacket(loadCUFProfiles);
        }
コード例 #2
0
ファイル: MiscPackets.cs プロジェクト: hassiumsoft/CypherCore
        public override void Read()
        {
            uint count = _worldPacket.ReadUInt32();

            for (byte i = 0; i < count && i < PlayerConst.MaxCUFProfiles; i++)
            {
                CUFProfile cufProfile = new CUFProfile();

                byte strLen = _worldPacket.ReadBits <byte>(7);

                // Bool Options
                for (byte option = 0; option < (int)CUFBoolOptions.BoolOptionsCount; option++)
                {
                    cufProfile.BoolOptions.Set(option, _worldPacket.HasBit());
                }

                // Other Options
                cufProfile.FrameHeight = _worldPacket.ReadUInt16();
                cufProfile.FrameWidth  = _worldPacket.ReadUInt16();

                cufProfile.SortBy     = _worldPacket.ReadUInt8();
                cufProfile.HealthText = _worldPacket.ReadUInt8();

                cufProfile.TopPoint    = _worldPacket.ReadUInt8();
                cufProfile.BottomPoint = _worldPacket.ReadUInt8();
                cufProfile.LeftPoint   = _worldPacket.ReadUInt8();

                cufProfile.TopOffset    = _worldPacket.ReadUInt16();
                cufProfile.BottomOffset = _worldPacket.ReadUInt16();
                cufProfile.LeftOffset   = _worldPacket.ReadUInt16();

                cufProfile.ProfileName = _worldPacket.ReadString(strLen);

                CUFProfiles.Add(cufProfile);
            }
        }