本文整理汇总了C#中Solar.FiestaLib.Networking.Packet.TryReadSByte方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.TryReadSByte方法的具体用法?C# Packet.TryReadSByte怎么用?C# Packet.TryReadSByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Solar.FiestaLib.Networking.Packet
的用法示例。
在下文中一共展示了Packet.TryReadSByte方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EnhancementHandler
public static void EnhancementHandler(ZoneClient client, Packet packet)
{
sbyte weapslot, stoneslot;
if (!packet.TryReadSByte(out weapslot) ||
!packet.TryReadSByte(out stoneslot))
{
Log.WriteLine(LogLevel.Warn, "Invalid item enhance request.");
return;
}
client.Character.UpgradeItem(weapslot, stoneslot);
}
示例2: EquipHandler
public static void EquipHandler(ZoneClient client, Packet packet)
{
sbyte slot;
if (!packet.TryReadSByte(out slot))
{
Log.WriteLine(LogLevel.Warn, "Error reading equipping slot.");
return;
}
Item item;
if (client.Character.InventoryItems.TryGetValue(slot, out item))
{
if (item is Equip)
{
if (((Equip)item).Info.Level > client.Character.Level)
{
FailedEquip(client.Character, 645); // 85 02
}
else
{
client.Character.EquipItem((Equip)item);
}
}
else
{
FailedEquip(client.Character);
Log.WriteLine(LogLevel.Warn, "{0} equippped an item. What a moron.", client.Character.Name);
}
}
}
示例3: DropItemHandler
public static void DropItemHandler(ZoneClient client, Packet packet)
{
sbyte slot;
if (!packet.TryReadSByte(out slot))
{
Log.WriteLine(LogLevel.Warn, "Invalid drop request.");
return;
}
client.Character.DropItemRequest(slot);
}
示例4: UseHandler
public static void UseHandler(ZoneClient client, Packet packet)
{
sbyte slot;
if (!packet.TryReadSByte(out slot))
{
Log.WriteLine(LogLevel.Warn, "Error reading used item slot.");
return;
}
client.Character.UseItem(slot);
}
示例5: UnequipHandler
public static void UnequipHandler(ZoneClient client, Packet packet)
{
ZoneCharacter character = client.Character;
byte sourceSlot;
sbyte destinationSlot; //not so sure about this one anymore
if (!packet.TryReadByte(out sourceSlot) ||
!packet.TryReadSByte(out destinationSlot))
{
Log.WriteLine(LogLevel.Warn, "Could not read unequip values from {0}.", character.Name);
return;
}
character.UnequipItem((ItemSlot)sourceSlot, destinationSlot);
}