def GoLogin(self, username, password):
        sm.GetService('overviewPresetSvc')
        sm.GetService('viewState').ActivateView('login')
        user = username
        pwd = util.PasswordString(password)
        sm.GetService('loading').ProgressWnd(
            localization.GetByLabel('UI/Login/LoggingIn'),
            localization.GetByLabel('UI/Login/ConnectingToCluster'), 1, 100)
        blue.pyos.synchro.Yield()
        eve.Message('OnConnecting')
        blue.pyos.synchro.Yield()
        eve.Message('OnConnecting2')
        blue.pyos.synchro.Yield()
        serverName = util.GetServerName()
        eve.serverName = serverName
        server = login.GetServerIP(serverName)
        loginparam = [user, pwd, server, 26000, 0]
        try:
            sm.GetService('connection').Login(loginparam)
        except:
            raise

        sm.GetService('device').PrepareMain()
        blue.pyos.synchro.Yield()
        blue.pyos.synchro.Yield()
        blue.pyos.synchro.Yield()
        blue.pyos.synchro.Yield()
        sm.GetService('viewState').ActivateView('charsel')
Example #2
0
def GetServerInfo():
    serverName = util.GetServerName()
    ip = GetServerIP(serverName)
    servers = [['Tranquility', '87.237.38.200', '87.237.38.201'],
     ['Multiplicity', '87.237.38.51', '87.237.38.15'],
     ['Singularity', '87.237.38.50', '87.237.38.24'],
     ['Duality', '87.237.38.60', '87.237.38.61'],
     ['Chaos', '87.237.38.55', '87.237.38.71'],
     ['Buckingham', '87.237.38.69', '87.237.38.14'],
     ['Adam', 'Adam', 'Adam'],
     ['localhost', 'localhost', 'localhost']]
    foundServerInfo = False
    espUrl = ip
    for s in servers:
        if s[1] == ip:
            espUrl = s[2]
            serverName = s[0]
            foundServerInfo = True
            break

    if ':' not in espUrl:
        espUrl += ':50001'
    isLive = True
    if boot.region != 'optic' and ip != LIVE_SERVER:
        isLive = False
    try:
        inf = None
        import __builtin__
        if hasattr(__builtin__, 'sm') and 'machoNet' in sm.services:
            inf = sm.GetService('machoNet').GetGlobalConfig().get('serverInfo')
            if inf:
                lst = inf.split(',')
                if len(lst) != 4:
                    log.general.Log("Broken Server info in Global Config! It should contain 'serverName,ip,espIP:espPort,isLive'", log.LGERR)
                else:
                    l = lst[3]
                    if l.lower() == 'false':
                        l = 0
                    elif l.lower() == 'true':
                        l = 1
                    isLive = bool(int(l))
                    serverName = lst[0]
                    ip = lst[1]
                    foundServerInfo = True
                    espUrl = lst[2]
                    if ':' not in espUrl:
                        log.general.Log("Broken Server info in Global Config! ESP URL missing port. Full config should be 'serverName,ip,espIP:espPort,isLive'. Defaulting to port 50001", log.LGWARN)
                        espUrl += ':50001'
                    log.general.Log('Returning Server info from Global Config. serverName = %s, IP = %s, espUrl = %s, live = %s' % (serverName,
                     ip,
                     espUrl,
                     isLive))
            elif not foundServerInfo:
                log.general.Log('The server you are connected to, %s, does not supply serverInfo. This can be configured in globalconfig: serverInfo=serverName,ip,espIP:espPort,isLive' % ip)
    except Exception as e:
        log.general.Log('Could not get server info from server. Info: %s, Error: %s' % (inf, e), log.LGERR)

    serverInfo = util.KeyVal(name=serverName, IP=ip, espUrl=espUrl, isLive=isLive, version=getattr(eve, 'serverVersion', None), build=getattr(eve, 'serverBuild', None))
    return serverInfo
Example #3
0
 def Current(self, *args):
     server = util.GetServerName()
     user = sm.RemoteSvc('userSvc').GetUserName(eve.session.userid)
     character = cfg.eveowners.Get(eve.session.charid).name
     fields = [('serverip', server), ('username', user), ('userpass', ''),
               ('charname', character)]
     for entry, value in fields:
         a = getattr(self, entry)
         a.SetValue(value)
Example #4
0
 def LoginSso(self, token):
     if self.reentrancyGaurd:
         return
     self.reentrancyGaurd = 1
     try:
         if token is None:
             raise RuntimeError(
                 'Trying to do an SSO log in without an SSO token')
         response = self.ConnectSso(util.GetServerName(),
                                    util.GetServerPort(), token, 'tcp')
         return response
     finally:
         self.reentrancyGaurd = 0
Example #5
0
 def OnOpenView(self):
     memorySnapshot.AutoMemorySnapshotIfEnabled('Login_OnOpenView')
     self.Reset()
     uthread.worker('login::StatusTextWorker', self.__StatusTextWorker)
     blue.resMan.Wait()
     self.serverName = util.GetServerName()
     self.serverIP = GetServerIP(self.serverName)
     self.serverName = GetServerName(self.serverIP)
     self.serverPort = util.GetServerPort()
     self.firstCheck = True
     self.Layout()
     sm.ScatterEvent('OnClientReady', 'login')
     self.isopen = 1
     uthread.new(self.UpdateServerStatus)
     if bluepy.IsRunningStartupTest():
         uthread.new(self.TerminateStartupTestLater_t)
     sm.ScatterEvent('OnClientStageChanged', 'login')
