/f lock command can now be used through console; fix for /f reload command causing NPE if run from console

This commit is contained in:
Brettflan 2011-06-10 14:22:29 -05:00
parent f9de4171d4
commit 2e1d7da50f
3 changed files with 8 additions and 6 deletions

View File

@ -236,9 +236,9 @@ public class FBaseCommand {
public void setLock(boolean newLock) {
if( newLock ) {
me.sendMessage("Factions is now locked");
sendMessage("Factions is now locked");
} else {
me.sendMessage("Factions in now unlocked");
sendMessage("Factions in now unlocked");
}
lock = newLock;

View File

@ -8,6 +8,8 @@ public class FCommandLock extends FBaseCommand {
public FCommandLock() {
aliases.add("lock");
senderMustBePlayer = false;
optionalParameters.add("on|off");
helpDescription = "lock all write stuff";
@ -23,9 +25,9 @@ public class FCommandLock extends FBaseCommand {
setLock( parseBool( parameters.get(0) ));
} else {
if( isLocked() ) {
me.sendMessage("Factions is locked");
sendMessage("Factions is locked");
} else {
me.sendMessage("Factions is not locked");
sendMessage("Factions is not locked");
}
}
}

View File

@ -54,7 +54,7 @@ public class FCommandReload extends FBaseCommand {
}
else {
Factions.log("RELOAD CANCELLED - SPECIFIED FILE INVALID");
me.sendMessage("Invalid file specified. Valid files: conf, board, factions, players.");
sendMessage("Invalid file specified. Valid files: conf, board, factions, players.");
return;
}
}
@ -69,7 +69,7 @@ public class FCommandReload extends FBaseCommand {
long timeReload = (System.currentTimeMillis()-timeInitStart);
Factions.log("=== RELOAD DONE (Took "+timeReload+"ms) ===");
me.sendMessage("Factions file" + fileName + " reloaded from disk, took " + timeReload + "ms");
sendMessage("Factions file" + fileName + " reloaded from disk, took " + timeReload + "ms");
}
}