public void RemoveCdToJuke() { if (Session == null || Session.GetHabbo() == null || Session.GetHabbo().CurrentRoom == null) { return; } var currentRoom = Session.GetHabbo().CurrentRoom; if (!currentRoom.CheckRights(Session, true) || !currentRoom.GotMusicController()) { return; } var musicController = currentRoom.GetRoomMusicController(); var item = musicController.RemoveDisk(Request.PopWiredInt32()); if (item == null) { return; } item.RemoveFromDatabase(); Session.GetHabbo().GetInventoryComponent().AddNewItem((uint)item.itemID, item.baseItem.ItemId, item.songID.ToString(), true, true, false, item.baseItem.Name, Session.GetHabbo().Id, (uint)item.songID); Session.GetHabbo().GetInventoryComponent().UpdateItems(false); Session.SendMessage(JukeboxDiscksComposer.SerializeSongInventory(Session.GetHabbo().GetInventoryComponent().songDisks)); Session.SendMessage(JukeboxDiscksComposer.Compose(musicController.PlaylistCapacity, musicController.Playlist.Values.ToList())); }
public void LoadInvSongs() { if (Session == null || Session.GetHabbo() == null || Session.GetHabbo().GetInventoryComponent() == null) { return; } Session.SendMessage(JukeboxDiscksComposer.SerializeSongInventory(Session.GetHabbo().GetInventoryComponent().songDisks)); }
public void AddNewCdToJuke() { if (Session == null || Session.GetHabbo() == null || Session.GetHabbo().CurrentRoom == null) { return; } var currentRoom = Session.GetHabbo().CurrentRoom; if (!currentRoom.CheckRights(Session, true)) { return; } var musicController = currentRoom.GetRoomMusicController(); if (musicController.PlaylistSize >= musicController.PlaylistCapacity) { return; } var itemId = Request.PopWiredInt32(); var item = Session.GetHabbo().GetInventoryComponent().GetItem((uint)itemId); if (item == null || item.mBaseItem.InteractionType != InteractionType.musicdisc) { return; } var sitem = new SongItem(item); var NewOrder = musicController.AddDisk(sitem); if (NewOrder < 0) { return; } sitem.SaveToDatabase((int)currentRoom.RoomId); Session.GetHabbo().GetInventoryComponent().RemoveItem((uint)itemId, true); Session.SendMessage(JukeboxDiscksComposer.SerializeSongInventory(Session.GetHabbo().GetInventoryComponent().songDisks)); Session.SendMessage(JukeboxDiscksComposer.Compose(musicController.PlaylistCapacity, musicController.Playlist.Values.ToList())); }
public void Handle(GameClient Session, ClientMessage Event) { if (((Session != null) && (Session.GetHabbo() != null)) && (Session.GetHabbo().CurrentRoom != null)) { Room currentRoom = Session.GetHabbo().CurrentRoom; if (currentRoom.CheckRights(Session, true) && currentRoom.GotMusicController()) { RoomMusicController roomMusicController = currentRoom.GetRoomMusicController(); SongItem item = roomMusicController.RemoveDisk(Event.PopWiredInt32()); if (item != null) { item.RemoveFromDatabase(); Session.GetHabbo().GetInventoryComponent().method_11((uint)item.itemID, item.baseItem.UInt32_0, item.songID.ToString(), false); Session.GetHabbo().GetInventoryComponent().method_9(true); Session.SendMessage(JukeboxDiscksComposer.SerializeSongInventory(Session.GetHabbo().GetInventoryComponent().songDisks)); Session.SendMessage(JukeboxDiscksComposer.Compose(roomMusicController.PlaylistCapacity, roomMusicController.Playlist.Values.ToList <SongInstance>())); } } } }