Files
BattleBane/src/discord/handlers/StatusRequestHandler.java
T

39 lines
1.6 KiB
Java
Raw Normal View History

2022-04-30 09:41:17 -04:00
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package discord.handlers;
import discord.Database;
import discord.MagicBot;
import engine.gameManager.ConfigManager;
import engine.server.login.LoginServer;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
public class StatusRequestHandler {
public static void handleRequest(MessageReceivedEvent event) {
String outString;
// Add server status info
outString = "Server Status: ";
2022-04-30 09:41:17 -04:00
2022-05-10 11:56:06 -04:00
if (LoginServer.isPortInUse(Integer.parseInt(ConfigManager.MB_WORLD_PORT.getValue())))
outString += "ONLINE\n";
2022-04-30 09:41:17 -04:00
else
outString += "OFFLINE\n";
if (Database.online == true)
2023-05-19 07:57:20 -04:00
outString += MagicBot.database.getPopulationString();
2022-04-30 09:41:17 -04:00
else
outString += "Database offline: no population data.";
MagicBot.sendResponse(event, outString);
}
}