def getStatistics(self, andStop=True): proceed = self.__state == _STATISTICS_STATE.IN_PROGRESS ret = {} if proceed: ret = BigWorld.wg_getClientStatistics() proceed = ret is not None if proceed: ret['cpuScore'] = BigWorld.getAutoDetectGraphicsSettingsScore( _HARDWARE_SCORE_PARAMS.PARAM_CPU_SCORE) ret['gpuScore'] = BigWorld.getAutoDetectGraphicsSettingsScore( _HARDWARE_SCORE_PARAMS.PARAM_GPU_SCORE) ret['ping'] = int(math.ceil(self.avrPing)) ret['lag'] = self.lagPercentage ret['graphicsEngine'] = SettingsCore.g_settingsCore.getSetting( GRAPHICS.RENDER_PIPELINE) if not self.__hangarLoaded: self.__invalidStats |= INVALID_CLIENT_STATS.CLIENT_STRAIGHT_INTO_BATTLE ret['graphicsPreset'] = SettingsCore.g_settingsCore.getSetting( GRAPHICS.PRESETS) windowMode = SettingsCore.g_settingsCore.getSetting( GRAPHICS.FULLSCREEN) ret['windowMode'] = 1 if windowMode else 0 resolutionContainer = graphics.g_monitorSettings.currentVideoMode if windowMode else graphics.g_monitorSettings.currentWindowSize ret['screenResWidth'] = resolutionContainer.width ret['screenResHeight'] = resolutionContainer.height ret['drrScale'] = int(round(BigWorld.getDRRScale() * 100)) ret['dynamicDRR'] = BigWorld.isDRRAutoscalingEnabled() ret['invalidStats'] |= self.__invalidStats ret['contentType'] = ResMgr.activeContentType() ret['soundQuality'] = Settings.g_instance.userPrefs[ Settings.KEY_SOUND_PREFERENCES].readInt('LQ_render', 0) ret['hangarLoadingTime'] = self.__hangarLoadingTime if andStop is True or not proceed: self.stop() return ret
def configure_state(): content_type = ResMgr.activeContentType() if content_type == CONTENT_TYPE.SANDBOX: config = _get_config(content_type) _shop.OnShopItemWrapPointcut(config) _continue_download.OnHyperlinkClickPointcut() _continue_download.OnSquadHyperlinkClickPointcut() _continue_download.PrepareLibrariesListPointcut() _continue_download.OnBrowserHyperlinkClickPointcut() _continue_download.OnFailLoadingFramePointcut() _contacts.CreateSquadPointcut() _configure_lobby_pointcuts(config) _configure_login_pointcuts() _notifications_configure_pointcuts() _configure_fort_pointcuts() _configure_tech_tree_pointcuts(config) _configure_invitation_pointcuts() _configure_personal_quests_pointcuts() _dynamic_squads.ParametrizeInitPointcut() _dynamic_squads.DisableGameSettingPointcut() _dynamic_squads.InviteReceivedMessagePointcut() _promo_controller.ShowPromoBrowserPointcut() _fallout_controller.InitFalloutPointcut() _event.InitEventPointcut() _preview.ChangeVehicleIsPreviewAllowed(config)
def getStatistics(self, andStop = True): proceed = self.__state == _STATISTICS_STATE.IN_PROGRESS ret = {} if proceed: ret = BigWorld.wg_getClientStatistics() proceed = ret is not None if proceed: ret['cpuScore'] = BigWorld.getAutoDetectGraphicsSettingsScore(_HARDWARE_SCORE_PARAMS.PARAM_CPU_SCORE) ret['gpuScore'] = BigWorld.getAutoDetectGraphicsSettingsScore(_HARDWARE_SCORE_PARAMS.PARAM_GPU_SCORE) ret['ping'] = int(math.ceil(self.avrPing)) ret['lag'] = self.lagPercentage ret['graphicsEngine'] = SettingsCore.g_settingsCore.getSetting(GRAPHICS.RENDER_PIPELINE) if not self.__hangarLoaded: self.__invalidStats |= INVALID_CLIENT_STATS.CLIENT_STRAIGHT_INTO_BATTLE ret['graphicsPreset'] = SettingsCore.g_settingsCore.getSetting(GRAPHICS.PRESETS) windowMode = SettingsCore.g_settingsCore.getSetting(GRAPHICS.FULLSCREEN) ret['windowMode'] = 1 if windowMode else 0 resolutionContainer = graphics.g_monitorSettings.currentVideoMode if windowMode else graphics.g_monitorSettings.currentWindowSize ret['screenResWidth'] = resolutionContainer.width ret['screenResHeight'] = resolutionContainer.height ret['drrScale'] = int(round(BigWorld.getDRRScale() * 100)) ret['dynamicDRR'] = BigWorld.isDRRAutoscalingEnabled() ret['invalidStats'] |= self.__invalidStats ret['contentType'] = ResMgr.activeContentType() if andStop is True or not proceed: self.stop() return ret
def getStatistics(self, andStop=True): proceed = self.__state == _STATISTICS_STATE.IN_PROGRESS ret = {} if proceed: ret = BigWorld.wg_getClientStatistics() proceed = ret is not None if proceed: ret["cpuScore"] = BigWorld.getAutoDetectGraphicsSettingsScore(_HARDWARE_SCORE_PARAMS.PARAM_CPU_SCORE) ret["gpuScore"] = BigWorld.getAutoDetectGraphicsSettingsScore(_HARDWARE_SCORE_PARAMS.PARAM_GPU_SCORE) ret["graphicsEngine"] = SettingsCore.g_settingsCore.getSetting(GRAPHICS.RENDER_PIPELINE) if not self.__hangarLoaded: self.__invalidStats |= INVALID_CLIENT_STATS.CLIENT_STRAIGHT_INTO_BATTLE ret["graphicsPreset"] = SettingsCore.g_settingsCore.getSetting(GRAPHICS.PRESETS) windowMode = SettingsCore.g_settingsCore.getSetting(GRAPHICS.FULLSCREEN) ret["windowMode"] = 1 if windowMode else 0 resolutionContainer = ( graphics.g_monitorSettings.currentVideoMode if windowMode else graphics.g_monitorSettings.currentWindowSize ) ret["screenResWidth"] = resolutionContainer.width ret["screenResHeight"] = resolutionContainer.height ret["drrScale"] = int(round(BigWorld.getDRRScale() * 100)) ret["dynamicDRR"] = BigWorld.isDRRAutoscalingEnabled() ret["invalidStats"] |= self.__invalidStats ret["contentType"] = ResMgr.activeContentType() ret["soundQuality"] = Settings.g_instance.userPrefs[Settings.KEY_SOUND_PREFERENCES].readInt( "LQ_render", 0 ) ret["hangarLoadingTime"] = self.__hangarLoadingTime if andStop is True or not proceed: self.stop() return ret
def checkClientServerVersions(self, clientVersion, serverVersion): if not isValidClientVersion(clientVersion, serverVersion) or ResMgr.activeContentType( ) in (constants.CONTENT_TYPE.INCOMPLETE, constants.CONTENT_TYPE.TUTORIAL): LOG_DEBUG('Version mismatch. Client is "%s", server needs "%s".' % (clientVersion, serverVersion)) self.onRejected(LOGIN_STATUS.LOGIN_BAD_PROTOCOL_VERSION, {}) BigWorld.disconnect()
def configure_state(): content_type = ResMgr.activeContentType() is_sandbox = IS_SANDBOX is_tutorial = content_type == CONTENT_TYPE.TUTORIAL is_miniclient = content_type == CONTENT_TYPE.SANDBOX config = _get_config(is_miniclient, is_tutorial, is_sandbox) if is_sandbox: _enable_sandbox_platform_pointcuts(config) elif is_miniclient: _enable_all_pointcuts(config)
def __getSystemData(self, statisticsDict): return { 'isLaptop': statisticsDict['isLaptop'], 'cpuVendor': statisticsDict['cpuVendor'], 'cpuCores': statisticsDict['cpuCores'], 'cpuFreq': statisticsDict['cpuFreq'], 'gpuVendor': statisticsDict['gpuVendor'], 'gpuMemory': statisticsDict['gpuMemory'], 'mainMemory': statisticsDict['mainMemory'], 'os': statisticsDict['os'], 'graphicsEngine': self.settingsCore.getSetting(GRAPHICS.RENDER_PIPELINE), 'cpuScore': BigWorld.getAutoDetectGraphicsSettingsScore( HARDWARE_SCORE_PARAMS.PARAM_CPU_SCORE), 'gpuScore': BigWorld.getAutoDetectGraphicsSettingsScore( HARDWARE_SCORE_PARAMS.PARAM_GPU_SCORE), 'osBit': statisticsDict['osBit'], 'hasMods': statisticsDict['hasMods'], 'cpuFamily': statisticsDict['cpuFamily'], 'gpuFamily': statisticsDict['gpuFamily'], 'crashed': statisticsDict['crashed'], 'contentType': ResMgr.activeContentType(), 'gpuDriverVersion': statisticsDict['gpuDriverVersion'], 'graphicsAPIID': statisticsDict['graphicsAPIID'], 'multiGPU': statisticsDict['multiGPU'], 'cpuName': statisticsDict['cpuName'], 'hangarFirstLoadingTime': self.__hangarLoadingTime }
def checkClientServerVersions(self, clientVersion, serverVersion): if not isValidClientVersion(clientVersion, serverVersion) or ResMgr.activeContentType() in (constants.CONTENT_TYPE.INCOMPLETE, constants.CONTENT_TYPE.TUTORIAL): LOG_DEBUG('Version mismatch. Client is "%s", server needs "%s".' % (clientVersion, serverVersion)) self.onRejected(LOGIN_STATUS.LOGIN_BAD_PROTOCOL_VERSION, {}) BigWorld.disconnect()
def isUpdateClientSoftwareNeeded(self): return ResMgr.activeContentType() in (3, 4) or self.__rawStatus in ( 'LOGIN_BAD_PROTOCOL_VERSION', 'LOGIN_REJECTED_BAD_DIGEST')
def isUpdateClientSoftwareNeeded(self): return ResMgr.activeContentType() in (3, 4) or self.__rawStatus in ('LOGIN_BAD_PROTOCOL_VERSION', 'LOGIN_REJECTED_BAD_DIGEST')