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)