public async void SendInventory(CCashInventoryItem message) { var _items = message.InventoryType == CSInventory.Storage ? _storage : _gifItems; var tPage = (ushort)Math.Ceiling(_items.Count / 8.0); var id = (message.Page - 1) * 8; var cicount = (ushort)Math.Max(_items.Count - id, 8); await _player.Session.SendAsync(new SCashInventoryItem { PageIndex = (ushort)message.Page, TotalPage = tPage, CurrentItemCount = cicount, TotalItemCount = (ushort)_items.Count, }); var items = _items.Select(x => new SCashItemDto { InventoryType = message.InventoryType, AuthCode = 1, GiftName = "", Message = "", UniqueCode = 2, UniqueID1 = 3, UniqueID2 = 4, UniqueID3 = 5, }).ToArray(); var msg = new SCashItemList { aIndex = _player.ID, AccountID = _player.Account.Nickname, InvType = message.InventoryType, InvNum = (byte)id, Result = 1, Items = items }; Logger.Debug("Sending list from {0}", message.InventoryType); await _player.Session.SendAsync(msg); }
public void CashInventoryItem(GSSession session, CCashInventoryItem message) { session.Player.Character.CashShop.SendInventory(message); }