From 8bf7a6a895577f8586fa071f40ea92241a267e0b Mon Sep 17 00:00:00 2001 From: John Cote Date: Sat, 30 Nov 2019 22:21:12 -0500 Subject: [PATCH] distributed: maintain consistency --- .../distributed/ToontownClientRepository.py | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/toontown/distributed/ToontownClientRepository.py b/toontown/distributed/ToontownClientRepository.py index 845362f..6aa9ebc 100644 --- a/toontown/distributed/ToontownClientRepository.py +++ b/toontown/distributed/ToontownClientRepository.py @@ -612,25 +612,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository): self.handler = self.handleCloseShard self._removeLocalAvFromStateServer() - if config.GetBool('astron-support', True): - def handleCloseShard(self, msgType, di): - if msgType == CLIENT_ENTER_OBJECT_REQUIRED: - di2 = PyDatagramIterator(di) - parentId = di2.getUint32() - if self._doIdIsOnCurrentShard(parentId): - return - elif msgType == CLIENT_ENTER_OBJECT_REQUIRED_OTHER: - di2 = PyDatagramIterator(di) - parentId = di2.getUint32() - if self._doIdIsOnCurrentShard(parentId): - return - elif msgType == CLIENT_OBJECT_SET_FIELD: - di2 = PyDatagramIterator(di) - doId = di2.getUint32() - if self._doIdIsOnCurrentShard(doId): - return - self.handleMessageType(msgType, di) - else: + if not config.GetBool('astron-support', True): def handleCloseShard(self, msgType, di): if msgType == CLIENT_CREATE_OBJECT_REQUIRED: di2 = PyDatagramIterator(di) @@ -648,6 +630,24 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository): if self._doIdIsOnCurrentShard(doId): return self.handleMessageType(msgType, di) + else: + def handleCloseShard(self, msgType, di): + if msgType == CLIENT_ENTER_OBJECT_REQUIRED: + di2 = PyDatagramIterator(di) + parentId = di2.getUint32() + if self._doIdIsOnCurrentShard(parentId): + return + elif msgType == CLIENT_ENTER_OBJECT_REQUIRED_OTHER: + di2 = PyDatagramIterator(di) + parentId = di2.getUint32() + if self._doIdIsOnCurrentShard(parentId): + return + elif msgType == CLIENT_OBJECT_SET_FIELD: + di2 = PyDatagramIterator(di) + doId = di2.getUint32() + if self._doIdIsOnCurrentShard(doId): + return + self.handleMessageType(msgType, di) def _logFailedDisable(self, doId, ownerView): if doId not in self.doId2do and doId in self._deletedSubShardDoIds: