Handle CHANGING_LOCATION messages in AIR.

This commit is contained in:
Sam Edwards 2013-11-06 22:54:00 -07:00
parent 0c2ea25813
commit 77bfb5e552
1 changed files with 15 additions and 0 deletions

View File

@ -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()