mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-18 23:46:28 +01:00
Add extra error logging if there are no YT playlists for item
This commit is contained in:
parent
eb7c7a5498
commit
0d9afb933e
@ -1,11 +1,15 @@
|
||||
package com.eu.habbo.messages.incoming.rooms.items.youtube;
|
||||
|
||||
import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.habbohotel.items.YoutubeManager;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionYoutubeTV;
|
||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||
import com.eu.habbo.messages.incoming.MessageHandler;
|
||||
import com.eu.habbo.messages.outgoing.handshake.ConnectionErrorComposer;
|
||||
import com.eu.habbo.messages.outgoing.rooms.items.youtube.YoutubeDisplayListComposer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class YoutubeRequestPlaylists extends MessageHandler {
|
||||
@Override
|
||||
public void handle() throws Exception {
|
||||
@ -17,7 +21,15 @@ public class YoutubeRequestPlaylists extends MessageHandler {
|
||||
if (item instanceof InteractionYoutubeTV) {
|
||||
InteractionYoutubeTV tv = (InteractionYoutubeTV) item;
|
||||
|
||||
this.client.sendResponse(new YoutubeDisplayListComposer(itemId, Emulator.getGameEnvironment().getItemManager().getYoutubeManager().getPlaylistsForItemId(item.getBaseItem().getId()), tv.currentPlaylist));
|
||||
ArrayList<YoutubeManager.YoutubePlaylist> playlists = Emulator.getGameEnvironment().getItemManager().getYoutubeManager().getPlaylistsForItemId(item.getBaseItem().getId());
|
||||
|
||||
if (playlists == null) {
|
||||
Emulator.getLogging().logErrorLine("No YouTube playlists set for base item #" + item.getBaseItem().getId());
|
||||
this.client.sendResponse(new ConnectionErrorComposer(1000));
|
||||
return;
|
||||
}
|
||||
|
||||
this.client.sendResponse(new YoutubeDisplayListComposer(itemId, playlists, tv.currentPlaylist));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user