Ejemplo n.º 1
0
        void Handle(Player player, int objId)
        {
            if (player.Owner == null)
            {
                return;
            }

            SellableObject obj = player.Owner.GetEntity(objId) as SellableObject;

            if (obj != null)
            {
                obj.Buy(player);
            }
        }
Ejemplo n.º 2
0
 protected override void HandlePacket(Client client, BuyPacket packet)
 {
     client.Manager.Logic.AddPendingAction(t =>
     {
         if (client.Player.Owner == null)
         {
             return;
         }
         SellableObject obj = client.Player.Owner.GetEntity(packet.ObjectId) as SellableObject;
         if (obj != null)
         {
             obj.Buy(client.Player);
         }
     }, PendingPriority.Networking);
 }