コード例 #1
0
 internal static void SendItemPacket(Client client, InventoryItem invItem, int slotId, ItemPacketType packetType)
 {
     invItem.SlotID = slotId;
     _log.DebugFormat("Sending item packet for {0}", invItem);
     //_log.DebugFormat("Serialized inv item: {0}", invItem.Serialize());
     ItemPacket item = new ItemPacket(packetType, invItem.Serialize());
     AppOpCode opCode = packetType == ItemPacketType.ViewLink ? AppOpCode.ItemLinkResponse : AppOpCode.ItemPacket;
     //_log.DebugFormat("Serialized Item packet: {0}", BitConverter.ToString(item.Serialize()));
     EQRawApplicationPacket itemPack = new EQRawApplicationPacket(opCode, client.IPEndPoint, item.Serialize());
     client.SendApplicationPacket(itemPack);
 }
コード例 #2
0
ファイル: ItemHelper.cs プロジェクト: Vinna/aura-old
        public static Packet AddItemInfo(this Packet packet, Item item, ItemPacketType type)
        {
            packet.PutLong(item.EntityId);
            packet.PutByte((byte)type);
            packet.PutBin(item.Info);

            if (type == ItemPacketType.Public)
            {
                packet.PutByte(1);
                packet.PutByte(0);

                //packet.PutByte(0); // Bitmask
                // if & 1
                //     float
                packet.PutByte(1);
                packet.PutFloat(1);                   // Size multiplicator *hint: Server side giant key mod*

                packet.PutByte(item.FirstTimeAppear); // 0: No bouncing, 1: Bouncing, 2: Delayed bouncing
            }
            else if (type == ItemPacketType.Private)
            {
                packet.PutBin(item.OptionInfo);

                // Ego data
                if (item.Data.HasTag("/ego_weapon/"))
                {
                    packet.PutString(item.EgoInfo.Name);
                    packet.PutByte((byte)item.EgoInfo.Race);
                    packet.PutByte(0);                     // ? increased from 14 to 18 when I fed a bottle to a sword

                    packet.PutByte(item.EgoInfo.SocialLevel);
                    packet.PutInt(item.EgoInfo.SocialExp);
                    packet.PutByte(item.EgoInfo.StrLevel);
                    packet.PutInt(item.EgoInfo.StrExp);
                    packet.PutByte(item.EgoInfo.IntLevel);
                    packet.PutInt(item.EgoInfo.IntExp);
                    packet.PutByte(item.EgoInfo.DexLevel);
                    packet.PutInt(item.EgoInfo.DexExp);
                    packet.PutByte(item.EgoInfo.WillLevel);
                    packet.PutInt(item.EgoInfo.WillExp);
                    packet.PutByte(item.EgoInfo.LuckLevel);
                    packet.PutInt(item.EgoInfo.LuckExp);
                    packet.PutByte(item.EgoInfo.AwakeningEnergy);
                    packet.PutInt(item.EgoInfo.AwakeningExp);

                    packet.PutLong(0);
                    packet.PutLong(item.EgoInfo.LastFeeding);                     // Last feeding time?
                    packet.PutInt(0);
                }

                packet.PutString(item.MetaData1.ToString());
                packet.PutString(item.MetaData2.ToString());

                // Upgrades?
                packet.PutByte(0);                 // Count
                // for upgrades
                //     Bin    : 01 00 00 00 68 21 11 00 00 00 00 00 05 00 1E 00 00 00 00 00 0A 00 00 00 D3 E4 90 65 0A 00 00 00 F0 18 9E 65

                // Special upgrades? (example)
                //0608 [0000000000000000] Long   : 0
                //0609 [........00000002] Int    : 2
                //0610 [........00000024] Int    : 36
                //0611 [........00000008] Int    : 8
                //0612 [........00000026] Int    : 38
                //0613 [........00000004] Int    : 4

                packet.PutLong(item.QuestId);

                // [190100, NA200 (2015-01-15)] ?
                {
                    packet.PutByte(item.IsNew);
                    packet.PutByte(0);
                }
            }

            return(packet);
        }
