Make reload command only call configuration file. Fixes issue #59

This commit is contained in:
Ihaveaporpoise 2014-10-05 00:28:00 -05:00
parent eceb10c185
commit 8e248c9ea7

View File

@ -24,37 +24,10 @@ public class CmdReload extends FCommand {
@Override @Override
public void perform() { public void perform() {
long timeInitStart = System.currentTimeMillis(); long timeInitStart = System.currentTimeMillis();
String file = this.argAsString(0, "all").toLowerCase(); Conf.load();
String fileName;
if (file.startsWith("c")) {
Conf.load();
fileName = "conf.json";
} else if (file.startsWith("b")) {
Board.load();
fileName = "board.json";
} else if (file.startsWith("f")) {
Factions.i.loadFromDisc();
fileName = "factions.json";
} else if (file.startsWith("p")) {
FPlayers.i.loadFromDisc();
fileName = "players.json";
} else if (file.startsWith("a")) {
fileName = "all";
Conf.load();
FPlayers.i.loadFromDisc();
Factions.i.loadFromDisc();
Board.load();
} else {
P.p.log("RELOAD CANCELLED - SPECIFIED FILE INVALID");
msg("<b>Invalid file specified. <i>Valid files: all, conf, board, factions, players");
return;
}
long timeReload = (System.currentTimeMillis() - timeInitStart); long timeReload = (System.currentTimeMillis() - timeInitStart);
msg("<i>Reloaded <h>%s <i>from disk, took <h>%dms<i>.", fileName, timeReload); msg("<i>Reloaded <h>conf.json <i>from disk, took <h>%dms<i>.", timeReload);
} }
} }