本文整理匯總了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);
}