예제 #1
0
 def __resolveInitialChapter(self, ctx):
     self._currentChapter = None
     if ctx.initialChapter is not None:
         self._currentChapter = ctx.initialChapter
         return True
     completed = self._bonuses.getCompleted()
     fromCache = self._cache.currentChapter()
     if fromCache is not None and self._settings.findChapterInCache:
         chapter = self._descriptor.getChapter(fromCache)
         if self._descriptor.isChapterInitial(chapter, completed):
             self._currentChapter = fromCache
         else:
             self._cache.clearChapterData()
             LOG_WARNING(
                 "Initial chapter not found in cache or bonuses is invalid",
                 fromCache,
                 chapter.getBonusID() if chapter is not None else None,
                 completed,
             )
     if self._currentChapter is None:
         self._currentChapter = self._descriptor.getInitialChapterID(completed=completed)
     if self._currentChapter is None:
         LOG_ERROR("Initial chapter not found. Tutorial is stopping")
         self.stop(reason=TUTORIAL_STOP_REASON.CRITICAL_ERROR)
         return False
     else:
         return True
예제 #2
0
 def __resolveInitialChapter(self, ctx):
     self._currentChapter = None
     if ctx.initialChapter is not None:
         self._currentChapter = ctx.initialChapter
         return True
     completed = self._bonuses.getCompleted()
     fromCache = self._cache.currentChapter()
     if fromCache is not None and self._settings.findChapterInCache:
         chapter = self._descriptor.getChapter(fromCache)
         if self._descriptor.isChapterInitial(chapter, completed):
             self._currentChapter = fromCache
         else:
             self._cache.clearChapterData()
             LOG_WARNING(
                 'Initial chapter not found in cache or bonuses is invalid',
                 fromCache,
                 chapter.getBonusID() if chapter is not None else None,
                 completed)
     if self._currentChapter is None:
         self._currentChapter = self._descriptor.getInitialChapterID(
             completed=completed)
     if self._currentChapter is None:
         LOG_ERROR('Initial chapter not found. Tutorial is stopping')
         self.stop(reason=TUTORIAL_STOP_REASON.CRITICAL_ERROR)
         return False
     return True
예제 #3
0
파일: lobby.py 프로젝트: webiumsk/WOT0.10.0
def readBonusTriggerSection(xmlCtx, section, chapter, triggerID):
    return triggers.BonusTrigger(triggerID, chapter.getBonusID())
예제 #4
0
def readBonusTriggerSection(xmlCtx, section, chapter, triggerID):
    return triggers.BonusTrigger(triggerID, chapter.getBonusID())
예제 #5
0
 def __resolveInitialChapter(self, ctx):
     self._currentChapter = None
     bonusCompleted = self._bonuses.getCompleted()
     fromCache = self._cache.currentChapter()
     if fromCache is not None and self._settings.findChapterInCache:
         chapter = self._descriptor.getChapter(fromCache)
         if self._descriptor.isChapterInitial(chapter, bonusCompleted):
             self._currentChapter = fromCache
         else:
             self._cache.clearChapterData()
             LOG_WARNING('Initial chapter not found in cache or bonuses is invalid', fromCache, chapter.getBonusID() if chapter is not None else None, bonusCompleted)
     if self._currentChapter is None:
         self._currentChapter = self._descriptor.getInitialChapterID(completed=bonusCompleted)
     if self._currentChapter is None:
         LOG_ERROR('Initial chapter not found. Tutorial is stopping')
         self.stop()
         return False
     else:
         return True