コード例 #1
0
ファイル: __init__.py プロジェクト: webiumsk/WOT-0.9.12-CT
 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
ファイル: __init__.py プロジェクト: 19colt87/WOTDecompiled
 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