forked from MagicBane/Server
Project cleanup pre merge.
This commit is contained in:
@@ -39,10 +39,11 @@ public class ChatChannelHandler {
|
||||
|
||||
if (chatText.startsWith("-r "))
|
||||
outString =
|
||||
"```\n" + "Hello Players \n\n" +
|
||||
chatText.substring(3) + "\n\n" +
|
||||
RobotSpeak.getRobotSpeak() + "\n```";
|
||||
else outString = chatText;
|
||||
"```\n" + "Hello Players \n\n" +
|
||||
chatText.substring(3) + "\n\n" +
|
||||
RobotSpeak.getRobotSpeak() + "\n```";
|
||||
else
|
||||
outString = chatText;
|
||||
|
||||
// Write string to changelog channel
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class DevRequestHandler {
|
||||
|
||||
switch (serverCommand) {
|
||||
|
||||
case "build" :
|
||||
case "build":
|
||||
commandString = "./mbdevbuild.sh";
|
||||
break;
|
||||
case "restart":
|
||||
@@ -61,11 +61,11 @@ public class DevRequestHandler {
|
||||
case "help":
|
||||
MagicBot.sendResponse(event,
|
||||
"#dev build <target> (blank==master) \n" +
|
||||
"#dev shutdown (Shutdown dev server)\n" +
|
||||
"#dev restart (Restarts the server)\n"+
|
||||
"#dev debug (Restarts server in debug mode)\n" +
|
||||
"#dev console # (Displays # lines from console)\n" +
|
||||
"#dev lastout (Displays output from last command) \n");
|
||||
"#dev shutdown (Shutdown dev server)\n" +
|
||||
"#dev restart (Restarts the server)\n" +
|
||||
"#dev debug (Restarts server in debug mode)\n" +
|
||||
"#dev console # (Displays # lines from console)\n" +
|
||||
"#dev lastout (Displays output from last command) \n");
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
@@ -77,18 +77,19 @@ public class DevRequestHandler {
|
||||
}
|
||||
|
||||
processBuilder = new ProcessBuilder("/bin/sh", "-c", commandString + " " + commandArgument + " > devLastOut");
|
||||
logString = String.join(" ",processBuilder.command().toArray(new String[0]));
|
||||
logString = String.join(" ", processBuilder.command().toArray(new String[0]));
|
||||
|
||||
try {
|
||||
processBuilder.start();
|
||||
} catch (IOException e) {
|
||||
Logger.info(e.toString());
|
||||
}
|
||||
processBuilder.start();
|
||||
} catch (IOException e) {
|
||||
Logger.info(e.toString());
|
||||
}
|
||||
|
||||
MagicBot.sendResponse(event, "Executed on dev: " + logString + "\n" +
|
||||
"Use #dev lastout to view results");
|
||||
"Use #dev lastout to view results");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
private static String getLastOutput() {
|
||||
|
||||
String outString = null;
|
||||
|
||||
@@ -56,18 +56,18 @@ public class RegisterAccountHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
// Validate account name with regex
|
||||
// Validate account name with regex
|
||||
|
||||
accountName = args[0].replaceAll("\\s+", "");
|
||||
accountName = args[0].replaceAll("\\s+", "");
|
||||
|
||||
if (MagicBot.accountNameRegex.matcher(accountName).matches() == false) {
|
||||
if (MagicBot.accountNameRegex.matcher(accountName).matches() == false) {
|
||||
|
||||
MagicBot.sendResponse(event,
|
||||
"Your supplied account name does not compute.\n" +
|
||||
"Account names must satisfy following regex:\n" +
|
||||
"^[\\p{Alnum}]{6,20}$");
|
||||
return;
|
||||
}
|
||||
MagicBot.sendResponse(event,
|
||||
"Your supplied account name does not compute.\n" +
|
||||
"Account names must satisfy following regex:\n" +
|
||||
"^[\\p{Alnum}]{6,20}$");
|
||||
return;
|
||||
}
|
||||
|
||||
if (accountName.equalsIgnoreCase("accountname")) {
|
||||
MagicBot.sendResponse(event,
|
||||
|
||||
@@ -24,7 +24,7 @@ public class StatusRequestHandler {
|
||||
outString = "Server Status: ";
|
||||
|
||||
if (LoginServer.isPortInUse(Integer.parseInt(ConfigManager.MB_WORLD_PORT.getValue())))
|
||||
outString += "ONLINE\n";
|
||||
outString += "ONLINE\n";
|
||||
else
|
||||
outString += "OFFLINE\n";
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public class TrashRequestHandler {
|
||||
|
||||
// Anounce event in septic tank channel
|
||||
|
||||
outString = "```\n" + trashCount + " Player Character were for to deleted due to verified cheatings. \n\n";
|
||||
outString = "```\n" + trashCount + " Player Character were for to deleted due to verified cheatings. \n\n";
|
||||
outString += MagicBot.database.getTrashList() + "\n\n";
|
||||
outString += RobotSpeak.getRobotInsult() + "\n```";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user