From 4274450c3fa6617a6a9a87618cfbdac01472b565 Mon Sep 17 00:00:00 2001 From: bobbybee Date: Thu, 14 Aug 2014 17:26:41 -0400 Subject: [PATCH] Set AI --- direct/src/distributed/AstronInternalRepository.py | 10 ++++++++++ direct/src/distributed/DistributedObjectAI.py | 3 +++ 2 files changed, 13 insertions(+) diff --git a/direct/src/distributed/AstronInternalRepository.py b/direct/src/distributed/AstronInternalRepository.py index f05f12efb0..e177e6595d 100644 --- a/direct/src/distributed/AstronInternalRepository.py +++ b/direct/src/distributed/AstronInternalRepository.py @@ -421,3 +421,13 @@ class AstronInternalRepository(ConnectionRepository): for arg in args: dg.addString(str(arg)) self.eventSocket.Send(dg.getMessage()) + + def setAI(self, doID, aiChannel): + """ + Sets the AI of the specified DistributedObjectAI to be the specified channel. + Generally, you should not call this method, and instead call DistributedObjectAI.setAI. + """ + dg = PyDatagram() + dg.addServerHeader(doID, aiChannel, MsgTypes.STATESERVER_OBJECT_SET_AI) + dg.add_uint64(aiChannel) + dg.send(dg) \ No newline at end of file diff --git a/direct/src/distributed/DistributedObjectAI.py b/direct/src/distributed/DistributedObjectAI.py index 3e3261d0dc..5a47194d82 100644 --- a/direct/src/distributed/DistributedObjectAI.py +++ b/direct/src/distributed/DistributedObjectAI.py @@ -568,4 +568,7 @@ class DistributedObjectAI(DistributedObjectBase): def _retrieveCachedData(self): """ This is a no-op on the AI. """ pass + + def setAI(self, aiChannel): + self.air.setAI(self.doId, aiChannel)