From 1fd98e38f15adb880e8c915ee593f8685ca2c9b4 Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 31 Oct 2003 23:45:22 +0000 Subject: [PATCH] starting bossBattle --- direct/src/distributed/DistributedObject.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/direct/src/distributed/DistributedObject.py b/direct/src/distributed/DistributedObject.py index d79a00a6f1..154d67af90 100644 --- a/direct/src/distributed/DistributedObject.py +++ b/direct/src/distributed/DistributedObject.py @@ -52,6 +52,9 @@ class DistributedObject(PandaObject): # These are used by getCallbackContext() and doCallbackContext(). self.__nextContext = 0 self.__callbacks = {} + + # This is used by doneBarrier(). + self.__barrierContext = None return None @@ -291,3 +294,18 @@ class DistributedObject(PandaObject): else: self.notify.warning("Got unexpected context from AI: %s" % (context)) + def doBarrierWait(self, context): + # This message is sent by the AI to tell us the context number + # for the current barrier. When the client is done handling + # whatever it should handle in its current state, it should + # call doneBarrier(), which will send the context number back + # to the AI. + self.__barrierContext = context + + def doneBarrier(self): + # Tells the AI we have finished handling our task. + assert(self.__barrierContext != None) + self.sendUpdate("doBarrierReady", [self.__barrierContext]) + self.__barrierContext = None + +