Răsfoiți Sursa

latest test fixes

David Rose 21 ani în urmă
părinte
comite
6f1811be80

+ 20 - 12
direct/src/controls/ControlManager.py

@@ -30,25 +30,33 @@ class ControlManager:
         inputState.watch("run", "running-on", "running-off")
         
         inputState.watch("forward", "arrow_up", "arrow_up-up")
-        inputState.watch("forward", "control-arrow_up", "control-arrow_up-up")
-        inputState.watch("forward", "alt-arrow_up", "alt-arrow_up-up")
-        inputState.watch("forward", "shift-arrow_up", "shift-arrow_up-up")
+        inputState.watch("forward", "control-arrow_up", "arrow_up-up")
+        inputState.watch("forward", "shift-control-arrow_up", "arrow_up-up")
+        inputState.watch("forward", "alt-arrow_up", "arrow_up-up")
+        inputState.watch("forward", "alt-control-arrow_up", "arrow_up-up")
+        inputState.watch("forward", "shift-arrow_up", "arrow_up-up")
         
         inputState.watch("reverse", "arrow_down", "arrow_down-up")
-        inputState.watch("reverse", "control-arrow_down", "control-arrow_down-up")
-        inputState.watch("reverse", "alt-arrow_down", "alt-arrow_down-up")
-        inputState.watch("reverse", "shift-arrow_down", "shift-arrow_down-up")
-        
+        inputState.watch("reverse", "control-arrow_down", "arrow_down-up")
+        inputState.watch("reverse", "shift-control-arrow_down", "arrow_down-up")
+        inputState.watch("reverse", "alt-arrow_down", "arrow_down-up")
+        inputState.watch("reverse", "alt-control-arrow_down", "arrow_down-up")
+        inputState.watch("reverse", "shift-arrow_down", "arrow_down-up")
+
         inputState.watch("turnLeft", "arrow_left", "arrow_left-up")
-        inputState.watch("turnLeft", "control-arrow_left", "control-arrow_left-up")
+        inputState.watch("turnLeft", "control-arrow_left", "arrow_left-up")
+        inputState.watch("turnLeft", "shift-control-arrow_left", "arrow_left-up")
         inputState.watch("turnLeft", "alt-arrow_left", "alt-arrow_left-up")
-        inputState.watch("turnLeft", "shift-arrow_left", "shift-arrow_left-up")
+        inputState.watch("turnLeft", "alt-control-arrow_left", "alt-arrow_left-up")
+        inputState.watch("turnLeft", "shift-arrow_left", "arrow_left-up")
         inputState.watch("turnLeft", "mouse-look_left", "mouse-look_left-done")
         
         inputState.watch("turnRight", "arrow_right", "arrow_right-up")
-        inputState.watch("turnRight", "control-arrow_right", "control-arrow_right-up")
-        inputState.watch("turnRight", "alt-arrow_right", "alt-arrow_right-up")
-        inputState.watch("turnRight", "shift-arrow_right", "shift-arrow_right-up")
+        inputState.watch("turnRight", "control-arrow_right", "arrow_right-up")
+        inputState.watch("turnRight", "shift-control-arrow_right", "arrow_right-up")
+        inputState.watch("turnRight", "alt-arrow_right", "arrow_right-up")
+        inputState.watch("turnRight", "alt-control-arrow_right", "arrow_right-up")
+        inputState.watch("turnRight", "shift-arrow_right", "arrow_right-up")
         inputState.watch("turnRight", "mouse-look_right", "mouse-look_right-done")
         
         inputState.watch("jump", "control", "control-up")

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

@@ -593,6 +593,8 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
             self.handleGoGetLost(di)
         elif msgType == CLIENT_HEARTBEAT:
             self.handleServerHeartbeat(di)
+        elif msgType == CLIENT_SYSTEM_MESSAGE:
+            self.handleSystemMessage(di)
         elif wantOtpServer:
             if msgType == CLIENT_CREATE_OBJECT_REQUIRED:
                 self.handleGenerateWithRequired(di)
@@ -604,8 +606,6 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
                 self.handleDisable(di)
             elif msgType == CLIENT_OBJECT_DELETE_RESP:
                 self.handleDelete(di)
-            elif msgType == CLIENT_SYSTEM_MESSAGE:
-                self.handleSystemMessage(di)
             elif msgType == CLIENT_CREATE_OBJECT_REQUIRED:
                 self.handleGenerateWithRequired(di)
             elif msgType == CLIENT_CREATE_OBJECT_REQUIRED_OTHER:

+ 18 - 8
direct/src/distributed/DistributedObject.py

@@ -301,27 +301,37 @@ class DistributedObject(PandaObject):
         # handling whatever it should handle in its current state, it
         # should call doneBarrier(), which will send the context
         # number back to the AI.
-        for context, avIds in data:
+        for context, name, avIds in data:
             if base.localAvatar.doId in avIds:
                 # We found localToon's id; stop here.
-                self.__barrierContext = context
-                assert(self.notify.debug('setBarrierData(%s)' % (context)))
+                self.__barrierContext = (context, name)
+                assert(self.notify.debug('setBarrierData(%s, %s)' % (context, name)))
                 return
                 
         assert(self.notify.debug('setBarrierData(%s)' % (None)))
         self.__barrierContext = None
         
-    def doneBarrier(self):
-        # Tells the AI we have finished handling our task.
-        assert(self.notify.debug('doneBarrier(%s)' % (self.__barrierContext)))
+    def doneBarrier(self, name = None):
+        # Tells the AI we have finished handling our task.  If the
+        # optional name parameter is specified, it must match the
+        # barrier name specified on the AI, or the barrier is ignored.
+        # This is used to ensure we are not clearing the wrong
+        # barrier.
 
         # If this is None, it either means we have called
         # doneBarrier() twice, or we have not received a barrier
         # context from the AI.  I think in either case it's ok to
         # silently ignore the error.
         if self.__barrierContext != None:
-            self.sendUpdate("setBarrierReady", [self.__barrierContext])
-            self.__barrierContext = None
+            context, aiName = self.__barrierContext
+            if name == None or name == aiName:
+                assert(self.notify.debug('doneBarrier(%s, %s)' % (context, aiName)))
+                self.sendUpdate("setBarrierReady", [context])
+                self.__barrierContext = None
+            else:
+                assert(self.notify.debug('doneBarrier(%s) ignored; current barrier is %s' % (name, aiName)))
+        else:
+            assert(self.notify.debug('doneBarrier(%s) ignored; no active barrier.' % (name)))
     
     if wantOtpServer:
         def addInterest(self, zoneId, note="", event=None):

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

@@ -379,7 +379,7 @@ class DistributedObjectAI(DirectObject.DirectObject):
 
         if avIds:
             barrier = ToonBarrier.ToonBarrier(
-                self.uniqueName(name), avIds, timeout,
+                name, self.uniqueName(name), avIds, timeout,
                 doneFunc = PythonUtil.Functor(self.__barrierCallback, context, callback))
             self.__barriers[context] = barrier
 
@@ -399,7 +399,7 @@ class DistributedObjectAI(DirectObject.DirectObject):
         for context, barrier in self.__barriers.items():
             toons = barrier.pendingToons
             if toons:
-                data.append((context, toons))
+                data.append((context, barrier.name, toons))
         return data
 
     def ignoreBarrier(self, context):