当前位置: 首页>>代码示例>>C#>>正文


C# Packet.TryReadSByte方法代码示例

本文整理汇总了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);
 }
开发者ID:iFeddy,项目名称:SolarFiesta,代码行数:11,代码来源:Handler12.cs

示例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);
         }
     }
 }
开发者ID:iFeddy,项目名称:SolarFiesta,代码行数:29,代码来源:Handler12.cs

示例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);
 }
开发者ID:iFeddy,项目名称:SolarFiesta,代码行数:10,代码来源:Handler12.cs

示例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);
 }
开发者ID:iFeddy,项目名称:SolarFiesta,代码行数:10,代码来源:Handler12.cs

示例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);
        }
开发者ID:iFeddy,项目名称:SolarFiesta,代码行数:14,代码来源:Handler12.cs


注:本文中的Solar.FiestaLib.Networking.Packet.TryReadSByte方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。