 # ==================== Functions ====================
 # Get a string of the players that are inRange of a beacon
 getInrangePlayers = (beacon) ->
-	playersStr = undefined
+	playersStr = undefined;
 	Db.shared.iterate 'game', 'beacons', beacon, 'inRange', (player) !->
 		if playersStr?
 			playersStr = playersStr + ', ' + player.key()

		log 'Restarting game'
		initializeGame()
	
# Get background location from player, TODO: notify player when close to beacon
exports.onGeoloc = (userId, geoloc) ->
	log 'Geoloc from ' + Plugin.userName(userId) + '('+userId+'): ', JSON.stringify(geoloc)

# Handle new users joining the happening
exports.onJoin = (userId) ->

				# Cancel timers of ongoing caputes/neutralizes (new ones will be set below if required)
				Timer.cancel 'onCapture', {beacon: beacon.key(), players: getInrangePlayers(beacon.key())}
				Timer.cancel 'onNeutralize', {beacon: beacon.key(), players: getInrangePlayers(beacon.key())}
				removed = undefined;
				if newStatus
					owner = beacon.peek 'owner'
					log 'Added to inRange: id=', client, ', name=', Plugin.userName(client)
