Zepheus.FiestaLib.Networking.Packet.TryReadShort C# (CSharp) Method

TryReadShort() public method

public TryReadShort ( short &pValue ) : bool
pValue short
return bool
        public bool TryReadShort(out short pValue)
        {
            pValue = 0;
            if (Remaining < 2) return false;
            pValue = this.reader.ReadInt16();
            return true;
        }

Usage Example

Ejemplo n.º 1
0
 public static void BySPStoneHandler(ZoneClient client, Packet packet)
 {
     short Amount;
     if (packet.TryReadShort(out Amount))
     {
         client.Character.ChangeMoney(client.Character.Character.Money -= client.Character.BaseStats.PriceSPStone);
         short Am = Amount += client.Character.StonesSP;
         client.Character.StonesHP = Am;
         using (var p = new Packet(SH20Type.ChangeSPStones))
         {
             p.WriteShort(Am);
             client.SendPacket(p);
         }
     }
 }
All Usage Examples Of Zepheus.FiestaLib.Networking.Packet::TryReadShort