def onLogin(self, user, password, host, hdlr, isSocialToken2Login = False):
     self.__onLoggingTryingEndHdlr = hdlr
     self.__kickedFromServer = False
     self.__kickPeripheryID = None
     if self.__closeCallbackId:
         BigWorld.cancelCallback(self.__closeCallbackId)
         self.__closeCallbackId = None
     if not isSocialToken2Login:
         if not self.__validateCredentials(user.lower().strip(), password.strip()):
             self.__onLoggingTryingEndHdlr()
             return
     Waiting.show('login')
     self.__loginDataLoader.host = host
     self.__loginDataLoader.user = user
     self.__loginDataLoader.passLength = len(password)
     self.__loginDataLoader.saveUserConfig(user, self.__loginDataLoader.host)
     password = pwd_token.generate(password)
     if len(self.__loginDataLoader.token2):
         password = ''
     token2 = self.__loginDataLoader.token2
     if AUTO_LOGIN_QUERY_URL == host:
         g_preDefinedHosts.autoLoginQuery(lambda host: connectionManager.connect(getHostURL(host, token2), user, password, host.keyPath, nickName=None, token2=token2, isNeedSavingPwd=self.__loginDataLoader.rememberPwd))
         return
     else:
         host = g_preDefinedHosts.byUrl(host)
         connectionManager.connect(getHostURL(host, token2, True), user, password, host.keyPath, nickName=None, token2=token2, isNeedSavingPwd=self.__loginDataLoader.rememberPwd)
         return
Beispiel #2
0
 def __doConnect(self):
     login, token2 = self.__credentials
     self.__addHandlers()
     connectionManager.connect(getHostURL(self.__host, token2),
                               login,
                               '',
                               self.__host.keyPath,
                               token2=token2)
 def __doConnect(self):
     if not self.__wgcLogin:
         login, token2 = self.__credentials
     else:
         login = '******'
         token2 = ''
     self.__addHandlers()
     self.loginManager.initiateRelogin(login, token2,
                                       getHostURL(self.__host, token2))
Beispiel #4
0
 def onLogin(self, user, password, host, hdlr, isSocialToken2Login=False):
     self.__onLoggingTryingEndHdlr = hdlr
     self.__kickedFromServer = False
     self.__kickPeripheryID = None
     if self.__closeCallbackId:
         BigWorld.cancelCallback(self.__closeCallbackId)
         self.__closeCallbackId = None
     if not isSocialToken2Login:
         if not self.__validateCredentials(user.lower().strip(),
                                           password.strip()):
             self.__onLoggingTryingEndHdlr()
             return
     Waiting.show('login')
     self.__loginDataLoader.host = host
     self.__loginDataLoader.user = user
     self.__loginDataLoader.passLength = len(password)
     self.__loginDataLoader.saveUserConfig(user,
                                           self.__loginDataLoader.host)
     password = pwd_token.generate(password)
     if len(self.__loginDataLoader.token2):
         password = ''
     token2 = self.__loginDataLoader.token2
     if AUTO_LOGIN_QUERY_URL == host:
         g_preDefinedHosts.autoLoginQuery(
             lambda host: connectionManager.connect(
                 getHostURL(host, token2),
                 user,
                 password,
                 host.keyPath,
                 nickName=None,
                 token2=token2,
                 isNeedSavingPwd=self.__loginDataLoader.rememberPwd))
         return
     host = g_preDefinedHosts.byUrl(host)
     connectionManager.connect(
         getHostURL(host, token2, True),
         user,
         password,
         host.keyPath,
         nickName=None,
         token2=token2,
         isNeedSavingPwd=self.__loginDataLoader.rememberPwd)
 def onLogin(self, user, password, host, hdlr):
     self.__onLoggingTryingEndHdlr = hdlr
     self.__kickedFromServer = False
     self.__kickPeripheryID = None
     if self.__closeCallbackId:
         BigWorld.cancelCallback(self.__closeCallbackId)
         self.__closeCallbackId = None
     if g_steamAccount.isValid:
         user, password = g_steamAccount.getCredentials()
     else:
         user = user.lower().strip()
         if len(user) < _LOGIN_NAME_MIN_LENGTH:
             self.onSetStatus(i18n.makeString(MENU.LOGIN_STATUS_INVALID_LOGIN_LENGTH) % {'count': _LOGIN_NAME_MIN_LENGTH}, self.LOGIN_INVALID)
             return
         if not isAccountLoginValid(user) and not constants.IS_DEVELOPMENT:
             self.onSetStatus(i18n.makeString(MENU.LOGIN_STATUS_INVALID_LOGIN), self.LOGIN_INVALID)
             return
         password = password.strip()
         if not isPasswordValid(password) and not constants.IS_DEVELOPMENT and not len(self.__loginDataLoader.token2):
             self.onSetStatus(i18n.makeString(MENU.LOGIN_STATUS_INVALID_PASSWORD), self.LOGIN_PWD_INVALID)
             return
     Waiting.show('login')
     self.__loginDataLoader.host = host
     self.__loginDataLoader.user = user
     self.__loginDataLoader.passLength = len(password)
     if constants.IS_VIETNAM:
         self.__pass = password
     self.__loginDataLoader.saveUserConfig(user, self.__loginDataLoader.host)
     password = pwd_token.generate(password)
     if len(self.__loginDataLoader.token2):
         password = ''
     token2 = self.__loginDataLoader.token2
     if AUTO_LOGIN_QUERY_URL == host:
         g_preDefinedHosts.autoLoginQuery(lambda host: connectionManager.connect(getHostURL(host, token2), user, password, host.keyPath, nickName=None, token2=token2, isNeedSavingPwd=self.__loginDataLoader.rememberPwd))
         return
     host = g_preDefinedHosts.byUrl(host)
     connectionManager.connect(getHostURL(host, token2, True), user, password, host.keyPath, nickName=None, token2=token2, isNeedSavingPwd=self.__loginDataLoader.rememberPwd)
Beispiel #6
0
 def __doConnect(self):
     login, token2 = self.__credentials
     self.__addHandlers()
     g_loginManager.initiateRelogin(login, token2, getHostURL(self.__host, token2))
 def __doConnect(self):
     login, token2 = self.__credentials
     self.__addHandlers()
     self.loginManager.initiateRelogin(login, token2, getHostURL(self.__host, token2))
Beispiel #8
0
 def __doConnect(self):
     login, token2 = self.__credentials
     self.__addHandlers()
     connectionManager.connect(getHostURL(self.__host, token2), login, '', self.__host.keyPath, token2=token2)
Beispiel #9
0
 def __doConnect(self):
     login, token2 = self.__credentials
     self.__addHandlers()
     connectionManager.initiateConnection({'login': login,
      'token2': token2,
      'auth_method': CONNECTION_METHOD.TOKEN2,
      'session': BigWorld.wg_cpsalt(g_loginManager.getPreference('session')),
      'temporary': str(int(not g_loginManager.getPreference('remember_user')))}, '', getHostURL(self.__host, token2))