From 77bfb5e552e6f8ff90a4aeb3242d55e5194a5b5a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 6 Nov 2013 22:54:00 -0700 Subject: [PATCH] Handle CHANGING_LOCATION messages in AIR. --- .../src/distributed/AstronInternalRepository.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/direct/src/distributed/AstronInternalRepository.py b/direct/src/distributed/AstronInternalRepository.py index 3be40dd757..9e93eb2508 100644 --- a/direct/src/distributed/AstronInternalRepository.py +++ b/direct/src/distributed/AstronInternalRepository.py @@ -144,6 +144,8 @@ class AstronInternalRepository(ConnectionRepository): elif msgType in (STATESERVER_OBJECT_CHANGING_AI, STATESERVER_OBJECT_DELETE_RAM): self.handleObjExit(di) + elif msgType == STATESERVER_OBJECT_CHANGING_LOCATION: + self.handleObjLocation(di) elif msgType in (DBSERVER_CREATE_OBJECT_RESP, DBSERVER_OBJECT_GET_ALL_RESP, DBSERVER_OBJECT_SET_FIELD_IF_EQUALS_RESP, @@ -152,6 +154,19 @@ class AstronInternalRepository(ConnectionRepository): else: self.notify.warning('Received message with unknown MsgType=%d' % msgType) + def handleObjLocation(self, di): + doId = di.getUint32() + parentId = di.getUint32() + zoneId = di.getUint32() + + do = self.doId2do.get(doId) + + if not do: + self.notify.warning('Received location for unknown doId=%d!' % (doId)) + return + + do.setLocation(parentId, zoneId) + def handleObjEntry(self, di, other): doId = di.getUint32() parentId = di.getUint32()