Example #1
0
def createStrongholdsWebHandlers(includeCloseBrowser=False,
                                 onBrowserOpen=None,
                                 onBrowserClose=None):
    """
    Creates list of stronghold specific web handlers
    :param includeCloseBrowser: - whether 'close_browser' handler to be included
    :return: - list oh handlers
    """
    openWindowSubCommands = {}
    openWindowSubCommands.update(OPEN_WINDOW_CLAN_SUB_COMMANDS)
    openWindowSubCommands.update(OPEN_WINDOW_PROFILE_SUB_COMMANS)
    openWindowSubCommands.update(
        createOpenBrowserSubCommands(
            onBrowserOpen, partial(createStrongholdsWebHandlers, True)))
    handlers = [
        createNotificationHandler(handleNotificationCommand),
        createSoundHandler(handleSoundCommand),
        createOpenWindowHandler(
            createOpenWindowCommandHandler(openWindowSubCommands)),
        createOpenTabHandler(handleOpenTabCommand),
        createStrongholdsBattleHandler(handleStrongholdsBattleCommand),
        createRequestHandler(handleRequestCommand),
        createContextMenuHandler(handleContextMenuCommand),
        createClanManagementHandler(handleClanManagementCommand)
    ]
    if includeCloseBrowser:
        handlers.append(
            createCloseWindowHandler(
                partial(handleCloseWindowCommand, onBrowserClose)))
    return handlers
Example #2
0
def createHofWebHandlers():
    handlers = [createVehiclesHandler(handleVehiclesCommand),
     createOpenWindowHandler(createOpenWindowCommandHandler(OPEN_WINDOW_CLAN_SUB_COMMANDS)),
     createSoundHandler(handleSoundCommand),
     createRequestHandler(handleRequestCommand),
     createContextMenuHandler(handleContextMenuCommand),
     createOpenTabHandler(handleOpenTabCommand),
     createCloseWindowHandler(partial(handleCloseWindowCommand, None, isWindow=False))]
    return handlers
Example #3
0
def createRankedBattlesWebHandlers():
    handlers = [
        createNotificationHandler(handleNotificationCommand),
        createSoundHandler(handleSoundCommand),
        createRequestHandler(handleRequestCommand),
        createContextMenuHandler(handleContextMenuCommand),
        createRankedBattlesHandler(handleRankedBattlesCommand),
        createClanManagementHandler(handleClanManagementCommand)
    ]
    return handlers
Example #4
0
def createStrongholdsWebHandlers(includeCloseBrowser=False, onBrowserOpen=None, onBrowserClose=None):
    handlers = [createNotificationHandler(handleNotificationCommand),
     createSoundHandler(handleSoundCommand),
     createOpenWindowHandler(profileHandler=handleOpenProfile, clanCardHandler=handleOpenClanCard, clanInvitesHandler=handleOpenClanInvites, clanSearchHandler=handleOpenClanSearch, browserHandler=getOpenBrowserHandler(onBrowserOpen, partial(createStrongholdsWebHandlers, True))),
     createOpenTabHandler(hangarHandler=getOpenHangarTabHandler(), profileHandler=getOpenProfileTabHandler()),
     createStrongholdsBattleHandler(openListHandler=handleOpenList, battleChosenHandler=handleBattleChosen, joinBattleHandler=handleJoinBattle),
     createRequestHandler(token1Handler=handleRequestWgniToken, graphicsSettingsHandler=handlerRequestGraphicsSettings, accessTokenHandler=handleRequestAccessToken),
     createContextMenuHandler(handleShowUserContextMenu),
     createClanManagementHandler(membersOnlineHandler=handleGetMembersOnline, membersStatusHandler=handleGetMembersStatus, friendsStatusHandler=handleGetFriendsStatus)]
    if includeCloseBrowser:
        handlers.append(createCloseWindowHandler(getCloseBrowserWindowHandler(onBrowserClose)))
    return handlers
def createRankedBattlesWebHandlers():
    handlers = [
        createNotificationHandler(handleNotificationCommand),
        createSoundHandler(handleSoundCommand),
        createRequestHandler(
            token1Handler=handleRequestWgniToken,
            graphicsSettingsHandler=handlerRequestGraphicsSettings,
            accessTokenHandler=handleRequestAccessToken),
        createContextMenuHandler(handleShowUserContextMenu),
        createRankedBattlesHandler(closeBrowser),
        createClanManagementHandler(
            membersOnlineHandler=handleGetMembersOnline,
            membersStatusHandler=handleGetMembersStatus,
            friendsStatusHandler=handleGetFriendsStatus)
    ]
    return handlers
Example #6
0
def createHofWebHandlers():
    handlers = [
        createVehiclesHandler(vehicleInfoHandler=handleGetVehicleInfo),
        createOpenWindowHandler(clanCardHandler=handleOpenClanCard,
                                clanInvitesHandler=handleOpenClanInvites,
                                clanSearchHandler=handleOpenClanSearch),
        createSoundHandler(handleSoundCommand),
        createRequestHandler(
            token1Handler=handleRequestWgniToken,
            graphicsSettingsHandler=handlerRequestGraphicsSettings,
            accessTokenHandler=handleRequestAccessToken),
        createContextMenuHandler(userMenuHandler=handleShowUserContextMenu),
        createOpenTabHandler(hangarHandler=getOpenHangarTabHandler(),
                             profileHandler=getOpenProfileTabHandler()),
        createCloseWindowHandler(handleCloseBrowserView)
    ]
    return handlers