示例#1
0
		public void Handle(Session session, ClientPacket message)
		{
			Room room = session.Player.CurrentRoom;
			if (room == null)
			{
				return;
			}

			int itemId = message.PopInt();
			int state = message.PopInt();

			RoomItem item = room.ItemManager.GetItem(itemId);
			if (item == null && item.ItemData.Type == "s")
			{
				return;
			}

			if (item.ItemData.Interaction == ItemInteraction.EXCHANGE ||
				item.ItemData.Interaction == ItemInteraction.DIAMOND_EXCHANGE ||
				item.ItemData.Interaction == ItemInteraction.POINTS_EXCHANGE ||
				item.ItemData.Interaction == ItemInteraction.DICE)
			{
				return;
			}

			item.GetInteractor().OnUserInteract(session.Player.Entity, room, item, state);
		}
示例#2
0
        public void Handle(Session session, ClientPacket message)
        {
            Room room = session.Player.CurrentRoom;

            if (room == null)
            {
                return;
            }

            int itemId = message.PopInt();

            RoomItem item = room.ItemManager.GetItem(itemId);

            if (item == null)
            {
                return;
            }

            item.GetInteractor().OnUserInteract(session.Player.Entity, room, item, 0);
        }
示例#3
0
        public ServerPacket Compose()
        {
            ServerPacket message = new ServerPacket(Outgoing.AddFloorItemMessageComposer);

            message.WriteInteger(item.Id);
            message.WriteInteger(item.ItemData.SpriteId);
            message.WriteInteger(item.Position.X);
            message.WriteInteger(item.Position.Y);
            message.WriteInteger(item.Position.Rotation);
            message.WriteString(item.Position.Z.ToString());
            message.WriteString(item.ItemData.Height.ToString());
            message.WriteInteger(1);
            item.GetInteractor().Serialize(message, item);
            if (item.IsLimited)
            {
                message.WriteInteger(item.LimitedNumber);
                message.WriteInteger(item.LimitedStack);
            }
            message.WriteInteger(-1);             // item Rent time
            message.WriteInteger((item.ItemData.Modes > 1) ? 1 : 0);
            message.WriteInteger(item.Owner);     // Borrowed = -12345678
            message.WriteString(item.Username);
            return(message);
        }