コード例 #3
0
ファイル: ItemHelper.cs プロジェクト: xKamuna/aura-1
        public static Packet AddItemInfo(this Packet packet, Item item, ItemPacketType type)
        {
            var isEgoWeapon = item.HasTag("/ego_weapon/");
            var isGuildRobe = item.HasTag("/guild_robe/");

            packet.PutLong(item.EntityId);
            packet.PutByte((byte)type);
            packet.PutBin(item.Info);

            if (isGuildRobe)
            {
                // EBCL1:4:-16351525;EBCL2:4:-875718;EBLM1:1:46;EBLM2:1:11;EBLM3:1:4; (GLDNAM:s:European;)
                packet.PutString(item.MetaData1.ToString());
            }

            if (type == ItemPacketType.Public)
            {
                packet.PutByte(1);

                // Affects color of dropped item's name (blue or green),
                // indicating its value.
                packet.PutByte((byte)item.UpgradeEffectCount);

                //packet.PutByte(0); // Bitmask
                // if & 1
                //     float
                packet.PutByte(1);
                packet.PutFloat(1);                   // Size multiplicator *hint: Server side giant key mod*

                packet.PutByte(item.FirstTimeAppear); // 0: No bouncing, 1: Bouncing, 2: Delayed bouncing
            }
            else if (type == ItemPacketType.Private)
            {
                packet.PutBin(item.OptionInfo);

                // Ego data
                if (isEgoWeapon)
                {
                    packet.PutString(item.EgoInfo.Name);
                    packet.PutByte((byte)item.EgoInfo.Race);
                    packet.PutByte(0);                     // ? increased from 14 to 18 when I fed a bottle to a sword

                    packet.PutByte(item.EgoInfo.SocialLevel);
                    packet.PutInt(item.EgoInfo.SocialExp);
                    packet.PutByte(item.EgoInfo.StrLevel);
                    packet.PutInt(item.EgoInfo.StrExp);
                    packet.PutByte(item.EgoInfo.IntLevel);
                    packet.PutInt(item.EgoInfo.IntExp);
                    packet.PutByte(item.EgoInfo.DexLevel);
                    packet.PutInt(item.EgoInfo.DexExp);
                    packet.PutByte(item.EgoInfo.WillLevel);
                    packet.PutInt(item.EgoInfo.WillExp);
                    packet.PutByte(item.EgoInfo.LuckLevel);
                    packet.PutInt(item.EgoInfo.LuckExp);
                    packet.PutByte(item.EgoInfo.AwakeningEnergy);
                    packet.PutInt(item.EgoInfo.AwakeningExp);

                    packet.PutLong(0);
                    packet.PutLong(item.EgoInfo.LastFeeding);                     // Last feeding time?
                    packet.PutInt(0);
                }

                packet.PutString(item.MetaData1.ToString());
                packet.PutString(item.MetaData2.ToString());

                // Upgrades
                var upgradeEffects = item.GetUpgradeEffects();
                packet.PutByte((byte)upgradeEffects.Length);
                foreach (var upgradeEffect in upgradeEffects)
                {
                    packet.PutBin(upgradeEffect);
                }

                // Special upgrades? (example)
                //0608 [0000000000000000] Long   : 0
                //0609 [........00000002] Int    : 2
                //0610 [........00000024] Int    : 36
                //0611 [........00000008] Int    : 8
                //0612 [........00000026] Int    : 38
                //0613 [........00000004] Int    : 4

                packet.PutLong(item.QuestId);

                if (isGuildRobe)
                {
                    packet.PutString(item.MetaData1.GetString("GLDNAM"));
                }

                // In NA235 (Sep. 2016) we found an additional integer for
                // Scythe that Reaps Darkness here, with no known purpose.
                // In NA236 we had to remove said int again.
                // It will be missed.
                //if (item.Info.Id == 41237)
                //	packet.PutInt(0);

                // [190100, NA200 (2015-01-15)] ?
                {
                    packet.PutByte(item.IsNew);
                    packet.PutByte(0);
                }
            }

            return(packet);
        }
