package net.yura.lobby.quickserver;
import java.io.IOException;
import net.yura.lobby.server.GameLobby;
import org.quickserver.net.qsadmin.CommandPlugin;
import org.quickserver.net.server.ClientHandler;
/**
* @author Yura Mamyrin
*/
public class QSAdminCommandPlugin implements CommandPlugin {
public boolean handleCommand(ClientHandler handler, String command) throws IOException {
Server server = (Server)handler.getServer().getStoreObjects()[0];
GameLobby lobbyServer = server.lobbyServer.lobby;
if(command.toLowerCase().startsWith("savedb")) {
lobbyServer.saveToDB();
handler.sendClientMsg("DONE");
return true;
}
if(command.toLowerCase().startsWith("asend ")) {
lobbyServer.androidSend( command.substring("asend ".length()), "test message", null);
handler.sendClientMsg("DONE");
return true;
}
return false;
}
}