general: More Astron progress

This commit is contained in:
Open Toontown 2019-11-08 21:10:31 -05:00
parent bba3117cc4
commit 2dcf73d3da
3 changed files with 45 additions and 5 deletions

View file

@ -520,6 +520,7 @@ class OTPClientRepository(ClientRepositoryBase):
return return
self.startReaderPollTask() self.startReaderPollTask()
if not self.astronSupport:
self.startHeartbeat() self.startHeartbeat()
newInstall = launcher.getIsNewInstallation() newInstall = launcher.getIsNewInstallation()
newInstall = base.config.GetBool('new-installation', newInstall) newInstall = base.config.GetBool('new-installation', newInstall)
@ -1933,6 +1934,35 @@ class OTPClientRepository(ClientRepositoryBase):
if self.astronSupport: if self.astronSupport:
if msgType == CLIENT_EJECT: if msgType == CLIENT_EJECT:
self.handleGoGetLost(di) self.handleGoGetLost(di)
elif msgType == CLIENT_HEARTBEAT:
self.handleServerHeartbeat(di)
elif msgtype == CLIENT_ENTER_OBJECT_REQUIRED:
self.handleGenerateWithRequired(di)
elif msgType == CLIENT_ENTER_OBJECT_REQUIRED_OTHER:
self.handleGenerateWithRequiredOther(di)
elif msgType == CLIENT_ENTER_OBJECT_REQUIRED_OTHER_OWNER:
self.handleGenerateWithRequiredOtherOwner(di)
elif msgType == CLIENT_OBJECT_SET_FIELD:
self.handleUpdateField(di)
elif msgType == CLIENT_OBJECT_LEAVING:
self.handleDisable(di)
elif msgType == CLIENT_OBJECT_LEAVING_OWNER:
self.handleDisable(di, ownerView=True)
elif msgType == CLIENT_DONE_INTEREST_RESP:
self.gotInterestDoneMessage(di)
elif msgType == CLIENT_OBJECT_LOCATION:
self.gotObjectLocationMessage(di)
else:
currentLoginState = self.loginFSM.getCurrentState()
if currentLoginState:
currentLoginStateName = currentLoginState.getName()
else:
currentLoginStateName = 'None'
currentGameState = self.gameFSM.getCurrentState()
if currentGameState:
currentGameStateName = currentGameState.getName()
else:
currentGameStateName = 'None'
else: else:
if msgType == CLIENT_GO_GET_LOST: if msgType == CLIENT_GO_GET_LOST:
self.handleGoGetLost(di) self.handleGoGetLost(di)

View file

@ -1,6 +1,11 @@
from direct.directnotify import DirectNotifyGlobal from direct.directnotify import DirectNotifyGlobal
from otp.login.LoginScreen import LoginScreen from otp.login.LoginScreen import LoginScreen
from direct.distributed.MsgTypes import *
class AstronLoginScreen(LoginScreen): class AstronLoginScreen(LoginScreen):
def handleWaitForLoginResponse(self, msgType, di): def handleWaitForLoginResponse(self, msgType, di):
if msgType == CLIENT_HELLO_RESP:
# Now we can start the heartbeat:
self.cr.startHeartbeat()
else:
self.cr.handleMessageType(msgType, di) self.cr.handleMessageType(msgType, di)

View file

@ -1,5 +1,7 @@
from direct.directnotify import DirectNotifyGlobal from direct.directnotify import DirectNotifyGlobal
from otp.login.LoginBase import LoginBase from otp.login.LoginBase import LoginBase
from direct.distributed.PyDatagram import PyDatagram
from direct.distributed.MsgTypes import *
class LoginAstronAccount(LoginBase): class LoginAstronAccount(LoginBase):
notify = DirectNotifyGlobal.directNotify.newCategory('LoginAstronAccount') notify = DirectNotifyGlobal.directNotify.newCategory('LoginAstronAccount')
@ -8,11 +10,14 @@ class LoginAstronAccount(LoginBase):
LoginBase.__init__(self, cr) LoginBase.__init__(self, cr)
def authorize(self, username, password): def authorize(self, username, password):
self.notify.info(username) pass
self.notify.info(password)
def sendLoginMsg(self): def sendLoginMsg(self):
self.notify.info('LOG ME IN!!!!!!!!!!!!') datagram = PyDatagram()
datagram.addUint16(CLIENT_HELLO)
datagram.addUint32(self.cr.hashVal)
datagram.addString(self.cr.serverVersion)
self.cr.send(datagram)
def supportsRelogin(self): def supportsRelogin(self):
if __debug__: if __debug__: