Package net.yura.lobby.quickserver

Source Code of net.yura.lobby.quickserver.QSAdminCommandPlugin

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;
    }
}
TOP

Related Classes of net.yura.lobby.quickserver.QSAdminCommandPlugin

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.