diff options
author | Florian Jung <flo@windfisch.org> | 2015-08-30 17:19:41 +0200 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2015-08-30 17:19:41 +0200 |
commit | f88995ed18fa57ddb7ce7b00003e025f67d0db11 (patch) | |
tree | 3e3f3a850354bda1aca662ebb58bf0c9c6af405e /subscriber.py | |
parent | 87ed12e22d6319ad43bfb11a6da1ded39d7ba74e (diff) |
collect more data
Diffstat (limited to 'subscriber.py')
-rw-r--r-- | subscriber.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/subscriber.py b/subscriber.py index cedee99..483ae04 100644 --- a/subscriber.py +++ b/subscriber.py @@ -81,11 +81,14 @@ class EnhancingSubscriber(DummySubscriber): def __init__(self): self.c = None self.history = {} + self.time = 0 def set_client(self,c): self.c = c def on_world_update_post(self): + self.c.world.time = self.time + self.time += 1 # create and purge poslog history, movement and movement_angle for cid in self.history: @@ -105,6 +108,10 @@ class EnhancingSubscriber(DummySubscriber): for cid in self.c.world.cells: cell = self.c.world.cells[cid] + + if not hasattr(cell, "spawntime"): + cell.spawntime = self.c.world.time + try: oldpos = cell.poslog[-3-1] cell.movement = (cell.pos - oldpos)/3 |