def _migrateTo23(core, data, initialized):
    from account_helpers.settings_core.ServerSettingsManager import SETTINGS_SECTIONS
    storedValue = g_settingsCache.getSectionSettings(SETTINGS_SECTIONS.GAME, 0)
    settingOffset = 1610612736
    currentValue = (storedValue & settingOffset) >> 29
    if currentValue == 0:
        data['gameData'][GAME.SHOW_VEH_MODELS_ON_MAP] = 2
 def _getSectionSettings(self, section, key, default = None):
     storedValue = g_settingsCache.getSectionSettings(section, None)
     masks = self.SECTIONS[section].masks
     offsets = self.SECTIONS[section].offsets
     if storedValue is not None:
         return self._extractValue(key, storedValue, default, masks, offsets)
     return default
 def _buildSectionSettings(self, section, settings):
     storedValue = g_settingsCache.getSectionSettings(section, None)
     storingValue = storedValue if storedValue is not None else 0
     sectionMasks = self.SECTIONS[section]
     masks = sectionMasks.masks
     offsets = sectionMasks.offsets
     return self._mapValues(settings, storingValue, masks, offsets)
def _migrateTo23(core, data, initialized):
    from account_helpers.settings_core.ServerSettingsManager import SETTINGS_SECTIONS
    storedValue = g_settingsCache.getSectionSettings(SETTINGS_SECTIONS.GAME, 0)
    settingOffset = 1610612736
    currentValue = (storedValue & settingOffset) >> 29
    if currentValue == 0:
        data['gameData'][GAME.SHOW_VEH_MODELS_ON_MAP] = 2
 def _buildSectionSettings(self, section, settings):
     storedValue = g_settingsCache.getSectionSettings(section, None)
     storingValue = storedValue if storedValue is not None else 0
     sectionMasks = self.SECTIONS[section]
     masks = sectionMasks.masks
     offsets = sectionMasks.offsets
     return self._mapValues(settings, storingValue, masks, offsets)
Exemple #6
0
 def getSectionSettings(self, section, key, default = None):
     storedValue = g_settingsCache.getSectionSettings(section, None)
     masks = self.SECTIONS[section].masks
     offsets = self.SECTIONS[section].offsets
     if storedValue is not None:
         return self._extractValue(key, storedValue, default, masks, offsets)
     else:
         return default
 def getMarkersSetting(self, section, key, default = None):
     storageKey = 'MARKERS_%(section)s' % {'section': section.upper()}
     storedValue = g_settingsCache.getSectionSettings(storageKey, None)
     masks = self.SECTIONS[SETTINGS_SECTIONS.MARKERS].masks
     offsets = self.SECTIONS[SETTINGS_SECTIONS.MARKERS].offsets
     if storedValue is not None:
         return self._extractValue(key, storedValue, default, masks, offsets)
     return default
Exemple #8
0
def _migrateTo4(core, data, initialized):
    gameData = data['gameData']
    from account_helpers.settings_core.ServerSettingsManager import SETTINGS_SECTIONS
    storedValue = g_settingsCache.getSectionSettings(SETTINGS_SECTIONS.GAME, 0)
    if storedValue & 128:
        gameData[GAME.REPLAY_ENABLED] = 2
    else:
        gameData[GAME.REPLAY_ENABLED] = 0
def _migrateTo4(core, data, initialized):
    gameData = data['gameData']
    from account_helpers.settings_core.ServerSettingsManager import SETTINGS_SECTIONS
    storedValue = g_settingsCache.getSectionSettings(SETTINGS_SECTIONS.GAME, 0)
    if storedValue & 128:
        gameData[GAME.REPLAY_ENABLED] = 2
    else:
        gameData[GAME.REPLAY_ENABLED] = 0
Exemple #10
0
 def getMarkersSetting(self, section, key, default = None):
     storageKey = 'MARKERS_%(section)s' % {'section': section.upper()}
     storedValue = g_settingsCache.getSectionSettings(storageKey, None)
     masks = self.SECTIONS[SETTINGS_SECTIONS.MARKERS].masks
     offsets = self.SECTIONS[SETTINGS_SECTIONS.MARKERS].offsets
     if storedValue is not None:
         return self._extractValue(key, storedValue, default, masks, offsets)
     else:
         return default
 def _setSectionSettings(self, section, settings):
     storedValue = g_settingsCache.getSectionSettings(section, None)
     storingValue = self._buildSectionSettings(section, settings)
     if storedValue == storingValue:
         return
     LOG_DEBUG('Applying %s server settings: ' % section, settings)
     g_settingsCache.setSectionSettings(section, storingValue)
     self.setVersion()
     self._core.onSettingsChanged(settings)
Exemple #12
0
 def _setSectionSettings(self, section, settings):
     storedValue = g_settingsCache.getSectionSettings(section, None)
     storingValue = self._buildSectionSettings(section, settings)
     if storedValue == storingValue:
         return
     LOG_DEBUG('Applying %s server settings: ' % section, settings)
     g_settingsCache.setSectionSettings(section, storingValue)
     self.setVersion()
     self._core.onSettingsChanged(settings)
