Example #1
0
def modelsCheck(callback):
    global clientIsNew, skinsModelsMissing, needToReReadSkinsModels
    lastVersion = g_config.skinsCache['version']
    if lastVersion:
        if getClientVersion() == lastVersion:
            clientIsNew = False
        else:
            print g_config.ID + ': skins client version changed'
    else:
        print g_config.ID + ': skins client version cache not found'

    if os.path.isdir(modelsDir):
        if len(glob.glob(modelsDir + '*')):
            skinsModelsMissing = False
        else:
            print g_config.ID + ': skins models dir is empty'
    else:
        print g_config.ID + ': skins models dir not found'
    found = bool(g_config.skinsData['models'])
    needToReReadSkinsModels = found and (clientIsNew or skinsModelsMissing
                                         or texReplaced)
    if found and clientIsNew:
        if os.path.isdir(modelsDir):
            yield rmtree(modelsDir)
        g_config.skinsCache['version'] = getClientVersion()
    if found and not os.path.isdir(modelsDir):
        os.makedirs(modelsDir)
    elif not found and os.path.isdir(modelsDir):
        print g_config.ID + ': no skins found, deleting', modelsDir
        yield rmtree(modelsDir)
    elif texReplaced and os.path.isdir(modelsDir):
        yield rmtree(modelsDir)
        os.makedirs(modelsDir)
    BigWorld.callback(0, callback)
Example #2
0
def modelsCheck(callback):
    global clientIsNew, skinsModelsMissing, needToReReadSkinsModels
    lastVersion = g_config.skinsCache['version']
    if lastVersion:
        if getClientVersion() == lastVersion:
            clientIsNew = False
        else:
            print g_config.ID + ': skins client version changed'
    else:
        print g_config.ID + ': skins client version cache not found'

    if os.path.isdir(modelsDir):
        if len(glob.glob(modelsDir + '*')):
            skinsModelsMissing = False
        else:
            print g_config.ID + ': skins models dir is empty'
    else:
        print g_config.ID + ': skins models dir not found'
    needToReReadSkinsModels = g_config.skinsData['found'] and (
        clientIsNew or skinsModelsMissing or texReplaced)
    if g_config.skinsData['found'] and clientIsNew:
        if os.path.isdir(modelsDir):
            yield rmtree(modelsDir)
        g_config.skinsCache['version'] = getClientVersion()
    if g_config.skinsData['found'] and not os.path.isdir(modelsDir):
        os.makedirs(modelsDir)
    elif not g_config.skinsData['found'] and os.path.isdir(modelsDir):
        print g_config.ID + ': no skins found, deleting', modelsDir
        yield rmtree(modelsDir)
    elif texReplaced and os.path.isdir(modelsDir):
        yield rmtree(modelsDir)
        os.makedirs(modelsDir)
    PYmodsCore.loadJson(g_config.ID, 'skinsCache', g_config.skinsCache,
                        g_config.configPath, True)
    BigWorld.callback(0.0, partial(callback, True))
Example #3
0
 def showPatchPromo(self, isAsync=False):
     self.__currentVersionBrowserID = yield self.__showPromoBrowser(
         self.__currentVersionPromoUrl,
         i18n.makeString(MENU.PROMO_PATCH_TITLE,
                         version=getClientVersion()),
         browserID=self.__currentVersionBrowserID,
         isAsync=isAsync)
Example #4
0
 def __init__(self, component = None):
     Flash.__init__(self, 'gameLoading.swf', path=SCALEFORM_SWF_PATH_V3)
     self._displayRoot = self.getMember('root.main')
     if self._displayRoot is not None:
         self._displayRoot.resync()
         self._displayRoot.setLocale(getClientOverride())
         self._displayRoot.setVersion(getClientVersion())
         width, height = GUI.screenResolution()
         self._displayRoot.updateStage(width, height)
Example #5
0
 def __init__(self, component=None):
     Flash.__init__(self, 'gameLoading.swf', path=SCALEFORM_SWF_PATH_V3)
     self._displayRoot = self.getMember('root.main')
     if self._displayRoot is not None:
         self._displayRoot.resync()
         self._displayRoot.setLocale(getClientOverride())
         self._displayRoot.setVersion(getClientVersion())
         width, height = GUI.screenResolution()
         self._displayRoot.updateStage(width, height)
     return
Example #6
0
def _getVersionMessage():
    return {'message': '{0} {1}'.format(text_styles.main(i18n.makeString(MENU.PROMO_PATCH_MESSAGE)), text_styles.stats(getClientVersion())),
     'label': i18n.makeString(MENU.PROMO_TOARCHIVE),
     'promoEnabel': game_control.g_instance.promo.isPatchPromoAvailable(),
     'tooltip': TOOLTIPS.LOBBYMENU_VERSIONINFOBUTTON}
 def showPatchPromo(self, isAsync = False):
     self.__currentVersionBrowserID = yield self.__showPromoBrowser(self.__currentVersionPromoUrl, i18n.makeString(MENU.PROMO_PATCH_TITLE, version=getClientVersion()), browserID=self.__currentVersionBrowserID, isAsync=isAsync)
