Add server state mapping for web integration.
This commit is contained in:
@@ -8,6 +8,7 @@ import com.alttd.chat.managers.ChatUserManager;
|
||||
import com.alttd.chat.managers.PartyManager;
|
||||
import com.alttd.chat.objects.ChatUser;
|
||||
import com.alttd.chat.objects.chat_log.ChatLogHandler;
|
||||
import com.alttd.chat.objects.chat_log.WebHandler;
|
||||
import com.alttd.chat.util.ALogger;
|
||||
import com.alttd.velocitychat.commands.*;
|
||||
import com.alttd.velocitychat.handlers.ChatHandler;
|
||||
@@ -67,7 +68,9 @@ public class VelocityChat {
|
||||
PartyManager.initialize(); // load the parties from the db and add the previously loaded users to them
|
||||
|
||||
serverHandler = new ServerHandler();
|
||||
ChatLogHandler chatLogHandler = new ChatLogHandler(true);
|
||||
WebHandler webHandler = new WebHandler();
|
||||
|
||||
ChatLogHandler chatLogHandler = new ChatLogHandler(webHandler, true);
|
||||
chatHandler = new ChatHandler(chatLogHandler);
|
||||
server.getEventManager().register(this, new ChatListener());
|
||||
server.getEventManager().register(this, new ProxyPlayerListener());
|
||||
@@ -76,7 +79,7 @@ public class VelocityChat {
|
||||
channelIdentifier = MinecraftChannelIdentifier.create(channels[0], channels[1]);
|
||||
server.getChannelRegistrar().register(channelIdentifier);
|
||||
server.getEventManager().register(this, new PluginMessageListener(channelIdentifier));
|
||||
loadCommands();
|
||||
loadCommands(webHandler);
|
||||
// setup console chatuser
|
||||
ChatUser console = new ChatUser(Config.CONSOLEUUID, -1, null);
|
||||
console.setDisplayName(Config.CONSOLENAME);
|
||||
@@ -113,8 +116,8 @@ public class VelocityChat {
|
||||
return server;
|
||||
}
|
||||
|
||||
public void loadCommands() {
|
||||
ChatLogHandler instance = ChatLogHandler.getInstance(false);
|
||||
public void loadCommands(WebHandler webHandler) {
|
||||
ChatLogHandler instance = ChatLogHandler.getInstance(webHandler, false);
|
||||
new SilentJoinCommand(server);
|
||||
new GlobalAdminChat(server);
|
||||
new Reload(server);
|
||||
|
||||
Reference in New Issue
Block a user