本文整理汇总了C#中MabiPacket.AddItemInfo方法的典型用法代码示例。如果您正苦于以下问题:C# MabiPacket.AddItemInfo方法的具体用法?C# MabiPacket.AddItemInfo怎么用?C# MabiPacket.AddItemInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MabiPacket
的用法示例。
在下文中一共展示了MabiPacket.AddItemInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ItemUpdate
public static void ItemUpdate(Client client, MabiCreature creature, MabiItem item)
{
var packet = new MabiPacket(Op.ItemUpdate, creature.Id);
packet.AddItemInfo(item, ItemPacketType.Private);
client.Send(packet);
}
示例2: OpenNPCShop
public static void OpenNPCShop(WorldClient client, MabiShop shop)
{
var packet = new MabiPacket(Op.OpenNPCShop, client.Character.Id);
packet.PutString("shopname");
packet.PutByte(0);
packet.PutByte(0);
packet.PutInt(0);
packet.PutByte((byte)shop.Tabs.Count);
for (var i = 0; i < shop.Tabs.Count; ++i)
{
packet.PutString("[{0}]{1}", i, shop.Tabs[i].Name);
// [160200] ?
{
packet.PutByte(0);
}
packet.PutShort((ushort)shop.Tabs[i].Items.Count);
foreach (var item in shop.Tabs[i].Items)
packet.AddItemInfo(item, ItemPacketType.Private);
}
client.Send(packet);
}
示例3: ViewEquipmentResponse
/// <summary>
/// Sends view equipment to client. Response is negative if items is null.
/// </summary>
/// <param name="client"></param>
/// <param name="targetId"></param>
/// <param name="items"></param>
public static void ViewEquipmentResponse(WorldClient client, ulong targetId, IEnumerable<MabiItem> items)
{
var packet = new MabiPacket(Op.ViewEquipmentR, client.Character.Id);
if (items != null)
{
packet.PutByte(true);
packet.PutLong(targetId);
packet.PutInt((ushort)items.Count());
foreach (var item in items)
packet.AddItemInfo(item, ItemPacketType.Private);
}
else
{
packet.PutByte(false);
}
client.Send(packet);
}