forked from MagicBane/Server
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							38 lines
						
					
					
						
							1.6 KiB
						
					
					
				
			
		
		
	
	
							38 lines
						
					
					
						
							1.6 KiB
						
					
					
				| // • ▌ ▄ ·.  ▄▄▄·  ▄▄ • ▪   ▄▄· ▄▄▄▄·  ▄▄▄·  ▐▄▄▄  ▄▄▄ . | |
| // ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· | |
| // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ | |
| // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ | |
| // ▀▀  █▪▀▀▀ ▀  ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀  ▀  ▀ ▀▀  █▪ ▀▀▀ | |
| //      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: "; | |
|  | |
|         if (LoginServer.isPortInUse(Integer.parseInt(ConfigManager.MB_WORLD_PORT.getValue()))) | |
|             outString += "ONLINE\n"; | |
|         else | |
|             outString += "OFFLINE\n"; | |
|  | |
|         if (Database.online == true) | |
|             outString += MagicBot.database.getPopulationString(); | |
|         else | |
|             outString += "Database offline: no population data."; | |
|  | |
|         MagicBot.sendResponse(event, outString); | |
|     } | |
| }
 | |
| 
 |