Exemplo n.º 1
0
        internal static void OnC2SAskItemSplit(ByteBuffer buffer, Connection connection)
        {
            var incPacket = new ItemPackets.C2SAskItemSplit(buffer);
            var inv       = ClientManager.GetClient(connection).GetSelectedCharacter().Inventory;

            if (inv.SplitItem(incPacket.posFrom, incPacket.posTo, incPacket.amountLeft, incPacket.amountMove))
            {
                var outPacket = new ItemPackets.S2CAnsItemMove(1, 1, incPacket.posFrom, incPacket.posTo, incPacket.amountMove);
                outPacket.Send(connection);
            }
        }
Exemplo n.º 2
0
        internal static void OnC2sAskItemMove(ByteBuffer buffer, Connection connection)
        {
            var incPacket = new ItemPackets.C2SAskItemMove(buffer);
            var inv       = ClientManager.GetClient(connection).GetSelectedCharacter().Inventory;

            if (inv.MoveItem(incPacket.slotIdFrom, incPacket.slotIdTo, incPacket.positionFrom, incPacket.positionTo, incPacket.amountToMove))
            {
                var outPacket = new ItemPackets.S2CAnsItemMove(incPacket.slotIdFrom, incPacket.slotIdTo, incPacket.positionFrom, incPacket.positionTo, incPacket.amountToMove);
                outPacket.Send(connection);
            }
        }
Exemplo n.º 3
0
        internal static void OnC2SAskItemBind(ByteBuffer buffer, Connection connection)
        {
            var incPacket = new ItemPackets.C2SAskItemBind(buffer);
            var inv       = ClientManager.GetClient(connection).GetSelectedCharacter().Inventory;
            //var sb = new byte[]
            //{
            //    02,00,
            //    33,0
            //};
            //connection.SendUnmanagedBytes(sb);
            var topos = (byte)0;

            inv.MoveItem(1, 2, incPacket.pos, topos, 0);
            var outPacket = new ItemPackets.S2CAnsItemMove(1, 2, incPacket.pos, topos, 0);

            //var outPacket = new ItemPackets.S2CAnsItemBind(incPacket.pos);
            outPacket.Send(connection);
        }