Exemple #1
0
    if nextmap == sauerbomber.mapName():
        return getNextMap(mode)
    else:
        logging.info('next map for mode %s (%d) is: %s' %(modename, mode, nextmap))
        return nextmap

def rotate():
    logging.info('rotate')
    mode = sauerbomber.gameMode()
    sauerbomber.setMap(getNextMap(mode), mode)
    logging.info('rotated')

def onNoClients():
    logging.info('onNoClients')
    rotate()

def onIntermissionBegin():
    logging.info('onIntermissionBegin')
    rotate()

def onIntermissionEnded():
    logging.info('onIntermissionEnded')

def onMasterModeChanged(mm):
    logging.info('onMasterModeChanged to %d'%(mm))

registerServerEventHandler('no_clients', onNoClients)
registerServerEventHandler('intermission_begin', onIntermissionBegin)
registerServerEventHandler('intermission_ended', onIntermissionBegin)
registerServerEventHandler('server_mastermode_changed', onMasterModeChanged)
Exemple #2
0
def init():
	registerServerEventHandler('player_setmaster', onSetMaster)
	registerServerEventHandler('player_setmaster_off', onSetMasterOff)
	registerServerEventHandler('player_claimed_master', onGainMaster)
	registerServerEventHandler('player_claimed_admin', onGainAdmin)
	registerServerEventHandler('player_released_master', onRelMaster)
	registerServerEventHandler('player_released_admin', onRelAdmin)
	registerServerEventHandler('player_auth_succeed', onAuthSuccess)
	Base.metadata.create_all(dbmanager.engine)