mirror of
https://gitlab.com/Deukhoofd/BattleSim.git
synced 2025-10-27 18:00:03 +00:00
Merged master into 1.0.1
This commit is contained in:
@@ -21,7 +21,7 @@ replays = require('./replays')
|
||||
modify = require('./modify')
|
||||
|
||||
MAX_MESSAGE_LENGTH = 250
|
||||
MAX_RANK_DISPLAYED = 100
|
||||
MAX_RANK_DISPLAYED = 25
|
||||
|
||||
# A MD5 hash of all the JavaScript files used by the client. This is passed to
|
||||
# each new connection via the .jade template, and when the client connects. If
|
||||
|
||||
@@ -306,20 +306,21 @@ class @BattleServer
|
||||
# Add user to spectators
|
||||
# TODO: player.id should be using player.name, but alts present a problem.
|
||||
user = @users.get(player.id)
|
||||
battle.add(spark) for spark in user.sparks
|
||||
if typeof user != 'undefined'
|
||||
battle.add(spark) for spark in user.sparks
|
||||
|
||||
# Add/remove player ids to/from user battles
|
||||
@userBattles[player.id] ?= {}
|
||||
@userBattles[player.id][battleId] = true
|
||||
|
||||
# Add/remove player ids to/from user battles
|
||||
@userBattles[player.id] ?= {}
|
||||
@userBattles[player.id][battleId] = true
|
||||
# Add the player to the list if its not an alt
|
||||
if player.id == player.ratingKey # hacky - but no alternative right now
|
||||
@visibleUserBattles[player.id] ?= {}
|
||||
@visibleUserBattles[player.id][battleId] = true
|
||||
|
||||
# Add the player to the list if its not an alt
|
||||
if player.id == player.ratingKey # hacky - but no alternative right now
|
||||
@visibleUserBattles[player.id] ?= {}
|
||||
@visibleUserBattles[player.id][battleId] = true
|
||||
battle.once 'end', @removeUserBattle.bind(this, player.id, player.name, battleId)
|
||||
|
||||
battle.once 'end', @removeUserBattle.bind(this, player.id, player.name, battleId)
|
||||
|
||||
battle.once 'expire', @removeBattle.bind(this, battleId)
|
||||
battle.once 'expire', @removeBattle.bind(this, battleId)
|
||||
|
||||
# Add the battle to the achievements system
|
||||
# Uneligible battles are ignored by this function
|
||||
|
||||
Reference in New Issue
Block a user