general: working on astron stuff
This commit is contained in:
parent
f497c3d011
commit
bba3117cc4
3 changed files with 81 additions and 42 deletions
|
@ -30,6 +30,7 @@ from otp.login import LoginTTSpecificDevAccount
|
|||
from otp.login import AccountServerConstants
|
||||
from otp.login.CreateAccountScreen import CreateAccountScreen
|
||||
from otp.login import LoginScreen
|
||||
from otp.login import AstronLoginScreen
|
||||
from otp.otpgui import OTPDialog
|
||||
from otp.avatar import DistributedAvatar
|
||||
from otp.otpbase import OTPLocalizer
|
||||
|
@ -38,6 +39,7 @@ from otp.login import LoginGoAccount
|
|||
from otp.login.LoginWebPlayTokenAccount import LoginWebPlayTokenAccount
|
||||
from otp.login.LoginDISLTokenAccount import LoginDISLTokenAccount
|
||||
from otp.login import LoginTTAccount
|
||||
from otp.login import LoginAstronAccount
|
||||
from otp.login import HTTPUtil
|
||||
from otp.otpbase import OTPGlobals
|
||||
from otp.otpbase import OTPLauncherGlobals
|
||||
|
@ -169,12 +171,16 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
else:
|
||||
self.http = HTTPClient()
|
||||
|
||||
self.allocateDcFile()
|
||||
#self.allocateDcFile()
|
||||
self.accountOldAuth = config.GetBool('account-old-auth', 0)
|
||||
self.accountOldAuth = config.GetBool('%s-account-old-auth' % game.name,
|
||||
self.accountOldAuth)
|
||||
self.useNewTTDevLogin = base.config.GetBool('use-tt-specific-dev-login', False)
|
||||
if self.useNewTTDevLogin:
|
||||
self.astronSupport = config.GetBool('astron-support', True)
|
||||
if self.astronSupport:
|
||||
self.loginInterface = LoginAstronAccount.LoginAstronAccount(self)
|
||||
self.notify.info('loginInterface: LoginAstronAccount')
|
||||
elif self.useNewTTDevLogin:
|
||||
self.loginInterface = LoginTTSpecificDevAccount.LoginTTSpecificDevAccount(self)
|
||||
self.notify.info('loginInterface: LoginTTSpecificDevAccount')
|
||||
elif self.accountOldAuth:
|
||||
|
@ -525,6 +531,9 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
def enterLogin(self):
|
||||
self.sendSetAvatarIdMsg(0)
|
||||
self.loginDoneEvent = 'loginDone'
|
||||
if self.astronSupport:
|
||||
self.loginScreen = AstronLoginScreen.AstronLoginScreen(self, self.loginDoneEvent)
|
||||
else:
|
||||
self.loginScreen = LoginScreen.LoginScreen(self, self.loginDoneEvent)
|
||||
self.accept(self.loginDoneEvent, self.__handleLoginDone)
|
||||
self.loginScreen.load()
|
||||
|
@ -1921,6 +1930,10 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
return Task.done
|
||||
|
||||
def handleMessageType(self, msgType, di):
|
||||
if self.astronSupport:
|
||||
if msgType == CLIENT_EJECT:
|
||||
self.handleGoGetLost(di)
|
||||
else:
|
||||
if msgType == CLIENT_GO_GET_LOST:
|
||||
self.handleGoGetLost(di)
|
||||
elif msgType == CLIENT_HEARTBEAT:
|
||||
|
|
6
otp/login/AstronLoginScreen.py
Normal file
6
otp/login/AstronLoginScreen.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from otp.login.LoginScreen import LoginScreen
|
||||
|
||||
class AstronLoginScreen(LoginScreen):
|
||||
def handleWaitForLoginResponse(self, msgType, di):
|
||||
self.cr.handleMessageType(msgType, di)
|
20
otp/login/LoginAstronAccount.py
Normal file
20
otp/login/LoginAstronAccount.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from otp.login.LoginBase import LoginBase
|
||||
|
||||
class LoginAstronAccount(LoginBase):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('LoginAstronAccount')
|
||||
|
||||
def __init__(self, cr):
|
||||
LoginBase.__init__(self, cr)
|
||||
|
||||
def authorize(self, username, password):
|
||||
self.notify.info(username)
|
||||
self.notify.info(password)
|
||||
|
||||
def sendLoginMsg(self):
|
||||
self.notify.info('LOG ME IN!!!!!!!!!!!!')
|
||||
|
||||
def supportsRelogin(self):
|
||||
if __debug__:
|
||||
return 1
|
||||
return 0
|
Loading…
Reference in a new issue