Browse Source

*** empty log message ***

Joe Shochet 24 years ago
parent
commit
cc63aec971

+ 8 - 7
direct/src/distributed/ClientRepository.py

@@ -266,13 +266,14 @@ class ClientRepository(DirectObject.DirectObject):
         doId = di.getArg(STUint32)
         doId = di.getArg(STUint32)
         #print("Updating " + str(doId))
         #print("Updating " + str(doId))
         # Find the DO
         # Find the DO
-        assert(self.doId2do.has_key(doId))
-        do = self.doId2do[doId]
-        # Find the cdc
-        assert(self.doId2cdc.has_key(doId))
-        cdc = self.doId2cdc[doId]
-        # Let the cdc finish the job
-        cdc.updateField(do, di)
+        do = self.doId2do.get(doId)
+        cdc = self.doId2cdc.get(doId)
+        if (do != None and cdc != None):
+            # Let the cdc finish the job
+            cdc.updateField(do, di)
+        else:
+            ClientRepository.notify.warning(
+                "Asked to update non-existent DistObj " + str(doId))
         return None
         return None
 
 
     def handleUnexpectedMsgType(self, msgType, di):
     def handleUnexpectedMsgType(self, msgType, di):

+ 17 - 10
direct/src/distributed/MsgTypes.py

@@ -1,10 +1,17 @@
-"""MsgTypes module: contains distributed object message types"""
-
-CLIENT_OBJECT_UPDATE_FIELD =     	     24
-CLIENT_OBJECT_UPDATE_FIELD_RESP =            24
-CLIENT_OBJECT_DISABLE_RESP =                 25
-CLIENT_OBJECT_DELETE_RESP =                  27
-CLIENT_SET_ZONE =                            29
-CLIENT_SET_SHARD =                           31
-CLIENT_CREATE_OBJECT_REQUIRED =              34
-CLIENT_CREATE_OBJECT_REQUIRED_OTHER =        35
+"""MsgTypes module: contains distributed object message types"""
+
+CLIENT_OBJECT_UPDATE_FIELD =     	     24
+CLIENT_OBJECT_UPDATE_FIELD_RESP =            24
+CLIENT_OBJECT_DISABLE_RESP =                 25
+CLIENT_OBJECT_DELETE_RESP =                  27
+CLIENT_SET_ZONE =                            29
+CLIENT_SET_SHARD =                           31
+CLIENT_CREATE_OBJECT_REQUIRED =              34
+CLIENT_CREATE_OBJECT_REQUIRED_OTHER =        35
+
+# These messages are ignored when the client is headed to the quiet zone
+QUIET_ZONE_IGNORED_LIST = [
+    CLIENT_OBJECT_UPDATE_FIELD,
+    CLIENT_CREATE_OBJECT_REQUIRED,
+    CLIENT_CREATE_OBJECT_REQUIRED_OTHER,
+    ]

+ 0 - 1
direct/src/showbase/ShowBaseGlobal.py

@@ -7,7 +7,6 @@ __builtin__.base = ShowBase()
 
 
 # Make some global aliases for convenience
 # Make some global aliases for convenience
 __builtin__.ostream = Notify.out()
 __builtin__.ostream = Notify.out()
-__builtin__.run = base.run
 __builtin__.directNotify = directNotify
 __builtin__.directNotify = directNotify
 
 
 # Set direct notify categories now that we have config
 # Set direct notify categories now that we have config

+ 22 - 15
direct/src/task/Task.py

@@ -71,7 +71,7 @@ def pause(delayTime):
             return cont
             return cont
         else:
         else:
             # Time is up, return done
             # Time is up, return done
-            TaskManager.notify.debug('pause done: ' + self.name)
+            # TaskManager.notify.debug('pause done: ' + self.name)
             return done
             return done
     task = Task(func)
     task = Task(func)
     task.name = 'pause'
     task.name = 'pause'
@@ -82,7 +82,7 @@ def pause(delayTime):
 def release():
 def release():
     def func(self):
     def func(self):
         # A release is immediately done
         # A release is immediately done
-        TaskManager.notify.debug('release done: ' + self.name)
+        # TaskManager.notify.debug('release done: ' + self.name)
         return done
         return done
     task = Task(func)
     task = Task(func)
     task.name = 'release'
     task.name = 'release'
@@ -97,7 +97,7 @@ def make_sequence(taskList):
     def func(self):
     def func(self):
         # If we got to the end of the list, this sequence is done
         # If we got to the end of the list, this sequence is done
         if (self.index >= len(self.taskList)):
         if (self.index >= len(self.taskList)):
-            TaskManager.notify.debug('sequence done: ' + self.name)
+            # TaskManager.notify.debug('sequence done: ' + self.name)
             return done
             return done
         else:
         else:
             task = self.taskList[self.index]
             task = self.taskList[self.index]