コード例 #4
0
ファイル: Send.Entity.cs プロジェクト: nvrlcky/aura
        private static void AddItemInfo(this MabiPacket packet, MabiItem item, ItemPacketType type)
        {
            packet.PutLong(item.Id);
            packet.PutByte((byte)type);
            packet.PutBin(item.Info);

            if (type == ItemPacketType.Public)
            {
                packet.PutByte(1);
                packet.PutByte(0);

                //packet.PutByte(0); // Bitmask
                // if & 1
                //     float
                packet.PutByte(1);
                packet.PutFloat(1); // Size multiplicator *hint: Server side giant key mod*

                packet.PutByte(item.FirstTimeAppear); // 0: No bouncing, 1: Bouncing, 2: Delayed bouncing
            }
            else if (type == ItemPacketType.Private)
            {
                packet.PutBin(item.OptionInfo);
                packet.PutString(item.Tags.ToString());
                packet.PutString("");
                packet.PutByte(0); // upgrade count?
                // for upgrades
                //     Bin    : 01 00 00 00 68 21 11 00 00 00 00 00 05 00 1E 00 00 00 00 00 0A 00 00 00 D3 E4 90 65 0A 00 00 00 F0 18 9E 65
                packet.PutLong(item.QuestId);
            }
        }
コード例 #5
0
ファイル: ItemHelper.cs プロジェクト: xKamuna/aura
		public static Packet AddItemInfo(this Packet packet, Item item, ItemPacketType type)
		{
			packet.PutLong(item.EntityId);
			packet.PutByte((byte)type);
			packet.PutBin(item.Info);

			if (type == ItemPacketType.Public)
			{
				packet.PutByte(1);
				packet.PutByte(0);

				//packet.PutByte(0); // Bitmask
				// if & 1
				//     float
				packet.PutByte(1);
				packet.PutFloat(1); // Size multiplicator *hint: Server side giant key mod*

				packet.PutByte(item.FirstTimeAppear); // 0: No bouncing, 1: Bouncing, 2: Delayed bouncing
			}
			else if (type == ItemPacketType.Private)
			{
				packet.PutBin(item.OptionInfo);

				// Ego data
				if (item.Data.HasTag("/ego_weapon/"))
				{
					packet.PutString(item.EgoInfo.Name);
					packet.PutByte((byte)item.EgoInfo.Race);
					packet.PutByte(0); // ? increased from 14 to 18 when I fed a bottle to a sword

					packet.PutByte(item.EgoInfo.SocialLevel);
					packet.PutInt(item.EgoInfo.SocialExp);
					packet.PutByte(item.EgoInfo.StrLevel);
					packet.PutInt(item.EgoInfo.StrExp);
					packet.PutByte(item.EgoInfo.IntLevel);
					packet.PutInt(item.EgoInfo.IntExp);
					packet.PutByte(item.EgoInfo.DexLevel);
					packet.PutInt(item.EgoInfo.DexExp);
					packet.PutByte(item.EgoInfo.WillLevel);
					packet.PutInt(item.EgoInfo.WillExp);
					packet.PutByte(item.EgoInfo.LuckLevel);
					packet.PutInt(item.EgoInfo.LuckExp);
					packet.PutByte(item.EgoInfo.AwakeningEnergy);
					packet.PutInt(item.EgoInfo.AwakeningExp);

					packet.PutLong(0);
					packet.PutLong(item.EgoInfo.LastFeeding); // Last feeding time?
					packet.PutInt(0);
				}

				packet.PutString(item.MetaData1.ToString());
				packet.PutString(item.MetaData2.ToString());

				// Upgrades?
				packet.PutByte(0); // Count
				// for upgrades
				//     Bin    : 01 00 00 00 68 21 11 00 00 00 00 00 05 00 1E 00 00 00 00 00 0A 00 00 00 D3 E4 90 65 0A 00 00 00 F0 18 9E 65

				// Special upgrades? (example)
				//0608 [0000000000000000] Long   : 0
				//0609 [........00000002] Int    : 2
				//0610 [........00000024] Int    : 36
				//0611 [........00000008] Int    : 8
				//0612 [........00000026] Int    : 38
				//0613 [........00000004] Int    : 4

				packet.PutLong(item.QuestId);

				// [190100, NA200 (2015-01-15)] ?
				{
					packet.PutByte(item.IsNew);
					packet.PutByte(0);
				}
			}

			return packet;
		}
