general: Start working on Astron login manager
This commit is contained in:
parent
2dcf73d3da
commit
9b2834785e
7 changed files with 32 additions and 0 deletions
|
@ -35,6 +35,10 @@ uberdogs:
|
|||
id: 4695
|
||||
anonymous: false
|
||||
|
||||
- class: AstronLoginManager
|
||||
id: 4670
|
||||
anonymous: true
|
||||
|
||||
roles:
|
||||
- type: clientagent
|
||||
bind: 0.0.0.0:7198
|
||||
|
|
|
@ -27,6 +27,7 @@ from otp.distributed import CentralLogger/AI/UD
|
|||
from otp.web import SettingsMgr/AI/UD
|
||||
from otp.status import StatusDatabase/UD
|
||||
from otp.avatar import AvatarHandle
|
||||
from otp.login import AstronLoginManager/UD
|
||||
|
||||
typedef uint8 bool;
|
||||
|
||||
|
@ -509,3 +510,8 @@ dclass StatusDatabase : DistributedObject {
|
|||
dclass CallbackObject {
|
||||
callback(uint32, bool, uint8);
|
||||
};
|
||||
|
||||
dclass AstronLoginManager : DistributedObject {
|
||||
requestLogin(string) clsend;
|
||||
loginResponse(blob);
|
||||
};
|
||||
|
|
|
@ -424,6 +424,8 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
self.wantSwitchboard = config.GetBool('want-switchboard', 0)
|
||||
self.wantSwitchboardHacks = base.config.GetBool('want-switchboard-hacks', 0)
|
||||
self.centralLogger = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_CENTRAL_LOGGER, 'CentralLogger')
|
||||
if self.astronSupport:
|
||||
self.astronLoginManager = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_ASTRON_LOGIN_MANAGER, 'AstronLoginManager')
|
||||
|
||||
def startLeakDetector(self):
|
||||
if hasattr(self, 'leakDetector'):
|
||||
|
|
|
@ -20,6 +20,7 @@ OTP_DO_ID_AVATARS = 4630
|
|||
OTP_DO_ID_FRIENDS = 4640
|
||||
OTP_DO_ID_GUILDS = 4650
|
||||
OTP_DO_ID_ESCROW = 4660
|
||||
OTP_DO_ID_ASTRON_LOGIN_MANAGER = 4670
|
||||
OTP_DO_ID_PIRATES_AVATAR_MANAGER = 4674
|
||||
OTP_DO_ID_PIRATES_CREW_MANAGER = 4675
|
||||
OTP_DO_ID_PIRATES_INVENTORY_MANAGER = 4677
|
||||
|
|
17
otp/login/AstronLoginManager.py
Normal file
17
otp/login/AstronLoginManager.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
from direct.distributed.DistributedObjectGlobal import DistributedObjectGlobal
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
|
||||
class AstronLoginManager(DistributedObjectGlobal):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('AstronLoginManager')
|
||||
|
||||
def __init__(self, cr):
|
||||
DistributedObjectGlobal.__init__(self, cr)
|
||||
self.doneEvent = None
|
||||
|
||||
def handleRequestLogin(self, doneEvent):
|
||||
self.doneEvent = doneEvent
|
||||
playToken = self.cr.playToken or 'dev'
|
||||
self.sendRequestLogin(playToken)
|
||||
|
||||
def sendRequestLogin(self, playToken):
|
||||
self.sendUpdate('requestLogin', [playToken])
|
0
otp/login/AstronLoginManagerUD.py
Normal file
0
otp/login/AstronLoginManagerUD.py
Normal file
|
@ -3,9 +3,11 @@ from otp.login.LoginScreen import LoginScreen
|
|||
from direct.distributed.MsgTypes import *
|
||||
|
||||
class AstronLoginScreen(LoginScreen):
|
||||
|
||||
def handleWaitForLoginResponse(self, msgType, di):
|
||||
if msgType == CLIENT_HELLO_RESP:
|
||||
# Now we can start the heartbeat:
|
||||
self.cr.startHeartbeat()
|
||||
self.cr.astronLoginManager.handleRequestLogin(self.doneEvent)
|
||||
else:
|
||||
self.cr.handleMessageType(msgType, di)
|
||||
|
|
Loading…
Reference in a new issue