Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 3
0
def createRankedBattlesWebHandlers():
    handlers = [
        createNotificationHandler(handleNotificationCommand),
        createSoundHandler(handleSoundCommand),
        createRequestHandler(handleRequestCommand),
        createContextMenuHandler(handleContextMenuCommand),
        createRankedBattlesHandler(handleRankedBattlesCommand),
        createClanManagementHandler(handleClanManagementCommand)
    ]
    return handlers
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 7
0
    def __openBrowser(self, browserID, browserSize, invokedFrom):
        """Shows the event calendar browser window, pointing to remote calendar
        single-page web application.
        """
        url = yield self.__urlMacros.parse(GUI_SETTINGS.adventCalendarBaseURL, params={'called': invokedFrom})
        if not url:
            _logger.error('Invalid calendar URL')
            return
        browserHandlers = [createRequestHandler(handleRequestCommand)]

        def showBrowserWindow():
            ctx = {'size': browserSize,
             'handlers': browserHandlers,
             'browserID': browserID,
             'alias': VIEW_ALIAS.ADVENT_CALENDAR,
             'showCloseBtn': False,
             'showWaiting': True,
             'showActionBtn': False}
            g_eventBus.handleEvent(events.LoadViewEvent(VIEW_ALIAS.ADVENT_CALENDAR, name=_genWindowName(browserID), ctx=ctx), scope=EVENT_BUS_SCOPE.LOBBY)
            _logger.debug('Calendar browser window shown (browserID=%d)' % browserID)

        yield self.browserCtrl.load(url=url, browserID=browserID, browserSize=browserSize, isAsync=False, useBrowserWindow=False, showBrowserCallback=showBrowserWindow, showCreateWaiting=False)