MCPcopy Create free account
hub / github.com/battlecode/battlecode-2018 / __init__

Method __init__

battlecode-manager/proxyuploader.py:4–23  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2
3class ProxyUploader():
4 def __init__(self):
5 self.red_id = 0
6 self.blue_id = 0
7 self.game_id = 0
8 self.game = None
9 self.start = time.time()
10 self.games_run = 0
11 self.id = random.choice(nonsense.NONSENSE) + '-' + random.choice(nonsense.NONSENSE)
12 self.done = False
13 if 'SCRIMMAGE_UPDATE_EVERY' in os.environ:
14 self.update_every = os.environ['SCRIMMAGE_UPDATE_EVERY']
15 else:
16 self.update_every = 1
17 if 'SCRIMMAGE_PROXY_URL' in os.environ:
18 self.url = os.environ['SCRIMMAGE_PROXY_URL']
19 self.secret = os.environ['SCRIMMAGE_PROXY_SECRET']
20 self.thread = threading.Thread(target=self.run_forever, args=(), daemon=True)
21 self.thread.start()
22 else:
23 print("Not chatting with scrimmage proxy.")
24
25 def run_forever(self):
26 while not self.done:

Callers

nothing calls this directly

Calls 1

startMethod · 0.45

Tested by

no test coverage detected