add everybody-op option, fix #181

This commit is contained in:
Romain Beaumont 2016-01-14 01:14:09 +01:00
parent 029c31fad6
commit 678656e631
3 changed files with 5 additions and 3 deletions

View file

@ -21,5 +21,6 @@
"player-list-text": { "player-list-text": {
"header":"Flying squid", "header":"Flying squid",
"footer":"Test server" "footer":"Test server"
} },
"everybody-op":true
} }

View file

@ -230,6 +230,7 @@ Options is an object containing the following properties:
* plugins * plugins
* view-distance * view-distance
* player-list-text : an object with keys header and footer, displayed on the player list * player-list-text : an object with keys header and footer, displayed on the player list
* everybody-op : true or false, makes everybody op
### Properties ### Properties

View file

@ -32,7 +32,7 @@ module.exports.server=function(serv,options)
}); });
}; };
module.exports.player=function(player,serv) module.exports.player=function(player,serv,settings)
{ {
function addPlayer() function addPlayer()
{ {
@ -40,7 +40,7 @@ module.exports.player=function(player,serv)
player.health = 20; player.health = 20;
player.food = 20; player.food = 20;
player.crouching = false; // Needs added in prismarine-entity later player.crouching = false; // Needs added in prismarine-entity later
player.op = true; // REMOVE THIS WHEN OUT OF TESTING player.op = settings["everybody-op"]; // REMOVE THIS WHEN OUT OF TESTING
player.username=player._client.username; player.username=player._client.username;
serv.players.push(player); serv.players.push(player);
serv.uuidToPlayer[player._client.uuid] = player; serv.uuidToPlayer[player._client.uuid] = player;