general: Fix some issues, cleanup

This commit is contained in:
John Cote 2019-11-17 18:15:48 -05:00
parent f199fd055d
commit bab8474cb9
4 changed files with 52 additions and 47 deletions

View file

@ -1169,9 +1169,14 @@ class OTPClientRepository(ClientRepositoryBase):
else:
self.startPeriodTimer()
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
def handleAvatarResponseMsg(self, di):
pass
if not config.GetBool('astron-support', True):
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
def handleAvatarResponseMsg(self, di):
pass
else:
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
def handleAvatarResponseMsg(self, avatarId, di):
pass
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
def handleWaitForSetAvatarResponse(self, msgType, di):
@ -1676,17 +1681,15 @@ class OTPClientRepository(ClientRepositoryBase):
def handlePlayGame(self, msgType, di):
if self.notify.getDebug():
self.notify.debug('handle play game got message type: ' + `msgType`)
if self.__recordObjectMessage(msgType, di):
return
if msgType == CLIENT_ENTER_OBJECT_REQUIRED:
self.handleGenerateWithRequired(di)
elif msgType == CLIENT_ENTER_OBJECT_REQUIRED_OTHER:
self.handleGenerateWithRequiredOther(di)
self.handleGenerateWithRequired(di, other=True)
elif msgType == CLIENT_OBJECT_SET_FIELD:
self.handleUpdateField(di)
elif msgType == CLIENT_OBJECT_DISABLE:
self.handleDisable(di)
elif msgType == CLIENT_OBJECT_DISABLE_OWNER:
self.handleDisable(di, ownerView=True)
elif msgType == CLIENT_OBJECT_DELETE_RESP:
elif msgType == CLIENT_OBJECT_LEAVING:
self.handleDelete(di)
else:
self.handleMessageType(msgType, di)
@ -1970,42 +1973,8 @@ class OTPClientRepository(ClientRepositoryBase):
messenger.send('periodTimerExpired')
return Task.done
def handleMessageType(self, msgType, di):
if self.astronSupport:
if self.__recordObjectMessage(msgType, di):
return
if msgType == CLIENT_EJECT:
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.handleGenerateWithRequired(di, other=True)
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:
if not config.GetBool('astron-support', True):
def handleMessageType(self, msgType, di):
if msgType == CLIENT_GO_GET_LOST:
self.handleGoGetLost(di)
elif msgType == CLIENT_HEARTBEAT:
@ -2047,6 +2016,41 @@ class OTPClientRepository(ClientRepositoryBase):
currentGameStateName = currentGameState.getName()
else:
currentGameStateName = 'None'
else:
def handleMessageType(self, msgType, di):
if self.__recordObjectMessage(msgType, di):
return
if msgType == CLIENT_EJECT:
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.handleGenerateWithRequired(di, other=True)
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'
def gotInterestDoneMessage(self, di):
if self.deferredGenerates:

View file

@ -1130,6 +1130,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
dclass.stopGenerate()
def handleGenerateWithRequiredOtherOwner(self, di):
# OwnerViews are only used for LocalToon in Toontown.
if self.loginFSM.getCurrentState().getName() == 'waitForSetAvatarResponse':
doId = di.getUint32()
parentId = di.getUint32()

View file

@ -58,7 +58,7 @@ class Hood(StateData.StateData):
self.titleText.setColor(Vec4(*self.titleColor))
self.titleText.clearColorScale()
self.titleText.setFg(self.titleColor)
self.titleTextSeq = Sequence(Wait(0.1), Wait(6.0), self.titleText.colorScaleInterval(0.5, Vec4(1.0, 1.0, 1.0, 0.0), Vec4(1.0, 1.0, 1.0, 1.0)), Func(self.hideTitleText))
self.titleTextSeq = Sequence(Wait(0.1), Wait(6.0), self.titleText.colorScaleInterval(0.5, Vec4(1.0, 1.0, 1.0, 0.0)), Func(self.hideTitleText))
self.titleTextSeq.start()
def hideTitleText(self):

View file

@ -1,5 +1,5 @@
from pandac.PandaModules import *
from libotp import Settings
from libotp import *
import ShtikerPage
from toontown.toontowngui import TTDialog
from direct.gui.DirectGui import *