public InventorySwapPacket(int time, TilePoint position, SlotObject slot_object1, SlotObject slot_object2)
 {
     this.Time = time;
     this.Position = position;
     this.SlotObject1 = slot_object1;
     this.SlotObject2 = slot_object2;
 }
示例#2
0
        public void MoveTo(int slot, Client client, bool ground = false, bool bag = false)
        {
            SlotObject slot1 = new SlotObject();
            SlotObject slot2 = new SlotObject();

            slot1.ObjectId   = client.ObjectId;
            slot1.ObjectType = ObjectType;
            slot1.SlotId     = (byte)Slot;
            if (!ground && !bag)
            {
                slot2.ObjectId   = client.ObjectId;
                slot2.ObjectType = slot < 12 ? client.PlayerData.Slot[slot] : client.PlayerData.BackPack[slot - 11];
                slot2.SlotId     = (byte)slot;
            }
            else if (!ground && bag)
            {
                slot2.ObjectId   = client.ObjectId;
                slot2.ObjectType = -1;
                slot2.SlotId     = 1;
            }
            else
            {
                InvDropPacket dropPacket = (InvDropPacket)Packet.Create(PacketType.INVDROP);
                dropPacket.Slot = slot1;
                client.SendToServer(dropPacket);
                return;
            }

            InvSwapPacket swapPacket = (InvSwapPacket)Packet.Create(PacketType.INVSWAP);

            swapPacket.Position    = client.PlayerData.Pos;
            swapPacket.SlotObject1 = slot1;
            swapPacket.SlotObject2 = slot2;
            swapPacket.Time        = client.Time;
            client.SendToServer(swapPacket);
        }
示例#3
0
 protected override void Write(DWriter wtr)
 {
     SlotObject.Write(wtr);
 }
示例#4
0
 protected override void Read(DReader rdr)
 {
     SlotObject = SlotObject.Read(rdr);
 }
示例#5
0
 public override void Read(PacketReader r)
 {
     PetId      = r.ReadInt32();
     NewPetType = r.ReadInt32();
     Item       = (SlotObject) new SlotObject().Read(r);
 }
示例#6
0
 public override void Read(PacketReader r)
 {
     Slot = (SlotObject) new SlotObject().Read(r);
 }
示例#7
0
 public override void Read(PacketReader r)
 {
     petInstanceId    = r.ReadInt32();
     pickedNewPetType = r.ReadInt32();
     item             = (SlotObject) new SlotObject().Read(r);
 }
示例#8
0
 public InventorySwapPacket(int time, TilePoint position, SlotObject slot_object1, SlotObject slot_object2)
 {
     this.Time        = time;
     this.Position    = position;
     this.SlotObject1 = slot_object1;
     this.SlotObject2 = slot_object2;
 }
 protected override void Write(Client psr, NWriter wtr)
 {
     SlotObject.Write(psr, wtr);
 }
示例#10
0
 public void placeCard(SlotObject slot)
 {
     curSlot            = slot;
     transform.position = curSlot.transform.position;
     showAvailbleSlot();
 }
示例#11
0
    // Update is called once per frame
    void Update()
    {
        if (Input.anyKeyDown)
        {
            SlotObject obj = null;

            if (Input.GetKeyDown(KeyCode.Q))
            {
                obj = HotKeySlotQ.GetComponentInChildren <SlotObject>();
            }
            else if (Input.GetKeyDown(KeyCode.W))
            {
                obj = HotKeySlotW.GetComponentInChildren <SlotObject>();
            }
            else if (Input.GetKeyDown(KeyCode.E))
            {
                obj = HotKeySlotE.GetComponentInChildren <SlotObject>();
            }
            else if (Input.GetKeyDown(KeyCode.A))
            {
                obj = HotKeySlotA.GetComponentInChildren <SlotObject>();
            }
            else if (Input.GetKeyDown(KeyCode.S))
            {
                obj = HotKeySlotS.GetComponentInChildren <SlotObject>();
            }
            else if (Input.GetKeyDown(KeyCode.D))
            {
                obj = HotKeySlotD.GetComponentInChildren <SlotObject>();
            }
            else if (Input.GetKeyDown(KeyCode.Insert))
            {
                obj = HotKeySlotInsert.GetComponentInChildren <SlotObject>();
            }
            else if (Input.GetKeyDown(KeyCode.Home))
            {
                obj = HotKeySlotHome.GetComponentInChildren <SlotObject>();
            }
            else if (Input.GetKeyDown(KeyCode.PageUp))
            {
                obj = HotKeySlotPageUp.GetComponentInChildren <SlotObject>();
            }
            else if (Input.GetKeyDown(KeyCode.Delete))
            {
                obj = HotKeySlotDelete.GetComponentInChildren <SlotObject>();
            }
            else if (Input.GetKeyDown(KeyCode.End))
            {
                obj = HotKeySlotEnd.GetComponentInChildren <SlotObject>();
            }
            else if (Input.GetKeyDown(KeyCode.PageDown))
            {
                obj = HotKeySlotPageDown.GetComponentInChildren <SlotObject>();
            }

            if (obj == null)
            {
                return;
            }
            obj.UseSlotObject();
        }
    }
示例#12
0
 public void SendInventorySwap(int time, TilePoint position, SlotObject slot_object1, SlotObject slot_object2)
 {
     this.SendPacket(new InventorySwapPacket(time, position, slot_object1, slot_object2));
 }