コード例 #6
0
        private string _serItem; // The message itself

        #endregion Fields

        #region Constructors

        internal ItemPacket(ItemPacketType packetType, string serializedItem)
        {
            _itemPacketType = (uint)packetType;
            _serItem = serializedItem;
        }
コード例 #7
0
 internal static void SendItemPacket(Client client, InventoryItem invItem, ItemPacketType packetType)
 {
     SendItemPacket(client, invItem, invItem.SlotID, packetType);
 }
コード例 #8
0
ファイル: Send.Adds.cs プロジェクト: pie3467/aura
        private static Packet AddItemInfo(this Packet packet, Item item, ItemPacketType type)
        {
            packet.PutLong(item.EntityId);
            packet.PutByte((byte)type);
            packet.PutBin(item.Info);

            if (type == ItemPacketType.Public)
            {
                packet.PutByte(1);
                packet.PutByte(0);

                //packet.PutByte(0); // Bitmask
                // if & 1
                //     float
                packet.PutByte(1);
                packet.PutFloat(1); // Size multiplicator *hint: Server side giant key mod*

                packet.PutByte(item.FirstTimeAppear); // 0: No bouncing, 1: Bouncing, 2: Delayed bouncing
            }
            else if (type == ItemPacketType.Private)
            {
                packet.PutBin(item.OptionInfo);
                packet.PutString(item.MetaData1.ToString());
                packet.PutString(item.MetaData2.ToString());

                // Egos (example)
                //0969 [................] String : Navi
                //0970 [..............02] Byte   : 2
                //0971 [..............0E] Byte   : 14
                //0972 [..............0E] Byte   : 14
                //0973 [........00000F50] Int    : 3920
                //0974 [..............11] Byte   : 17
                //0975 [........000013B6] Int    : 5046
                //0976 [..............05] Byte   : 5
                //0977 [........00000092] Int    : 146
                //0978 [..............04] Byte   : 4
                //0979 [........000000C9] Int    : 201
                //0980 [..............03] Byte   : 3
                //0981 [........0000007E] Int    : 126
                //0982 [..............03] Byte   : 3
                //0983 [........000000B5] Int    : 181
                //0984 [..............00] Byte   : 0
                //0985 [........00000000] Int    : 0
                //0986 [0000000000000000] Long   : 0
                //0987 [000039C6DF641228] Long   : 63526314185256 (26.01.2014 06:23:05)
                //0988 [........00000000] Int    : 0

                // Upgrades?
                packet.PutByte(0); // Count
                // for upgrades
                //     Bin    : 01 00 00 00 68 21 11 00 00 00 00 00 05 00 1E 00 00 00 00 00 0A 00 00 00 D3 E4 90 65 0A 00 00 00 F0 18 9E 65

                // Special upgrades? (example)
                //0608 [0000000000000000] Long   : 0
                //0609 [........00000002] Int    : 2
                //0610 [........00000024] Int    : 36
                //0611 [........00000008] Int    : 8
                //0612 [........00000026] Int    : 38
                //0613 [........00000004] Int    : 4

                packet.PutLong(item.QuestId);
            }

            return packet;
        }
