add command line arguments

This commit is contained in:
Asraelite 2016-03-29 13:45:23 +01:00
parent 4f42723f4a
commit 1160466cf9
13 changed files with 129 additions and 7 deletions

View file

@ -4,7 +4,22 @@ class CommandProcessor {
}
run(command, arg) {
if (command == 'setname') this.setName(arg);
if (command == 'setname') {
this.setName(arg);
} else if (command == 'commands') {
game.gui.chat.addMessage({
type: 'server',
message: 'Available commands:<br /> ' +
'/setname [name]<br /> ' +
'/commands'
});
} else {
game.gui.chat.addMessage({
type: 'server',
message: 'Unrecognised command<br />' +
'Type /commands for a list'
});
}
}
setName(name) {

View file