Ejemplo n.º 1
0
        void c_ClientInventoryLoadInfo(object sender, ClientInventoryLoadEvenArgs e)
        {
            Client c   = (Client)sender;
            int    inv = e.Inventory;


            switch (inv)
            {
            case 0:

                byte[] bufferSendEquips = PacketManager.SendBagItems(c.MyCharacter.GetAllEquips().Cast <BaseItem>().ToList(), inv);
                c.Send(bufferSendEquips);
                break;

            case 1:
                //byte[] bufferSendBag1 = PacketManager.SendTempBag1();
                //c.Send(bufferSendBag1);
                var bagOne = itemDataManager.GetAllItemsInBag(1, c.MyCharacter.CharacterId);
                c.MyCharacter.Bags.Add(new Bag(bagOne));
                if (c.MyCharacter.Bags[0].ItemCount > 0)
                {
                    byte[] bufferSendBag1 = PacketManager.SendBagItems(c.MyCharacter.Bags[0].Items.Cast <BaseItem>().ToList(), inv);
                    c.Send(bufferSendBag1);
                }
                break;

            case 2:
                var bagTwo = itemDataManager.GetAllItemsInBag(2, c.MyCharacter.CharacterId);
                c.MyCharacter.Bags.Add(new Bag(bagTwo));
                if (c.MyCharacter.Bags[1].ItemCount > 0)
                {
                    byte[] bufferSendBag2 = PacketManager.SendBagItems(c.MyCharacter.Bags[1].Items.Cast <BaseItem>().ToList(), inv);
                    c.Send(bufferSendBag2);
                }
                break;

            case 3:
                break;
            }
        }
Ejemplo n.º 2
0
        void c_ClientInventoryLoadInfo(object sender, ClientInventoryLoadEvenArgs e)
        {
            Client c = (Client)sender;
            int inv = e.Inventory;

            switch (inv)
            {
                case 0:

                    byte[] bufferSendEquips = PacketManager.SendBagItems(c.MyCharacter.GetAllEquips().Cast<BaseItem>().ToList(), inv);
                    c.Send(bufferSendEquips);
                    break;

                case 1:
                    //byte[] bufferSendBag1 = PacketManager.SendTempBag1();
                    //c.Send(bufferSendBag1);
                    var bagOne = itemDataManager.GetAllItemsInBag(1, c.MyCharacter.CharacterId);
                    c.MyCharacter.Bags.Add(new Bag(bagOne));
                    if (c.MyCharacter.Bags[0].ItemCount > 0)
                    {
                        byte[] bufferSendBag1 = PacketManager.SendBagItems(c.MyCharacter.Bags[0].Items.Cast<BaseItem>().ToList(), inv);
                        c.Send(bufferSendBag1);
                    }
                    break;

                case 2:
                    var bagTwo = itemDataManager.GetAllItemsInBag(2, c.MyCharacter.CharacterId);
                    c.MyCharacter.Bags.Add(new Bag(bagTwo));
                    if (c.MyCharacter.Bags[1].ItemCount > 0)
                    {
                        byte[] bufferSendBag2 = PacketManager.SendBagItems(c.MyCharacter.Bags[1].Items.Cast<BaseItem>().ToList(), inv);
                        c.Send(bufferSendBag2);
                    }
                    break;

                case 3:
                    break;
            }
        }