コード例 #9
0
ファイル: ItemHelper.cs プロジェクト: aura-project/aura
		public static Packet AddItemInfo(this Packet packet, Item item, ItemPacketType type)
		{
			var isEgoWeapon = item.HasTag("/ego_weapon/");
			var isGuildRobe = item.HasTag("/guild_robe/");

			packet.PutLong(item.EntityId);
			packet.PutByte((byte)type);
			packet.PutBin(item.Info);

			if (isGuildRobe)
				// EBCL1:4:-16351525;EBCL2:4:-875718;EBLM1:1:46;EBLM2:1:11;EBLM3:1:4; (GLDNAM:s:European;)
				packet.PutString(item.MetaData1.ToString());

			if (type == ItemPacketType.Public)
			{
				packet.PutByte(1);

				// Affects color of dropped item's name (blue or green),
				// indicating its value.
				packet.PutByte((byte)item.UpgradeEffectCount);

				//packet.PutByte(0); // Bitmask
				// if & 1
				//     float
				packet.PutByte(1);
				packet.PutFloat(1); // Size multiplicator *hint: Server side giant key mod*

				packet.PutByte(item.FirstTimeAppear); // 0: No bouncing, 1: Bouncing, 2: Delayed bouncing
			}
			else if (type == ItemPacketType.Private)
			{
				packet.PutBin(item.OptionInfo);

				// Ego data
				if (isEgoWeapon)
				{
					packet.PutString(item.EgoInfo.Name);
					packet.PutByte((byte)item.EgoInfo.Race);
					packet.PutByte(0); // ? increased from 14 to 18 when I fed a bottle to a sword

					packet.PutByte(item.EgoInfo.SocialLevel);
					packet.PutInt(item.EgoInfo.SocialExp);
					packet.PutByte(item.EgoInfo.StrLevel);
					packet.PutInt(item.EgoInfo.StrExp);
					packet.PutByte(item.EgoInfo.IntLevel);
					packet.PutInt(item.EgoInfo.IntExp);
					packet.PutByte(item.EgoInfo.DexLevel);
					packet.PutInt(item.EgoInfo.DexExp);
					packet.PutByte(item.EgoInfo.WillLevel);
					packet.PutInt(item.EgoInfo.WillExp);
					packet.PutByte(item.EgoInfo.LuckLevel);
					packet.PutInt(item.EgoInfo.LuckExp);
					packet.PutByte(item.EgoInfo.AwakeningEnergy);
					packet.PutInt(item.EgoInfo.AwakeningExp);

					packet.PutLong(0);
					packet.PutLong(item.EgoInfo.LastFeeding); // Last feeding time?
					packet.PutInt(0);
				}

				packet.PutString(item.MetaData1.ToString());
				packet.PutString(item.MetaData2.ToString());

				// Upgrades
				var upgradeEffects = item.GetUpgradeEffects();
				packet.PutByte((byte)upgradeEffects.Length);
				foreach (var upgradeEffect in upgradeEffects)
					packet.PutBin(upgradeEffect);

				// Special upgrades? (example)
				//0608 [0000000000000000] Long   : 0
				//0609 [........00000002] Int    : 2
				//0610 [........00000024] Int    : 36
				//0611 [........00000008] Int    : 8
				//0612 [........00000026] Int    : 38
				//0613 [........00000004] Int    : 4

				packet.PutLong(item.QuestId);

				if (isGuildRobe)
					packet.PutString(item.MetaData1.GetString("GLDNAM"));

				// In NA235 (Sep. 2016) we found an additional integer for
				// Scythe that Reaps Darkness here, with no known purpose.
				// In NA236 we had to remove said int again.
				// It will be missed.
				//if (item.Info.Id == 41237)
				//	packet.PutInt(0);

				// [190100, NA200 (2015-01-15)] ?
				{
					packet.PutByte(item.IsNew);
					packet.PutByte(0);
				}
			}

			return packet;
		}