Browse Source

use self.air instead of simbase.air and uniquify task names to eliminate cross-talk between shards

Samir Naik 21 years ago
parent
commit
55a9716356

+ 6 - 0
direct/src/actor/Actor.py

@@ -1465,6 +1465,12 @@ class Actor(PandaObject, NodePath):
                 if effect > 0.:
                     totalEffect += effect
                     thisAnim += ('%s:%.3f, ' % (name, effect))
+            thisAnim += "\n"
+            for control in controls:
+                part = control.getPart()
+                name = part.getName()
+                rate = control.getPlayRate()
+                thisAnim += ('%s:%.1f, ' % (name, rate))
             # don't display anything if this animation is not being played
             itemName = 'anim %s' % animName
             if totalEffect > 0.:

+ 4 - 0
direct/src/distributed/ClientRepository.py

@@ -81,6 +81,10 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
         self.DOIDnext = 0
         self.DOIDlast = 0
 
+    # Define uniqueName 
+    def uniqueName(self, desc):
+        return desc
+
     def abruptCleanup(self):
         """
         Call this method to clean up any pending hooks or tasks on

+ 2 - 2
direct/src/distributed/ConnectionRepository.py

@@ -324,11 +324,11 @@ class ConnectionRepository(DoInterestManager, CConnectionRepository):
         self.stopReaderPollTask()
         self.accept(CConnectionRepository.getOverflowEventName(),
                     self.handleReaderOverflow)
-        taskMgr.add(self.readerPollUntilEmpty, "readerPollTask",
+        taskMgr.add(self.readerPollUntilEmpty, self.uniqueName("readerPollTask"),
                     priority = self.taskPriority)
 
     def stopReaderPollTask(self):
-        taskMgr.remove("readerPollTask")
+        taskMgr.remove(self.uniqueName("readerPollTask"))
         self.ignore(CConnectionRepository.getOverflowEventName())
 
     def readerPollUntilEmpty(self, task):

+ 1 - 1
direct/src/distributed/DistributedCartesianGridAI.py

@@ -57,7 +57,7 @@ class DistributedCartesianGridAI(DistributedNodeAI.DistributedNodeAI,
     def removeObjectFromGrid(self, av):
         # TODO: WHAT LOCATION SHOULD WE SET THIS TO?
         #av.wrtReparentTo(self.parentNP)
-        av.setLocation(simbase.air.districtId, PiratesGlobals.TestZone)
+        av.setLocation(self.air.districtId, PiratesGlobals.TestZone)
 
         # Remove grid parent for this av
         avId = av.doId

+ 3 - 3
direct/src/distributed/DistributedObjectAI.py

@@ -166,7 +166,7 @@ class DistributedObjectAI(DirectObject.DirectObject):
                         lastLogicalZone = self.lastNonQuietZone
                     self.handleLogicalZoneChange(zoneId, lastLogicalZone)
                     self.lastNonQuietZone = zoneId
-                # self.air.storeObjectLocation(self.doId, parentId, zoneId)
+                #self.air.storeObjectLocation(self.doId, parentId, zoneId)
                 self.__location = (parentId, zoneId)
 
         def getLocation(self):
@@ -284,7 +284,7 @@ class DistributedObjectAI(DirectObject.DirectObject):
         if wantOtpServer:
             #HACK:
             if not hasattr(self, 'parentId'):
-                parentId = simbase.air.districtId
+                parentId = self.air.districtId
                 self.parentId = parentId
         self.zoneId = zoneId
         self.generate()
@@ -303,7 +303,7 @@ class DistributedObjectAI(DirectObject.DirectObject):
         if wantOtpServer:
             #HACK:
             if not hasattr(self, 'parentId'):
-                parentId = simbase.air.districtId
+                parentId = self.air.districtId
                 self.parentId = parentId
         self.zoneId = zoneId
         self.generate()