diff options
author | Florian Jung <flo@windfisch.org> | 2016-03-02 15:26:22 +0100 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2016-03-02 15:26:22 +0100 |
commit | 04acf7e45d08878733b0d0a0d65f319f6d14d224 (patch) | |
tree | 7866f1cfe216fc2d9a5b7221688ee344f949b490 | |
parent | dfb1e0d7e8b62dd72a5370b2aa8e2e07236189ce (diff) |
-rw-r--r-- | main.py | 5 | ||||
-rw-r--r-- | subscriber.py | 8 |
2 files changed, 13 insertions, 0 deletions
@@ -151,6 +151,11 @@ try: # main loop while gui.running: c.on_message() + + if not sub.isNewFrame(): + continue + + if clock.tic() > 1./20: print("NETWORK LAG") probs.report("network lag") diff --git a/subscriber.py b/subscriber.py index 164257b..7ebe375 100644 --- a/subscriber.py +++ b/subscriber.py @@ -120,6 +120,12 @@ class EnhancingSubscriber(DummySubscriber): self.history = {} self.time = 0 self.victims = {} + self.newFrame = False + + def isNewFrame(self): + tmp = self.newFrame + self.newFrame = False + return tmp def set_client(self,c): self.c = c @@ -148,6 +154,8 @@ class EnhancingSubscriber(DummySubscriber): pass def on_world_update_post(self): + self.newFrame = True + self.c.world.time = self.time self.time += 1 |