def _migrateTo18(core, data, initialized):
    from account_helpers.settings_core.ServerSettingsManager import SETTINGS_SECTIONS
    from constants import QUEUE_TYPE
    storedValue = g_settingsCache.getSectionSettings(SETTINGS_SECTIONS.FALLOUT, 0)
    currentType = storedValue & 3
    if currentType > 0:
        oldTypeToNewType = {1: QUEUE_TYPE.FALLOUT_CLASSIC,
         2: QUEUE_TYPE.FALLOUT_MULTITEAM}
        newType = oldTypeToNewType.get(currentType, QUEUE_TYPE.UNKNOWN)
        data['fallout']['falloutBattleType'] = newType
def _migrateTo6(core, data, initialized):
    from account_helpers.settings_core.ServerSettingsManager import SETTINGS_SECTIONS
    storedValue = g_settingsCache.getSectionSettings(SETTINGS_SECTIONS.GAME, 0)
    maskOffset = 7168
    currentMask = (storedValue & maskOffset) >> 10
    import ArenaType
    newMask = currentMask | ArenaType.getVisibilityMask(ArenaType.getGameplayIDForName('nations'))
    data['gameplayData'][GAME.GAMEPLAY_MASK] = newMask
    clear = data['clear']
    clear[SETTINGS_SECTIONS.GAME] = clear.get(SETTINGS_SECTIONS.GAME, 0) | maskOffset
 def getAimSetting(self, section, key, default = None):
     number = self.AIM_MAPPING[key]
     storageKey = 'AIM_%(section)s_%(number)d' % {'section': section.upper(),
      'number': number}
     settingsKey = 'AIM_%(number)d' % {'number': number}
     storedValue = g_settingsCache.getSectionSettings(storageKey, None)
     masks = self.SECTIONS[settingsKey].masks
     offsets = self.SECTIONS[settingsKey].offsets
     if storedValue is not None:
         return self._extractValue(key, storedValue, default, masks, offsets)
     return default
Exemple #16
0
def _migrateTo6(core, data, initialized):
    from account_helpers.settings_core.ServerSettingsManager import SETTINGS_SECTIONS
    storedValue = g_settingsCache.getSectionSettings(SETTINGS_SECTIONS.GAME, 0)
    maskOffset = 7168
    currentMask = (storedValue & maskOffset) >> 10
    import ArenaType
    newMask = currentMask | ArenaType.getVisibilityMask(
        ArenaType.getGameplayIDForName('nations'))
    data['gameplayData'][GAME.GAMEPLAY_MASK] = newMask
    clear = data['clear']
    clear[SETTINGS_SECTIONS.GAME] = clear.get(SETTINGS_SECTIONS.GAME,
                                              0) | maskOffset
Exemple #17
0
 def getAimSetting(self, section, key, default = None):
     number = self.AIM_MAPPING[key]
     storageKey = 'AIM_%(section)s_%(number)d' % {'section': section.upper(),
      'number': number}
     settingsKey = 'AIM_%(number)d' % {'number': number}
     storedValue = g_settingsCache.getSectionSettings(storageKey, None)
     masks = self.SECTIONS[settingsKey].masks
     offsets = self.SECTIONS[settingsKey].offsets
     if storedValue is not None:
         return self._extractValue(key, storedValue, default, masks, offsets)
     else:
         return default
def _migrateTo18(core, data, initialized):
    from account_helpers.settings_core.ServerSettingsManager import SETTINGS_SECTIONS
    from constants import QUEUE_TYPE
    storedValue = g_settingsCache.getSectionSettings(SETTINGS_SECTIONS.FALLOUT,
                                                     0)
    currentType = storedValue & 3
    if currentType > 0:
        oldTypeToNewType = {
            1: QUEUE_TYPE.FALLOUT_CLASSIC,
            2: QUEUE_TYPE.FALLOUT_MULTITEAM
        }
        newType = oldTypeToNewType.get(currentType, QUEUE_TYPE.UNKNOWN)
        data['fallout']['falloutBattleType'] = newType
    def setSectionSettings(self, section, settings):
        storedSettings = self.getSection(section)
        storedValue = g_settingsCache.getSectionSettings(section, None)
        storingValue = self._buildSectionSettings(section, settings)
        if storedValue == storingValue:
            return
        else:
            g_settingsCache.setSectionSettings(section, storingValue)
            settingsDiff = {}
            for k, v in settings.iteritems():
                sV = storedSettings.get(k)
                if sV != v:
                    settingsDiff[k] = v

            LOG_DEBUG('Applying %s server settings: ' % section, settingsDiff)
            self._core.onSettingsChanged(settingsDiff)
            return
    def setSectionSettings(self, section, settings):
        storedSettings = self.getSection(section)
        storedValue = g_settingsCache.getSectionSettings(section, None)
        storingValue = self._buildSectionSettings(section, settings)
        if storedValue == storingValue:
            return
        else:
            g_settingsCache.setSectionSettings(section, storingValue)
            settingsDiff = {}
            for k, v in settings.iteritems():
                sV = storedSettings.get(k)
                if sV != v:
                    settingsDiff[k] = v

            LOG_DEBUG('Applying %s server settings: ' % section, settingsDiff)
            self._core.onSettingsChanged(settingsDiff)
            return
def _migrateTo26(core, data, initialized):
    from account_helpers.settings_core.ServerSettingsManager import SETTINGS_SECTIONS
    storedValue = g_settingsCache.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
def _migrateTo26(core, data, initialized):
    from account_helpers.settings_core.ServerSettingsManager import SETTINGS_SECTIONS
    storedValue = g_settingsCache.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