From f88995ed18fa57ddb7ce7b00003e025f67d0db11 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Sun, 30 Aug 2015 17:19:41 +0200 Subject: collect more data --- subscriber.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'subscriber.py') 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 -- cgit v1.2.1