= Swapped to sync object
This commit is contained in:
+17
-24
@@ -49,16 +49,6 @@ import utils.GlobalLog;
|
|||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public class Main extends ListenerAdapter
|
public class Main extends ListenerAdapter
|
||||||
{
|
{
|
||||||
public class GuildMusicManager
|
|
||||||
{
|
|
||||||
public final AudioPlayer player;
|
|
||||||
|
|
||||||
public GuildMusicManager(AudioPlayerManager manager, Guild guild)
|
|
||||||
{
|
|
||||||
player = manager.createPlayer();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class AudioPlayerSendHandler implements AudioSendHandler
|
public class AudioPlayerSendHandler implements AudioSendHandler
|
||||||
{
|
{
|
||||||
private final AudioPlayer audioPlayer;
|
private final AudioPlayer audioPlayer;
|
||||||
@@ -124,16 +114,6 @@ public class Main extends ListenerAdapter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Variables and bot specific objects
|
|
||||||
private static KittyCore kittyCore;
|
|
||||||
private static DatabaseManager databaseManager;
|
|
||||||
private static CommandManager commandManager;
|
|
||||||
private static Stats stats;
|
|
||||||
private static RPManager rpManager;
|
|
||||||
private static PluginManager pluginManager;
|
|
||||||
private static CharacterManager charManager;
|
|
||||||
|
|
||||||
|
|
||||||
// Initialization and setup
|
// Initialization and setup
|
||||||
public static void main(String[] args) throws InterruptedException, LoginException, Exception
|
public static void main(String[] args) throws InterruptedException, LoginException, Exception
|
||||||
{
|
{
|
||||||
@@ -161,9 +141,9 @@ public class Main extends ListenerAdapter
|
|||||||
final Guild guild = channel.getGuild();
|
final Guild guild = channel.getGuild();
|
||||||
|
|
||||||
System.out.println("Attempting to play");
|
System.out.println("Attempting to play");
|
||||||
GuildMusicManager noDispose = new GuildMusicManager(playerManager, guild);
|
|
||||||
guild.getAudioManager().setSendingHandler(new AudioPlayerSendHandler(player));
|
guild.getAudioManager().setSendingHandler(new AudioPlayerSendHandler(player));
|
||||||
playerManager.loadItemOrdered(noDispose, "https://www.youtube.com/watch?v=qL-JCVA22Lo", new SmallAudio(channel, guild, player));
|
|
||||||
|
playerManager.loadItemOrdered(new Object(), "https://www.youtube.com/watch?v=qL-JCVA22Lo", new SmallAudio(channel, guild, player));
|
||||||
}
|
}
|
||||||
|
|
||||||
super.onGuildMessageReceived(event);
|
super.onGuildMessageReceived(event);
|
||||||
@@ -171,8 +151,21 @@ public class Main extends ListenerAdapter
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------------------------------------------------------------------------------------------
|
/* ----------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
*
|
|
||||||
*
|
|
||||||
|
// Variables and bot specific objects
|
||||||
|
private static KittyCore kittyCore;
|
||||||
|
private static DatabaseManager databaseManager;
|
||||||
|
private static CommandManager commandManager;
|
||||||
|
private static Stats stats;
|
||||||
|
private static RPManager rpManager;
|
||||||
|
private static PluginManager pluginManager;
|
||||||
|
private static CharacterManager charManager;
|
||||||
|
|
||||||
|
|
||||||
|
// Initialization and setup
|
||||||
|
public static void main(String[] args) throws InterruptedException, LoginException, Exception
|
||||||
|
{
|
||||||
// Factory startup. The ordering is intentional.
|
// Factory startup. The ordering is intentional.
|
||||||
GlobalLog.initialize();
|
GlobalLog.initialize();
|
||||||
databaseManager = ObjectBuilderFactory.constructDatabaseManager();
|
databaseManager = ObjectBuilderFactory.constructDatabaseManager();
|
||||||
|
|||||||
Reference in New Issue
Block a user