void RecvSwapInventorySlots(IIPSocket conn, BitStream r)
        {
            var a = r.ReadInventorySlot();
            var b = r.ReadInventorySlot();

            var user = TryGetUser(conn);
            if (user == null)
                return;

            user.Inventory.SwapSlots(a, b);
        }
        void RecvUseInventoryItem(IIPSocket conn, BitStream r)
        {
            var slot = r.ReadInventorySlot();

            User user;
            if ((user = TryGetUser(conn)) == null)
                return;

            user.UseInventoryItem(slot);
        }
        void RecvSellInventoryToShop(IIPSocket conn, BitStream r)
        {
            var slot = r.ReadInventorySlot();
            var amount = r.ReadByte();

            User user;
            if ((user = TryGetUser(conn)) == null)
                return;

            user.ShoppingState.TrySellInventory(slot, amount);
        }
        void RecvGetInventoryItemInfo(IIPSocket conn, BitStream r)
        {
            var slot = r.ReadInventorySlot();

            User user;
            if ((user = TryGetUser(conn)) != null)
                user.SendInventoryItemStats(slot);
        }
        void RecvDropInventoryItem(IIPSocket conn, BitStream r)
        {
            var slot = r.ReadInventorySlot();
            var amount = r.ReadByte();

            User user;
            if ((user = TryGetUser(conn)) == null)
                return;

            if (user.IsPeerTrading)
                return;

            if (amount < 1)
                return;

            user.Inventory.Drop(slot, amount);
        }
        void RecvSetInventorySlot(IIPSocket conn, BitStream r)
        {
            var slot = r.ReadInventorySlot();
            var hasGraphic = r.ReadBool();
            var graphic = hasGraphic ? r.ReadGrhIndex() : GrhIndex.Invalid;
            var amount = r.ReadByte();

            UserInfo.Inventory.Update(slot, graphic, amount, GetTime());
        }
 void RecvSendInventoryItemInfo(IIPSocket conn, BitStream r)
 {
     var slot = r.ReadInventorySlot();
     GameplayScreen.InventoryInfoRequester.ReceiveInfo(slot, r);
 }