Example #8
0
def _getVersionMessage():
    return {'message': '{0} {1}'.format(text_styles.main(i18n.makeString(MENU.PROMO_PATCH_MESSAGE)), text_styles.stats(getClientVersion())),
     'label': i18n.makeString(MENU.PROMO_TOARCHIVE),
     'promoEnabel': game_control.g_instance.promo.isPatchPromoAvailable(),
     'tooltip': TOOLTIPS.LOBBYMENU_VERSIONINFOBUTTON}
Example #9
0
 def load_info(self):
     self.configs = ['/'.join([self.path, self.appFile])]
     print '[NOTE] Loading mod: %s, [v.%s WOT: %s] by %s' % (
         self.appName, self.version, getClientVersion(), self.author)
     print '-------------------------------------------------------------------------'
Example #10
0
import threading
import helpers
import BigWorld
import ResMgr
import feedparser
from debug_utils import *
_CLIENT_VERSION = helpers.getClientVersion()
feedparser.PARSE_MICROFORMATS = 0
feedparser.SANITIZE_HTML = 0


class RSSDownloader:
    UPDATE_INTERVAL = 0.1
    MIN_INTERVAL_BETWEEN_DOWNLOAD = 60.0
    lastRSS = property(lambda self: self.__lastRSS)
    isBusy = property(lambda self: self.__thread is not None)

    def __init__(self):
        self.url = ''
        ds = ResMgr.openSection('gui/gui_settings.xml')
        if ds is not None:
            self.url = ds.readString('rssUrl')
        self.__thread = None
        self.__lastDownloadTime = 0
        self.__cbID = BigWorld.callback(self.UPDATE_INTERVAL, self.__update)
        self.__lastRSS = {}
        self.__onCompleteCallbacks = set()
        return

    def destroy(self):
        self.__thread = None
def getClientBuildVersion():
    return getClientVersion(force=False)
import cPickle
import BigWorld
import binascii
import threading
import BigWorld
from debug_utils import *
from functools import partial
from helpers import getClientVersion
from Queue import Queue
import shelve as provider
import random
_MIN_LIFE_TIME = 15 * 60
_MAX_LIFE_TIME = 24 * 60 * 60
_LIFE_TIME_IN_MEMORY = 20 * 60
_CACHE_VERSION = 2
_CLIENT_VERSION = getClientVersion()

def _LOG_EXECUTING_TIME(startTime, methodName, deltaTime = 0.1):
    finishTime = time.time()
    if finishTime - startTime > deltaTime:
        LOG_WARNING('Method "%s" takes too much time %s' % (methodName, finishTime - startTime))


def parseHttpTime(t):
    if t is None:
        return
    elif type(t) == int:
        return t
    else:
        if type(t) == str:
            try:
Example #13
0
 def getSettings(self, _):
     return {'client_version': helpers.getClientVersion(),
      'ui_spam_mode': self._MODE_HIDE_COUNTERS if self._uiSpamController.shouldBeHidden(VIEW_ALIAS.LOBBY_STORE) else ''}
Example #14
0
 def __getPatchPromoMessage(self):
     if game_control.g_instance.promo.isPatchPromoAvailable():
         return i18n.makeString(MENU.PROMO_PATCH_MESSAGE, version=getClientVersion())
     else:
         return None
Example #15
0
 def getSettings(self, _):
     return {'client_version': helpers.getClientVersion()}
Example #16
0
import threading
import helpers
import BigWorld
import ResMgr
import feedparser
from debug_utils import *
_CLIENT_VERSION = helpers.getClientVersion()
feedparser.PARSE_MICROFORMATS = 0
feedparser.SANITIZE_HTML = 0

class RSSDownloader:
    UPDATE_INTERVAL = 0.1
    MIN_INTERVAL_BETWEEN_DOWNLOAD = 60.0
    lastRSS = property(lambda self: self.__lastRSS)
    isBusy = property(lambda self: self.__thread is not None)

    def __init__(self):
        self.url = ''
        ds = ResMgr.openSection('gui/gui_settings.xml')
        if ds is not None:
            self.url = ds.readString('rssUrl')
        self.__thread = None
        self.__lastDownloadTime = 0
        self.__cbID = BigWorld.callback(self.UPDATE_INTERVAL, self.__update)
        self.__lastRSS = {}
        self.__onCompleteCallbacks = set()
        return

    def destroy(self):
        self.__thread = None
        self.__onCompleteCallbacks = None