Implemented Command Processor (#375)
* Added CommandConsole and CommandProcessor Interface * Added two commands, ListPlayers and Stop * Registered commands with CommandConsole * Added request for console from main. Made help prompt not print after requesting help... * Moved some files around You didn't see anything * Bug fix * swap `break;` for `continue;` * *cough* bug fix
This commit is contained in:
1 parent
02c7c30582
commit
9b220ec47c
5 files changed
+145
No files matched your search
@@ -0,0 +1,28 @@
|
||||
package com.rebotted.console.commands;
|
||||
|
||||
import com.rebotted.GameEngine;
|
||||
import com.rebotted.console.CommandProcessor;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author RS-Emulators
|
||||
*
|
||||
*/
|
||||
public class Stop implements CommandProcessor {
|
||||
|
||||
@Override
|
||||
public boolean command(String[] cmd) {
|
||||
if (!cmd[0].equalsIgnoreCase("stop")) {
|
||||
return false;
|
||||
}
|
||||
System.out.println("Setting shutdown flag to true...");
|
||||
GameEngine.shutdownServer = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String help() {
|
||||
return "stop - sets GameEngine.shutdownServer to true.";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user