From 279db709a3ee85a8eb09c399c725a8cfda6ff895 Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 19 Feb 2003 23:27:56 +0000 Subject: [PATCH] better time tracking from AI, better cheesy effect logging --- direct/src/distributed/ClientRepository.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/direct/src/distributed/ClientRepository.py b/direct/src/distributed/ClientRepository.py index 91e18269ef..84a4996aef 100644 --- a/direct/src/distributed/ClientRepository.py +++ b/direct/src/distributed/ClientRepository.py @@ -25,7 +25,8 @@ class ClientRepository(DirectObject.DirectObject): self.doId2cdc={} self.parseDcFile(dcFileName) self.cache=CRCache.CRCache() - + self.serverDelta = 0 + # Set this to 'http' to establish a connection to the server # using the HTTPClient interface, which ultimately uses the # OpenSSL socket library (even though SSL is not involved). @@ -53,6 +54,22 @@ class ClientRepository(DirectObject.DirectObject): self.tcpConn = None return None + def setServerDelta(self, delta): + """ + Indicates the approximate difference in seconds between the + client's clock and the server's clock, in universal time (not + including timezone shifts). This is mainly useful for + reporting synchronization information to the logs; don't + depend on it for any precise timing requirements. + + Also see Notify.setServerDelta(), which also accounts for a + timezone shift. + """ + self.serverDelta = delta + + def getServerDelta(self): + return self.serverDelta + def parseDcFile(self, dcFileName): self.dcFile = DCFile() readResult = self.dcFile.read(dcFileName)