Пример #1
0
        private void OnMoveItem(Packet packet)
        {
            var bagId            = packet.ReadByte();
            var sourceIndex      = packet.ReadByte();
            var destinationIndex = packet.ReadByte();

            //TODO: Implement other bags.

            if (bagId != 0)
            {
                throw new NotImplementedException();
            }

            InventoryItems.Move(sourceIndex, destinationIndex);

            var snapshot = new Snapshot();

            snapshot.SetType(SnapshotType.MOVEITEM);
            snapshot.WriteInt32(Character.GetHashCode());             //Object Id
            snapshot.WriteByte(bagId);
            snapshot.WriteByte(sourceIndex);
            snapshot.WriteByte(destinationIndex);

            Send(snapshot);

            SendNearPlayers(snapshot);

            //TODO: Send item update to other players in range.
        }