Skip to content

Commit

Permalink
Update server.js
Browse files Browse the repository at this point in the history
  • Loading branch information
PortPixel authored Jul 1, 2016
1 parent 8eb4bc3 commit cbec18c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,31 @@ io.on('connection', function (socket) {
}
});

socket.on('massboost', function(data) {
if (currentPlayer.admin) {
var massAmount = 0;
var worked = false;
if (data.length === 1 && !worked) {
if (data <= 1000) {
massAmount = data[0];
currentPlayer.massTotal += massAmount;
}
console.log(currentPlayer.name + ' used massboost successfully');
socket.emit('serverMSG', currentPlayer.name + ' used massboost successfully');
worked = true;
}
if (!worked) {
socket.emit('serverMSG', 'FAILED Could not find user or code did not run properly');
}
} else {
console.log(currentPlayer.name + ' is trying to use -massboost but isn\'t admin');
socket.emit('serverMSG', 'You are not permitted to use this command');
}
});




socket.on('kick', function(data) {
if (currentPlayer.admin) {
var reason = '';
Expand Down

0 comments on commit cbec18c

Please sign in to comment.