 # Global constants, use .peek()
 global = {
 	pointsTime: 3600000
+	pointsTimeSec: 3600
 }
 
 # ==================== Events ====================

			log 'capturedBeaconState', allBeaconsCaptured
	log 'allbeaconscapturedFinal', allBeaconsCaptured
	endTime=Db.shared.peek('game', 'endTime')
	if allBeaconsCaptured and endTime-Plugin.time()>3600
		owner = Db.shared.peek('colors', nextOwner , 'name')
		Event.create
			unit: 'captureAll'
			text: "Team " + Db.shared.peek('colors', beacon.get('owner'), 'name') + " has captured all beacons, the game will end in 1 hour if you don't reconquer!!"
		end = Plugin.time()+3600 #in seconds
		log 'end', end
		Db.shared.set 'game', 'newEndTime', end
		Timer.cancel 'endGame'
		Timer.set 3600000, 'endGame'
	
# Called by the beacon neutralize timer
exports.onNeutralize = (args) ->

	# The game will end in 1 hour if all the beacons are captured by one team
	capOwner = Db.shared.peek('game', 'beacons', '0', 'owner')
	log 'capOwner', capOwner
	allBeaconsCaptured = true 
	Db.shared.iterate 'game', 'beacons', (beacon) ->
		if capOwner isnt beacon.peek('owner')
			log 'capOwner2', beacon.peek('owner')
