コード例 #1
0
        /// <summary>
        /// Sends information about newly created character.
        /// </summary>
        /// <param name="conn"></param>
        /// <param name="character"></param>
        public static void BC_COMMANDER_CREATE(LoginConnection conn, Character character)
        {
            var packet = new Packet(Op.BC_COMMANDER_CREATE);

            packet.AddAppearanceBarrackPc(character);

            conn.Send(packet);
        }
コード例 #2
0
        public static void AddBarrackPc(this Packet packet, IBarrackPc pc)
        {
            var equipProperties = pc.GetEquipmentProperties();

            if (equipProperties.Length != Items.EquipSlotCount)
            {
                throw new InvalidOperationException("Expected " + Items.EquipSlotCount + " items for property list.");
            }

            var jobIds = pc.GetJobIds();

            packet.AddAppearanceBarrackPc(pc);

            // Equip properties
            foreach (var propertiesObj in equipProperties)
            {
                var properties     = propertiesObj.GetAll();
                var propertiesSize = properties.Sum(a => a.Size);

                packet.PutShort(propertiesSize);
                packet.AddProperties(properties);
            }

            // [i170175] maybe hat visibility?
            packet.PutByte(1);
            packet.PutByte(1);
            packet.PutByte(1);

            packet.PutByte(1);

            // Job list?
            // Example: A Mage that switched to Pyromancer has two
            //   elements in this list, 2001 and 2002.
            packet.PutShort(jobIds.Length);
            foreach (var jobId in jobIds)
            {
                packet.PutShort((short)jobId);
            }

            packet.PutInt(0);
        }
コード例 #3
0
        public static void AddBarrackPc(this Packet packet, IBarrackPc pc)
        {
            var equipProperties = pc.GetEquipmentProperties();

            if (equipProperties.Length != Items.EquipSlotCount)
            {
                throw new InvalidOperationException("Expected " + Items.EquipSlotCount + " items for property list.");
            }

            var jobIds = pc.GetJobIds();

            packet.AddAppearanceBarrackPc(pc);

            // Equip properties
            var i = 0;

            foreach (var propertiesObj in equipProperties)
            {
                var properties = propertiesObj.GetAll();

                if (i == -1)
                {
                    packet.PutShort(16);
                    packet.PutBinFromHex("621C000000000000D61C00000000803F");
                    packet.PutLong(pc.Id + (i + 1));
                    packet.PutShort(0);
                }
                else
                {
                    var propertiesSize = properties.Sum(a => a.Size);

                    packet.PutShort(propertiesSize);
                    if (propertiesSize > 0)
                    {
                        packet.AddProperties(properties);
                        packet.PutLong(pc.Id + (i + 1));
                        packet.PutShort(0);
                    }
                }

                i++;
            }

            packet.PutShort(0);

            // [i170175] maybe hat visibility?
            packet.PutByte(1);
            packet.PutByte(1);
            packet.PutByte(1);
            packet.PutByte(1);

            // Job list?
            // Example: A Mage that switched to Pyromancer has two
            //   elements in this list, 2001 and 2002.
            packet.PutShort(jobIds.Length);
            foreach (var jobId in jobIds)
            {
                packet.PutShort((short)jobId);
            }

            packet.PutInt(0);
            packet.PutInt((int)pc.JobId);

            packet.PutLong(pc.Id);
            packet.PutShort(0);             // Additional properties count?

            //packet.PutShort(2); // Instance dungeon count
            //packet.PutLpString("Indun_ResetTime");
            //packet.PutLpString("21080800.000000");
            //packet.PutLpString("IndunWeeklyResetTime");
            //packet.PutLpString("21080906.000000");

            //packet.PutInt(0);
        }