Fix a few stylistic errors

This commit is contained in:
Guangcong Luo 2013-05-16 10:57:01 -07:00
parent 5632106272
commit 01b5884691
3 changed files with 10 additions and 4 deletions

View File

@ -2006,7 +2006,6 @@ var Battle = (function() {
this.win();
};
Battle.prototype.win = function(side) {
var winSide = false;
if (this.ended) {
return false;
}
@ -3296,6 +3295,12 @@ var Battle = (function() {
Battle.prototype.leave = function(slot) {
if (slot === 'p1' || slot === 'p2') {
var side = this[slot];
if (!side) {
console.log('**** '+slot+' tried to leave before it was possible in '+this.id);
require('./crashlogger.js')({stack: '**** '+slot+' tried to leave before it was possible in '+this.id}, 'A simulator process');
return;
}
side.emitUpdate({side:'none'});
side.isActive = false;
this.add('player', slot);

View File

@ -938,7 +938,7 @@ var BattleRoom = (function() {
}
return user;
};
GlobalRoom.prototype.onUpdateIdentity = function() {};
BattleRoom.prototype.onUpdateIdentity = function() {};
BattleRoom.prototype.onLeave = function(user) {
if (!user) return; // ...
if (user.battles[this.id]) {

View File

@ -1042,10 +1042,11 @@ exports.checkBanned = checkBanned;
exports.checkLocked = checkLocked;
function unban(name) {
var success;
var userid = toId(name);
for (var ip in bannedIps) {
if (Users.bannedIps[ip] === userid) {
delete Users.bannedIps[ip];
if (bannedIps[ip] === userid) {
delete bannedIps[ip];
success = true;
}
}