diff --git a/cloud.py b/cloud.py index bb0ae42..3484640 100644 --- a/cloud.py +++ b/cloud.py @@ -23,8 +23,6 @@ def step(self): and self.requestList.next().isReady(self.time) \ and len(responsePackets) <= MAX_PACKETS_PER_STEP: headPacket = self.requestList.pop() - if headPacket.arriveTime() < self.time: - headPacket.addLatency(self.time - headPacket.arriveTime()) for i in xrange(1, self.num_players + 1): newPacket = headPacket.deepcopy() newPacket.sender = 0 diff --git a/packet.py b/packet.py index d3a7eec..49c4e87 100644 --- a/packet.py +++ b/packet.py @@ -20,7 +20,9 @@ def arriveTime(self): return self.timestamp + self.elapsedTime def deepcopy(self): - return Packet(self.timestamp, self.receiver, self.sender, self.packet_id) + p = Packet(self.timestamp, self.receiver, self.sender, self.packet_id) + p.addLatency(self.elapsedTime) + return p # Packet priority queue, with packets ordered by arrival time class PacketQueue(object): diff --git a/results/test1.png b/results/test1.png index 8e73978..75dcdef 100644 Binary files a/results/test1.png and b/results/test1.png differ diff --git a/results/test2.png b/results/test2.png index 3f6f01e..f2ccfec 100644 Binary files a/results/test2.png and b/results/test2.png differ diff --git a/results/test3.png b/results/test3.png index b9f562c..5b08ae1 100644 Binary files a/results/test3.png and b/results/test3.png differ diff --git a/results/test4.png b/results/test4.png index 3f6f01e..14bb824 100644 Binary files a/results/test4.png and b/results/test4.png differ diff --git a/results/test5.png b/results/test5.png index cf350b2..1251596 100644 Binary files a/results/test5.png and b/results/test5.png differ