From cd61056b908e3f78df80b73e34a25cd6ae129322 Mon Sep 17 00:00:00 2001 From: janton01 Date: Sat, 17 Dec 2016 18:23:56 -0500 Subject: [PATCH] Simple tests for cloud --- cloud.py | 4 ++-- testCloud.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cloud.py b/cloud.py index 2fbcf3b..79daf83 100644 --- a/cloud.py +++ b/cloud.py @@ -6,7 +6,6 @@ HI_P_CLOUD_DELAY = 10 MED_P_CLOUD_DELAY = 5 LOW_P_CLOUD_DELAY = 3 -NUM_PLAYERS = 10 class Cloud(object): @@ -21,6 +20,7 @@ def __init__(self, gameTraffic, location, timeout, num_players): else: self.timeToProcess = HIGH_P_CLOUD_DELAY + self.num_players = num_players self.location = location self.timeMS = 0 self.timeout = timeout @@ -36,7 +36,7 @@ def processResponse(self, time): return None else: responsePackets = [] - for i in range(1,NUM_PLAYERS): + for i in range(1,self.num_players): newPacket = headPacket # update packet diff --git a/testCloud.py b/testCloud.py index 0ed0441..37e951b 100644 --- a/testCloud.py +++ b/testCloud.py @@ -4,7 +4,7 @@ if __name__ == "__main__": packet1 = packet.Packet(0, 100, 0, 0, 1) - packet2 = packet.Packet(0, 100, 0, 0, 2) + packet2 = packet.Packet(0, 0, 0, 0, 2) cloud = cloud.Cloud(0, 0, 10, 10) cloud.receiveRequest(packet1)