Example #6
0
    def GetWebRequestParameters(self):
        details = {}
        try:
            details['n'] = boot.build
            details['s'] = util.GetServerName()
            details['u'] = settings.public.ui.Get('username', '')
            details['language_id'] = prefs.GetValue('languageID', 'EN')
            details['edition'] = getattr(boot, 'edition', 'classic')
            details['protocol'] = 2
            details['intended_platform'] = 'win'
            details['client_bitcount'] = 32
            details['client_fullversion'] = '%s.%s' % (boot.keyval['version'].split('=', 1)[1], boot.build)
            if not blue.win32.IsTransgaming():
                versionEx = blue.win32.GetVersionEx()
                details['actual_platform'] = 'win'
                details['platform_version'] = str(blue.os.osMajor) + '.' + str(blue.os.osMinor)
                details['platform_extra'] = str(versionEx.get('wServicePackMajor', 0))
                if versionEx.get('wProductType', 1) > 1:
                    details['platform_type'] = 'server'
                else:
                    details['platform_type'] = ['workstation', 'desktop'][versionEx.get('wSuiteMask', 512) & 512 > 0]
                if blue.win32.GetNativeSystemInfo().get('ProcessorArchitecture', '') == 'PROCESSOR_ARCHITECTURE_AMD64':
                    details['platform_bitcount'] = 64
                else:
                    details['platform_bitcount'] = 32
            else:
                versionEx = blue.win32.TGGetSystemInfo()
                details['actual_platform'] = ['mac', 'linux'][blue.win32.TGGetOS() == 'Linux']
                details['platform_type'] = versionEx.get('platform_type', 'desktop')
                details['platform_version'] = str(versionEx.get('platform_major_version', 0)) + '.' + str(versionEx.get('platform_minor_version', 0))
                details['platform_extra'] = versionEx.get('platform_extra', '0')
                details['platform_bitcount'] = versionEx.get('platform_bitcount', 32)
            cardName = ''
            ident = trinity.adapters.GetAdapterInfo(trinity.adapters.DEFAULT_ADAPTER)
            cardName = str(ident.description)
            cardName = cardName[0:64]
            details['card_name'] = cardName
            details['affiliate_id'] = self.GetClientAffiliateID()
        except:
            log.LogException(toAlertSvc=0)
            sys.exc_clear()

        queryString = urllib.urlencode(details)
        return queryString
Example #7
0
    def GetPatchInfo(self, userName = '', server = None):
        import hashlib
        hasher = hashlib.md5()
        hasher.update(userName)
        hasher.update(str(server))
        hasher.update(str(self.patchInfoUrl))
        parameterHash = hasher.hexdigest()
        if parameterHash in self.patchInfoResponses:
            return self.patchInfoResponses[parameterHash]
        if server == None:
            server = util.GetServerName()
        isTransgaming = blue.win32.IsTransgaming()
        details = util.KeyVal()
        details.protocolVersion = 2
        details.intendedPlatform = 'win'
        details.clientBitCount = 32
        details.clientFullVersion = '%s.%s' % (boot.keyval['version'].split('=', 1)[1], boot.build)
        if not isTransgaming:
            versionEx = blue.win32.GetVersionEx()
            details.actualPlatform = 'win'
            details.platformVersion = str(blue.os.osMajor) + '.' + str(blue.os.osMinor)
            details.platformExtra = str(versionEx.get('wServicePackMajor', 0))
            if versionEx.get('wProductType', 1) > 1:
                details.platformType = 'server'
            else:
                details.platformType = ['workstation', 'desktop'][versionEx.get('wSuiteMask', 512) & 512 > 0]
            if blue.win32.GetNativeSystemInfo().get('ProcessorArchitecture', '') == 'PROCESSOR_ARCHITECTURE_AMD64':
                details.platformBitCount = 64
            else:
                details.platformBitCount = 32
        else:
            versionEx = blue.win32.TGGetSystemInfo()
            details.actualPlatform = ['mac', 'linux'][blue.win32.TGGetOS() == 'Linux']
            details.platformType = versionEx.get('platform_type', 'desktop')
            details.platformVersion = str(versionEx.get('platform_major_version', 0)) + '.' + str(versionEx.get('platform_minor_version', 0))
            details.platformExtra = versionEx.get('platform_extra', '0')
            details.platformBitCount = versionEx.get('platform_bitcount', 32)
        self.clientVersion = int(boot.build)
        self.userName = userName
        if hasattr(boot, 'edition'):
            self.edition = boot.edition
        else:
            self.edition = 'classic'
        self.queryString = '?n=%s&u=%s&s=%s&protocol=%s&intended_platform=%s&client_bitcount=%s&actual_platform=%s&platform_type=%s&platform_version=%s&platform_extra=%s&platform_bitcount=%s&client_fullversion=%s&edition=%s'
        self.queryString = self.queryString % (boot.build,
         userName,
         server,
         details.protocolVersion,
         details.intendedPlatform,
         details.clientBitCount,
         details.actualPlatform,
         details.platformType,
         details.platformVersion,
         details.platformExtra,
         details.platformBitCount,
         details.clientFullVersion,
         self.edition)
        url = '%spatchinfo.asp%s' % (self.patchInfoUrl, self.queryString)
        opener = coreURLOpener()
        self.LogInfo('opening %s' % url)
        try:
            buf = opener.open(url).read()
        except IOError as e:
            raise UserError('PatchVersionCheckFailed', {'error': str(e)})

        self.patchInfoResponses[parameterHash] = buf
        return buf
Example #8
0
 def TryAutomaticLogin(self):
     if util.GetLoginCredentials() is None or session.userid is not None:
         return
     username, password = util.GetLoginCredentials()
     self.Login((username, password, util.GetServerName(),
                 util.GetServerPort(), None))