/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) { public void setLock(boolean newLock) {
if( newLock ) { if( newLock ) {
me.sendMessage("Factions is now locked"); sendMessage("Factions is now locked");
} else { } else {
me.sendMessage("Factions in now unlocked"); sendMessage("Factions in now unlocked");
} }
lock = newLock; lock = newLock;

View File

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

View File

@ -54,7 +54,7 @@ public class FCommandReload extends FBaseCommand {
} }
else { else {
Factions.log("RELOAD CANCELLED - SPECIFIED FILE INVALID"); 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; return;
} }
} }
@ -69,7 +69,7 @@ public class FCommandReload extends FBaseCommand {
long timeReload = (System.currentTimeMillis()-timeInitStart); long timeReload = (System.currentTimeMillis()-timeInitStart);
Factions.log("=== RELOAD DONE (Took "+timeReload+"ms) ==="); 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");
} }
} }