Пример #1
0
        public static void SendPrivateShopChatNotificationAboutBuyResponse(Asda2PrivateShop shop,
                                                                           List <Asda2ItemTradeRef> itemsBuyed, Character buyer)
        {
            Asda2ItemTradeRef[] asda2ItemTradeRefArray = new Asda2ItemTradeRef[6];
            for (int index = 0; index < itemsBuyed.Count; ++index)
            {
                asda2ItemTradeRefArray[index] = itemsBuyed[index];
            }
            using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.PrivateShopChatNotificationAboutBuy))
            {
                packet.WriteInt32(shop.Owner.AccId);
                packet.WriteInt16(shop.Owner.SessionId);
                packet.WriteByte(
                    asda2ItemTradeRefArray.Count(
                        i => i != null));
                packet.WriteInt32(buyer.AccId);
                for (int index = 0; index < 6; ++index)
                {
                    Asda2Item asda2Item =
                        asda2ItemTradeRefArray[index] == null || asda2ItemTradeRefArray[index].Item == null
              ? null
              : asda2ItemTradeRefArray[index].Item;
                    packet.WriteInt32(asda2Item == null ? 0 : asda2Item.ItemId);
                    packet.WriteByte(0);
                    packet.WriteInt16(-1);
                    packet.WriteInt32(asda2ItemTradeRefArray[index] == null
            ? -1
            : asda2ItemTradeRefArray[index].Amount);
                    packet.WriteInt32(asda2ItemTradeRefArray[index] == null
            ? -1
            : asda2ItemTradeRefArray[index].TradeSlot);
                    packet.WriteInt16(0);
                    packet.WriteSkip(stub18);
                }

                shop.Send(packet);
            }
        }
Пример #2
0
        public static void SendItemBuyedFromPrivateShopToOwnerNotifyResponse(Asda2PrivateShop shop,
                                                                             List <Asda2ItemTradeRef> itemsBuyed, Character buyer)
        {
            Asda2ItemTradeRef[] asda2ItemTradeRefArray = new Asda2ItemTradeRef[6];
            for (int index = 0; index < itemsBuyed.Count; ++index)
            {
                asda2ItemTradeRefArray[index] = itemsBuyed[index];
            }
            using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.ItemBuyedFromPrivateShopToOwnerNotify))
            {
                packet.WriteInt16(shop.Owner.Asda2Inventory.Weight);
                packet.WriteInt32(shop.Owner.Money);
                packet.WriteByte(
                    asda2ItemTradeRefArray.Count(
                        i => i != null));
                packet.WriteInt32(buyer.AccId);
                for (int index = 0; index < 6; ++index)
                {
                    Asda2Item asda2Item =
                        asda2ItemTradeRefArray[index] == null || asda2ItemTradeRefArray[index].Item == null
              ? null
              : asda2ItemTradeRefArray[index].Item;
                    packet.WriteInt32(asda2Item == null ? 0 : asda2Item.ItemId);
                    packet.WriteByte(asda2Item == null ? (byte)0 : (byte)asda2Item.InventoryType);
                    packet.WriteInt16(asda2Item == null ? 0 : asda2Item.Slot);
                    packet.WriteInt32(asda2ItemTradeRefArray[index] == null
            ? -1
            : asda2ItemTradeRefArray[index].Amount);
                    packet.WriteInt32(asda2ItemTradeRefArray[index] == null
            ? -1
            : asda2ItemTradeRefArray[index].TradeSlot);
                    packet.WriteInt16(0);
                    packet.WriteSkip(stub17);
                }

                shop.Owner.Send(packet, false);
            }
        }