コード例 #1
0
 def setup(self, isNewbie, subscribeOnSettingsApplying=True):
     LOG_DEBUG_DEV_BOOTCAMP(
         'settingsCache version: ',
         self.settingsCore.serverSettings.settingsCache.getVersion())
     if isNewbie:
         self.settingsCore.serverSettings.setSectionSettings(
             SETTINGS_SECTIONS.BATTLE_EVENTS,
             {setting: True
              for _, setting in BATTLE_EVENTS.getIterator()})
         self.settingsCore.applySettings(
             self.__prepareSettings(GAME_SETTINGS_NEWBIE, True))
     else:
         self.settingsCore.applySettings(
             self.__prepareSettings(GAME_SETTINGS_COMMON, False))
     self.settingsCore.confirmChanges(
         self.settingsCore.applyStorages(restartApproved=False))
     self.settingsCore.clearStorages()
     if subscribeOnSettingsApplying:
         self.settingsCore.onSettingsApplied += self.__onSettingsApplied
コード例 #2
0
    def __setupPreferences(self, isNewbie):
        if isNewbie:
            self.settingsCore.serverSettings.setSectionSettings(
                SETTINGS_SECTIONS.BATTLE_EVENTS,
                {setting: True
                 for _, setting in BATTLE_EVENTS.getIterator()})
            settingsTemplate = GAME_SETTINGS_NEWBIE
        else:
            settingsTemplate = GAME_SETTINGS_COMMON
        settings = {}
        for k, v in settingsTemplate.iteritems():
            i = k.find(':')
            if i > -1:
                settings.setdefault(k[:i], {})[k[i + 1:]] = v
            settings[k] = v

        self.settingsCore.applySettings(settings)
        self.settingsCore.confirmChanges(
            self.settingsCore.applyStorages(restartApproved=False))
        self.settingsCore.clearStorages()
コード例 #3
0
ファイル: migrations.py プロジェクト: kusaku/wot_scripts
def _migrateTo26(core, data, initialized):
    from account_helpers.settings_core.ServerSettingsManager import SETTINGS_SECTIONS
    storedValue = _getSettingsCache().getSectionSettings(SETTINGS_SECTIONS.GAME_EXTENDED, 0)
    maskOffset = 1
    if (storedValue & maskOffset) >> 0:
        clear = data['clear']
        clear[SETTINGS_SECTIONS.GAME_EXTENDED] = clear.get(SETTINGS_SECTIONS.GAME_EXTENDED, 0) | maskOffset
    feedbackData = data.get('feedbackData', {})
    feedbackData[DAMAGE_INDICATOR.TYPE] = 1
    feedbackData[DAMAGE_INDICATOR.PRESETS] = 0
    feedbackData[DAMAGE_INDICATOR.DAMAGE_VALUE] = True
    feedbackData[DAMAGE_INDICATOR.VEHICLE_INFO] = True
    feedbackData[DAMAGE_INDICATOR.ANIMATION] = True
    feedbackData[DAMAGE_LOG.TOTAL_DAMAGE] = True
    feedbackData[DAMAGE_LOG.BLOCKED_DAMAGE] = True
    feedbackData[DAMAGE_LOG.ASSIST_DAMAGE] = True
    feedbackData[DAMAGE_LOG.SHOW_DETAILS] = 2
    for key in BATTLE_EVENTS.ALL():
        feedbackData[key] = True

    data['feedbackData'] = feedbackData