use of games.strategy.engine.message.RemoteName in project triplea by triplea-game.
the class ModeratorController method getChatLogHeadlessHostBot.
@Override
public String getChatLogHeadlessHostBot(final INode node, final String hashedPassword, final String salt) {
assertUserIsAdmin();
if (serverMessenger.getServerNode().equals(node)) {
throw new IllegalStateException("Cannot do this for server node");
}
final INode modNode = MessageContext.getSender();
final String mac = getNodeMacAddress(node);
final RemoteName remoteName = RemoteHostUtils.getRemoteHostUtilsName(node);
final IRemoteHostUtils remoteHostUtils = (IRemoteHostUtils) allMessengers.getRemoteMessenger().getRemote(remoteName);
final String response = remoteHostUtils.getChatLogHeadlessHostBot(hashedPassword, salt);
logger.info(String.format(((response == null || response.equals("Invalid password!")) ? "Failed" : "Successful") + " Remote get Chat Log of Headless HostBot. " + "Host: %s IP: %s Mac: %s Mod Username: %s Mod IP: %s Mod Mac: %s", node.getName(), node.getAddress().getHostAddress(), mac, modNode.getName(), modNode.getAddress().getHostAddress(), getNodeMacAddress(modNode)));
return response;
}
use of games.strategy.engine.message.RemoteName in project triplea by triplea-game.
the class ModeratorController method shutDownHeadlessHostBot.
@Override
public String shutDownHeadlessHostBot(final INode node, final String hashedPassword, final String salt) {
assertUserIsAdmin();
if (serverMessenger.getServerNode().equals(node)) {
throw new IllegalStateException("Cannot shutdown server node");
}
final INode modNode = MessageContext.getSender();
final String mac = getNodeMacAddress(node);
logger.info(String.format("Started Remote Shutdown of Headless HostBot. Host: %s IP: %s Mac: %s Mod Username: %s Mod IP: %s Mod Mac: %s", node.getName(), node.getAddress().getHostAddress(), mac, modNode.getName(), modNode.getAddress().getHostAddress(), getNodeMacAddress(modNode)));
final RemoteName remoteName = RemoteHostUtils.getRemoteHostUtilsName(node);
final IRemoteHostUtils remoteHostUtils = (IRemoteHostUtils) allMessengers.getRemoteMessenger().getRemote(remoteName);
final String response = remoteHostUtils.shutDownHeadlessHostBot(hashedPassword, salt);
logger.info(String.format((response == null ? "Successful" : "Failed (" + response + ")") + " Remote Shutdown of Headless HostBot. " + "Username: %s IP: %s Mac: %s Mod Username: %s Mod IP: %s Mod Mac: %s", node.getName(), node.getAddress().getHostAddress(), mac, modNode.getName(), modNode.getAddress().getHostAddress(), getNodeMacAddress(modNode)));
return response;
}
use of games.strategy.engine.message.RemoteName in project triplea by triplea-game.
the class ModeratorController method banPlayerHeadlessHostBot.
@Override
public String banPlayerHeadlessHostBot(final INode node, final String playerNameToBeBanned, final int hours, final String hashedPassword, final String salt) {
assertUserIsAdmin();
if (serverMessenger.getServerNode().equals(node)) {
throw new IllegalStateException("Cannot do this for server node");
}
final INode modNode = MessageContext.getSender();
final String mac = getNodeMacAddress(node);
final RemoteName remoteName = RemoteHostUtils.getRemoteHostUtilsName(node);
final IRemoteHostUtils remoteHostUtils = (IRemoteHostUtils) allMessengers.getRemoteMessenger().getRemote(remoteName);
final String response = remoteHostUtils.banPlayerHeadlessHostBot(playerNameToBeBanned, hours, hashedPassword, salt);
logger.info(String.format((response == null ? "Successful" : "Failed (" + response + ")") + " Remote Ban of " + playerNameToBeBanned + " for " + hours + "hours In Headless HostBot. Host: %s IP: %s Mac: %s Mod Username: %s Mod IP: %s Mod Mac: %s", node.getName(), node.getAddress().getHostAddress(), mac, modNode.getName(), modNode.getAddress().getHostAddress(), getNodeMacAddress(modNode)));
return response;
}
Aggregations