From bcb8f039d8b5d6741404161faa689b20ffc22eeb Mon Sep 17 00:00:00 2001 From: Roger Hughston Date: Wed, 5 Jan 2005 23:56:06 +0000 Subject: [PATCH] *** empty log message *** --- direct/src/distributed/ClientRepository.py | 30 +++++++++++++++++++--- direct/src/distributed/MsgTypes.py | 2 ++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/direct/src/distributed/ClientRepository.py b/direct/src/distributed/ClientRepository.py index 649b518f97..7d5a321205 100644 --- a/direct/src/distributed/ClientRepository.py +++ b/direct/src/distributed/ClientRepository.py @@ -138,13 +138,24 @@ class ClientRepository(ConnectionRepository.ConnectionRepository): it should be accurate plus or minus a couple of seconds. """ return time.time() + self.serverDelta + + def handleObjectLocation(self, di): + # CLEINT_OBJECT_LOCATION + ThedoId = di.getUint32() + TheParent = di.getUint32() + TheZone = di.getUint32() + print "Object Location->Id=%s Parent=%s Zone=%s"%(ThedoId,TheParent, TheZone) + def handleGenerateWithRequired(self, di): + if wantOtpServer: + TheParent = di.getUint32() + TheZone = di.getUint32() # Get the class Id classId = di.getUint16(); # Get the DO Id doId = di.getUint32() - # Look up the dclass + # Look up the dclass dclass = self.dclassesByNumber[classId] dclass.startGenerate() # Create a new distributed object, and put it in the dictionary @@ -152,6 +163,9 @@ class ClientRepository(ConnectionRepository.ConnectionRepository): dclass.stopGenerate() def handleGenerateWithRequiredOther(self, di): + if wantOtpServer: + TheParent = di.getUint32() + TheZone = di.getUint32() # Get the class Id classId = di.getUint16(); # Get the DO Id @@ -165,6 +179,9 @@ class ClientRepository(ConnectionRepository.ConnectionRepository): def handleQuietZoneGenerateWithRequired(self, di): # Special handler for quiet zone generates -- we need to filter + if wantOtpServer: + TheParent = di.getUint32() + TheZone = di.getUint32() # Get the class Id classId = di.getUint16(); # Get the DO Id @@ -184,6 +201,9 @@ class ClientRepository(ConnectionRepository.ConnectionRepository): def handleQuietZoneGenerateWithRequiredOther(self, di): # Special handler for quiet zone generates -- we need to filter + if wantOtpServer: + TheParent = di.getUint32() + TheZone = di.getUint32() # Get the class Id classId = di.getUint16(); # Get the DO Id @@ -424,7 +444,7 @@ class ClientRepository(ConnectionRepository.ConnectionRepository): self.notify.info('Message from server: %s' % (message)) return message - def handleUnexpectedMsgType(self, msgType, di): + def handleUnexpectedMsgType(self, msgType, di): if msgType == CLIENT_CREATE_OBJECT_REQUIRED: self.handleGenerateWithRequired(di) elif msgType == CLIENT_CREATE_OBJECT_REQUIRED_OTHER: @@ -443,10 +463,12 @@ class ClientRepository(ConnectionRepository.ConnectionRepository): self.handleSystemMessage(di) elif wantOtpServer and msgType == CLIENT_CREATE_OBJECT_REQUIRED: self.handleGenerateWithRequired(di) - elif wantOtpServer and dmsgType == CLIENT_CREATE_OBJECT_REQUIRED_OTHER: + elif wantOtpServer and msgType == CLIENT_CREATE_OBJECT_REQUIRED_OTHER: self.handleGenerateWithRequiredOther(di) elif wantOtpServer and msgType == CLIENT_DONE_SET_ZONE_RESP: - self.handleSetZoneDone() + self.handleSetZoneDone() + elif wantOtpServer and msgType == CLEINT_OBJECT_LOCATION: + self.handleObjectLocation(di) else: currentLoginState = self.loginFSM.getCurrentState() if currentLoginState: diff --git a/direct/src/distributed/MsgTypes.py b/direct/src/distributed/MsgTypes.py index decab4955c..db330eeaf9 100644 --- a/direct/src/distributed/MsgTypes.py +++ b/direct/src/distributed/MsgTypes.py @@ -76,6 +76,8 @@ CLIENT_GET_PET_DETAILS_RESP = 82 CLIENT_ADD_INTEREST = 97 CLEINT_ALTER_INTEREST = 98 CLEINT_REMOVE_INTEREST = 99 +if wantOtpServer: + CLEINT_OBJECT_LOCATION = 102 # These messages are ignored when the client is headed to the quiet zone QUIET_ZONE_IGNORED_LIST = [