當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。