distributed: handleCloseShard astron support

This commit is contained in:
John Cote 2019-11-30 22:15:12 -05:00
parent 41abecc194
commit 427c93da46

View file

@ -612,23 +612,42 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
self.handler = self.handleCloseShard self.handler = self.handleCloseShard
self._removeLocalAvFromStateServer() self._removeLocalAvFromStateServer()
def handleCloseShard(self, msgType, di): if config.GetBool('astron-support', True):
if msgType == CLIENT_CREATE_OBJECT_REQUIRED: def handleCloseShard(self, msgType, di):
di2 = PyDatagramIterator(di) if msgType == CLIENT_ENTER_OBJECT_REQUIRED:
parentId = di2.getUint32() di2 = PyDatagramIterator(di)
if self._doIdIsOnCurrentShard(parentId): parentId = di2.getUint32()
return if self._doIdIsOnCurrentShard(parentId):
elif msgType == CLIENT_CREATE_OBJECT_REQUIRED_OTHER: return
di2 = PyDatagramIterator(di) elif msgType == CLIENT_ENTER_OBJECT_REQUIRED_OTHER:
parentId = di2.getUint32() di2 = PyDatagramIterator(di)
if self._doIdIsOnCurrentShard(parentId): parentId = di2.getUint32()
return if self._doIdIsOnCurrentShard(parentId):
elif msgType == CLIENT_OBJECT_UPDATE_FIELD: return
di2 = PyDatagramIterator(di) elif msgType == CLIENT_OBJECT_SET_FIELD:
doId = di2.getUint32() di2 = PyDatagramIterator(di)
if self._doIdIsOnCurrentShard(doId): doId = di2.getUint32()
return if self._doIdIsOnCurrentShard(doId):
self.handleMessageType(msgType, di) return
self.handleMessageType(msgType, di)
else:
def handleCloseShard(self, msgType, di):
if msgType == CLIENT_CREATE_OBJECT_REQUIRED:
di2 = PyDatagramIterator(di)
parentId = di2.getUint32()
if self._doIdIsOnCurrentShard(parentId):
return
elif msgType == CLIENT_CREATE_OBJECT_REQUIRED_OTHER:
di2 = PyDatagramIterator(di)
parentId = di2.getUint32()
if self._doIdIsOnCurrentShard(parentId):
return
elif msgType == CLIENT_OBJECT_UPDATE_FIELD:
di2 = PyDatagramIterator(di)
doId = di2.getUint32()
if self._doIdIsOnCurrentShard(doId):
return
self.handleMessageType(msgType, di)
def _logFailedDisable(self, doId, ownerView): def _logFailedDisable(self, doId, ownerView):
if doId not in self.doId2do and doId in self._deletedSubShardDoIds: if doId not in self.doId2do and doId in self._deletedSubShardDoIds: