Esempio n. 1
0
    def process(self):
        model_mgr = self.getModelMgr()
        config = BackendApi.get_current_produce_event_config(
            model_mgr, using=settings.DB_READONLY)

        if config.mid == 0 or not config.is_open_epilogue(OSAUtil.get_now()):
            self.appRedirect(self.makeAppLinkUrlRedirect(UrlMaker.mypage()))
            return

        produce_event_master = config.get_produce_event_master(model_mgr)
        if produce_event_master is None:
            self.appRedirect(self.makeAppLinkUrlRedirect(UrlMaker.mypage()))
            return

        uid = self.getViewerPlayer().id
        if BackendApi.check_produceevent_lead_epilogue(
                model_mgr, uid, produce_event_master.id):
            flagrecord = BackendApi.update_produceevenflagrecord(
                produce_event_master.id, uid, epvtime=OSAUtil.get_now())
            model_mgr.set_got_models([flagrecord])

        url = UrlMaker.produceevent_top(produce_event_master.id)
        if produce_event_master.ed:
            # 演出のパラメータ.
            effectpath = UrlMaker.event_scenario()
            dataUrl = self.makeAppLinkUrlEffectParamGet(
                'eventscenario/%d/last%s' % (produce_event_master.ed, url))
            self.appRedirectToEffect2(effectpath, dataUrl)
        else:
            # 演出なし.
            self.appRedirect(self.makeAppLinkUrlRedirect(url))
Esempio n. 2
0
    def process(self):
        self.setFromPage(None)
        
        model_mgr = self.getModelMgr()
        
        v_player = self.getViewerPlayer()
        if not BackendApi.check_loginbonus_received(v_player.getModel(PlayerLogin)):
            if not settings_sub.IS_BENCH:
                # ログインボーナスを受け取っていない.
                url = UrlMaker.loginbonus()
                self.appRedirect(self.makeAppLinkUrlRedirect(url))
                return
        elif BackendApi.check_lead_loginbonustimelimited(model_mgr, v_player.id):
            if not settings_sub.IS_BENCH:
                # ロングログインボーナスを受け取っていない.
                url = UrlMaker.loginbonustimelimiteddo()
                self.appRedirect(self.makeAppLinkUrlRedirect(url))
                return
        elif BackendApi.check_lead_loginbonus_sugoroku(model_mgr, v_player.id):
            if not settings_sub.IS_BENCH:
                # 双六ログインボーナスを受け取っていない.
                url = UrlMaker.loginbonussugorokudo()
                self.appRedirect(self.makeAppLinkUrlRedirect(url))
                return
        elif BackendApi.check_raidevent_lead_opening(model_mgr, v_player.id, using=settings.DB_READONLY):
            if not settings_sub.IS_BENCH and not (settings_sub.IS_LOCAL and self.request.get('_test')):
                # イベントOPを見ないといけない.
                url = UrlMaker.raidevent_opening()
                self.appRedirect(self.makeAppLinkUrlRedirect(url))
                return
        elif BackendApi.check_raidevent_lead_bigboss(model_mgr, v_player.id, using=settings.DB_READONLY):
            if not settings_sub.IS_BENCH and not (settings_sub.IS_LOCAL and self.request.get('_test')):
                # 大ボス演出を見ないといけない.
                url = UrlMaker.raidevent_bigboss()
                self.appRedirect(self.makeAppLinkUrlRedirect(url))
                return
        elif BackendApi.check_raidevent_lead_epilogue(model_mgr, v_player.id, using=settings.DB_READONLY):
            if not settings_sub.IS_BENCH and not (settings_sub.IS_LOCAL and self.request.get('_test')):
                # イベントEDを見ないといけない.
                url = UrlMaker.raidevent_epilogue()
                self.appRedirect(self.makeAppLinkUrlRedirect(url))
                return
        elif BackendApi.check_scoutevent_lead_opening(model_mgr, v_player.id, using=settings.DB_READONLY):
            if not settings_sub.IS_BENCH and not (settings_sub.IS_LOCAL and self.request.get('_test')):
                # イベントOPを見ないといけない.
                url = UrlMaker.scoutevent_opening()
                self.appRedirect(self.makeAppLinkUrlRedirect(url))
                return
        elif BackendApi.check_scoutevent_lead_epilogue(model_mgr, v_player.id, using=settings.DB_READONLY):
            if not settings_sub.IS_BENCH and not (settings_sub.IS_LOCAL and self.request.get('_test')):
                # イベントEDを見ないといけない.
                url = UrlMaker.scoutevent_epilogue()
                self.appRedirect(self.makeAppLinkUrlRedirect(url))
                return
        elif BackendApi.check_battleevent_lead_opening(model_mgr, v_player.id, using=settings.DB_READONLY):
            if not settings_sub.IS_BENCH and not (settings_sub.IS_LOCAL and self.request.get('_test')):
                # イベントOPを見ないといけない.
                url = UrlMaker.battleevent_opening()
                self.appRedirect(self.makeAppLinkUrlRedirect(url))
                return
        elif BackendApi.check_battleevent_lead_scenario(model_mgr, v_player.id, using=settings.DB_READONLY):
            if not settings_sub.IS_BENCH and not (settings_sub.IS_LOCAL and self.request.get('_test')):
                # 中押し演出を見ていない.
                url = UrlMaker.battleevent_scenario()
                self.appRedirect(self.makeAppLinkUrlRedirect(url))
                return False
        elif BackendApi.check_battleevent_lead_epilogue(model_mgr, v_player.id, using=settings.DB_READONLY):
            if not settings_sub.IS_BENCH and not (settings_sub.IS_LOCAL and self.request.get('_test')):
                # イベントエピローグを見ないといけない.
                url = UrlMaker.battleevent_epilogue()
                self.appRedirect(self.makeAppLinkUrlRedirect(url))
                return
        elif BackendApi.check_produceevent_lead_opening(model_mgr, v_player.id, using=settings.DB_READONLY):
            if not settings_sub.IS_BENCH and not (settings_sub.IS_LOCAL and self.request.get('_test')):
                # イベントOPを見ないといけない.
                url = UrlMaker.produceevent_opening()
                self.appRedirect(self.makeAppLinkUrlRedirect(url))
                return
        elif BackendApi.check_produceevent_lead_epilogue(model_mgr, v_player.id, using=settings.DB_READONLY):
            if not settings_sub.IS_BENCH and not (settings_sub.IS_LOCAL and self.request.get('_test')):
                # イベントEDを見ないといけない.
                url = UrlMaker.produceevent_epilogue()
                self.appRedirect(self.makeAppLinkUrlRedirect(url))
                return
        elif BackendApi.check_cabaclub_lead_resultanim(model_mgr, v_player.id, OSAUtil.get_now(), using=settings.DB_READONLY):
            if not settings_sub.IS_BENCH and not (settings_sub.IS_LOCAL and self.request.get('_test')):
                # 店舗結果演出へ.
                self.appRedirect(self.makeAppLinkUrlRedirect(UrlMaker.cabaclubresultanim(), add_frompage=False))
                return
        
        self.__news_num = 0
        
        self.checkPanelMission()
        if self.response.isEnd:
            return
        
        self.procRankingGacha()
        self.checkPresentEveryone()
        self.checkLevelUpBonus()
        self.putCardInfo()
        self.putFriendNum()
        self.putFriendRequestNum()
        self.putFreeGachaFlag()
        self.putPresentNum()
        self.putFriendLog()
        self.putFriendAcceptNum()
        self.putProduceInfo()
        self.putHappeningInfo()
        self.prepareRaidLog()
        self.putInfomations()
        self.putGreetLog()
        self.putBanner()
        self.putCabaClubInfo()
        self.putTitleInfo()
        self.putPlayerInfo()
        self.putRaidLog()
        
        self.checkPaymentRecord()
        
        self.tradeScoutGum()
        
        if self.is_active_dxp():
            self.check_offerwall(model_mgr, v_player)

        self.html_param['news_num'] = self.__news_num
        
        self.html_param['profile_tag'] = self.makeProfileTag(v_player.id)
        
        self.html_param['url_infospace'] = u'%s#infospace' % self.makeAppLinkUrl(UrlMaker.mypage())
        
        if self.is_active_dxp() and not self.is_pc:
            self.html_param['url_offerwall'] = DXPAPI(is_rel=self.is_rel).offerwall_url(self.app_id, v_player.dmmid)
            self.html_param['url_offerwallR18'] = DXPAPI(is_rel=self.is_rel,is_R18=True).offerwall_url(self.app_id, v_player.dmmid)
        print DXPAPI(is_rel=self.is_rel).offerwall_url(self.app_id, v_player.dmmid)
        print DXPAPI(is_rel=self.is_rel,is_R18=True).offerwall_url(self.app_id, v_player.dmmid)
        self.putPopupBanner()
        
        self.writeAppHtml('mypage')