浏览代码

move suggestResync to DistributedSmoothNode

David Rose 22 年之前
父节点
当前提交
f12cb81d9d
共有 1 个文件被更改,包括 16 次插入0 次删除
  1. 16 0
      direct/src/distributed/DistributedSmoothNode.py

+ 16 - 0
direct/src/distributed/DistributedSmoothNode.py

@@ -317,3 +317,19 @@ class DistributedSmoothNode(DistributedNode.DistributedNode):
         else:
             NodePath.wrtReparentTo(self, parent)
 
+
+    ### Monitor clock sync ###
+
+    def d_suggestResync(self, avId):
+        self.sendUpdate("suggestResync", [avId])
+        
+    def suggestResync(self, avId):
+        """suggestResync(self, avId)
+
+        This message is sent from one client to another when the other
+        client receives a timestamp from this client that is so far
+        out of date as to suggest that one or both clients needs to
+        resynchronize with the AI.
+        """
+        if self.cr.timeManager != None:
+            self.cr.timeManager.synchronize("suggested by %d" % (avId))