diff --git a/direct/src/distributed/ClientRepository.py b/direct/src/distributed/ClientRepository.py index b30dc1ed9f..36ce094ab8 100644 --- a/direct/src/distributed/ClientRepository.py +++ b/direct/src/distributed/ClientRepository.py @@ -55,7 +55,8 @@ class ClientRepository(ClientRepositoryBase): def createReady(self): # Now that we've got a doId range, we can safely generate new # distributed objects. - messenger.send('createReady') + messenger.send('createReady', taskChain = 'default') + messenger.send(self.uniqueName('createReady'), taskChain = 'default') def handleRequestGenerates(self, di): # When new clients join the zone of an object, they need to hear diff --git a/direct/src/distributed/ClientRepositoryBase.py b/direct/src/distributed/ClientRepositoryBase.py index 470b8279f5..e937603239 100644 --- a/direct/src/distributed/ClientRepositoryBase.py +++ b/direct/src/distributed/ClientRepositoryBase.py @@ -100,10 +100,6 @@ class ClientRepositoryBase(ConnectionRepository): ## self.send(datagram) ## # Make sure the message gets there. ## self.flush() - - # Define uniqueName - def uniqueName(self, desc): - return desc def specialName(self, label): name = ("SpecialName %s %s" % (self.specialNameNumber, label)) diff --git a/direct/src/distributed/ConnectionRepository.py b/direct/src/distributed/ConnectionRepository.py index b5c4324e89..0d664f41bf 100644 --- a/direct/src/distributed/ConnectionRepository.py +++ b/direct/src/distributed/ConnectionRepository.py @@ -56,6 +56,10 @@ class ConnectionRepository( self.config = config + # Create a unique ID number for each ConnectionRepository in + # the world, helpful for sending messages specific to each one. + self.uniqueId = hash(self) + if self.config.GetBool('verbose-repository'): self.setVerbose(1) @@ -646,6 +650,9 @@ class ConnectionRepository( self.notify.info('*** RESTORING SIMULATED PULLED-NETWORK-PLUG ***') self.setSimulatedDisconnect(0) + def uniqueName(self, idString): + return ("%s-%s" % (idString, self.uniqueId)) + class GCTrigger: # used to trigger garbage collection pass diff --git a/direct/src/distributed/TimeManager.py b/direct/src/distributed/TimeManager.py index b75ec24599..d5f22da4e4 100644 --- a/direct/src/distributed/TimeManager.py +++ b/direct/src/distributed/TimeManager.py @@ -179,5 +179,6 @@ class TimeManager(DistributedObject.DistributedObject): return self.notify.info("Giving up on uncertainty requirement.") - messenger.send("gotTimeSync") + messenger.send("gotTimeSync", taskChain = 'default') + messenger.send(self.cr.uniqueName("gotTimeSync"), taskChain = 'default') diff --git a/direct/src/distributed/cConnectionRepository.h b/direct/src/distributed/cConnectionRepository.h index 9efa85ceba..c2023e92ff 100644 --- a/direct/src/distributed/cConnectionRepository.h +++ b/direct/src/distributed/cConnectionRepository.h @@ -106,11 +106,11 @@ PUBLISHED: void stop_delay(); #endif - bool check_datagram(); + BLOCKING bool check_datagram(); #ifdef HAVE_PYTHON #ifdef WANT_NATIVE_NET - bool check_datagram_ai(PyObject *PycallBackFunction); - bool network_based_reader_and_yielder(PyObject *PycallBackFunction,ClockObject &clock, float returnBy); + BLOCKING bool check_datagram_ai(PyObject *PycallBackFunction); + BLOCKING bool network_based_reader_and_yielder(PyObject *PycallBackFunction,ClockObject &clock, float returnBy); #endif #endif @@ -126,7 +126,7 @@ PUBLISHED: bool is_connected(); - bool send_datagram(const Datagram &dg); + BLOCKING bool send_datagram(const Datagram &dg); INLINE void set_want_message_bundling(bool flag); INLINE bool get_want_message_bundling() const; @@ -140,8 +140,8 @@ PUBLISHED: void abandon_message_bundles(); void bundle_msg(const Datagram &dg); - bool consider_flush(); - bool flush(); + BLOCKING bool consider_flush(); + BLOCKING bool flush(); void disconnect(); void shutdown();