@@ -150,7 +150,7 @@ def make_loop(taskList):
     def func(self):
     def func(self):
         # If we got to the end of the list, this sequence is done
         # If we got to the end of the list, this sequence is done
         if (self.index >= len(self.taskList)):
         if (self.index >= len(self.taskList)):
-            TaskManager.notify.debug('sequence done, looping: ' + self.name)
+            # TaskManager.notify.debug('sequence done, looping: ' + self.name)
             self.prevIndex = -1
             self.prevIndex = -1
             self.index = 0
             self.index = 0
             return cont
             return cont
@@ -235,7 +235,7 @@ def timeline(*timelineList):
                 self.sequenceDone = 1
                 self.sequenceDone = 1
                 # See if the timeline is done
                 # See if the timeline is done
                 if (lenTaskList == 0):
                 if (lenTaskList == 0):
-                    TaskManager.notify.debug('timeline done: ' + self.name)
+                    # TaskManager.notify.debug('timeline done: ' + self.name)
                     return done
                     return done
                 else:
                 else:
                     return cont
                     return cont
@@ -273,7 +273,8 @@ class TaskManager:
         return self.spawnTaskNamed(task, name)
         return self.spawnTaskNamed(task, name)
 
 
     def spawnTaskNamed(self, task, name):
     def spawnTaskNamed(self, task, name):
-        TaskManager.notify.debug('spawning task named: ' + name)
+        if TaskManager.notify.getDebug():
+            TaskManager.notify.debug('spawning task named: ' + name)
         task.name = name
         task.name = name
         task.setStartTimeFrame(self.currentTime, self.currentFrame)
         task.setStartTimeFrame(self.currentTime, self.currentFrame)
         # search back from the end of the list until we find a
         # search back from the end of the list until we find a
@@ -315,22 +316,26 @@ class TaskManager:
             self.removeTask(task)
             self.removeTask(task)
 
 
     def removeTask(self, task):
     def removeTask(self, task):
-        TaskManager.notify.debug('removing task: ' + `task`)
+        if TaskManager.notify.getDebug():
+            TaskManager.notify.debug('removing task: ' + `task`)
+        removed = 0
         try:
         try:
             self.taskList.remove(task)
             self.taskList.remove(task)
+            removed = 1
         except:
         except:
             pass
             pass
-        if task.uponDeath:
+        if (task.uponDeath and removed):
             task.uponDeath(task)
             task.uponDeath(task)
 
 
     def removeTasksNamed(self, taskName):
     def removeTasksNamed(self, taskName):
-        TaskManager.notify.debug('removing tasks named: ' + taskName)
-        removedTasks = []
+        if TaskManager.notify.getDebug():
+            TaskManager.notify.debug('removing tasks named: ' + taskName)
 
 
         # Find the tasks that match by name and make a list of them
         # Find the tasks that match by name and make a list of them
+        removedTasks = []
         for task in self.taskList:
         for task in self.taskList:
-            if (task.name == taskName):
-                removedTasks.append(task)
+           if (task.name == taskName):
+               removedTasks.append(task)
 
 
         # Now iterate through the tasks we need to remove and remove them
         # Now iterate through the tasks we need to remove and remove them
         for task in removedTasks:
         for task in removedTasks:
@@ -352,7 +357,8 @@ class TaskManager:
         standard shell globbing characters like *, ?, and [].
         standard shell globbing characters like *, ?, and [].
 
 
         """
         """
-        TaskManager.notify.debug('removing tasks matching: ' + taskPattern)
+        if TaskManager.notify.getDebug():
+            TaskManager.notify.debug('removing tasks matching: ' + taskPattern)
         removedTasks = []
         removedTasks = []
 
 
         # Find the tasks that match by name and make a list of them
         # Find the tasks that match by name and make a list of them
@@ -362,13 +368,14 @@ class TaskManager:
 
 
         # Now iterate through the tasks we need to remove and remove them
         # Now iterate through the tasks we need to remove and remove them
         for task in removedTasks:
         for task in removedTasks:
-            self.removeTask(task)
+           self.removeTask(task)
 
 
         # Return the number of tasks removed
         # Return the number of tasks removed
         return len(removedTasks)
         return len(removedTasks)
 
 
     def step(self):
     def step(self):
-        TaskManager.notify.debug('step')
+        if TaskManager.notify.getDebug():
+            TaskManager.notify.debug('step')
         self.currentTime, self.currentFrame = getTimeFrame()
         self.currentTime, self.currentFrame = getTimeFrame()
         for task in self.taskList:
         for task in self.taskList:
             task.setCurrentTimeFrame(self.currentTime, self.currentFrame)
             task.setCurrentTimeFrame(self.currentTime, self.currentFrame)