Exemplo n.º 1
0
        public void HandleBuy(WorldClient client, MyShopBuyPacket packet)
        {
            var ok = _shopManager.TryBuyItem(packet.Slot, packet.Count, out var soldItem, out var shopItem);

            if (ok)
            {
                _packetFactory.SendMyShopBuyItemSuccess(client, _inventoryManager.Gold, packet.Slot, shopItem.Count, soldItem);
            }
            else
            {
                _packetFactory.SendMyShopBuyItemFailed(client);
            }
        }