Skip to content

Commit 6ef366b

Browse files
committed
Added cubeserver version to status from API
1 parent 241a11b commit 6ef366b

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

servercom/implementations/circuitpy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def get_status(self) -> GameStatus:
392392
resp_json = loads(resp[1])
393393
if self.v:
394394
print(f"It is {resp_json['unix_time']} seconds since the epoch.")
395-
return GameStatus(Time(resp_json['unix_time']), resp_json['status']['score'])
395+
return GameStatus(Time(resp_json['unix_time']), resp_json['status']['score'], resp_json['CubeServer_version'])
396396

397397
def sync_time(self) -> bool:
398398
"""Syncs the current clock against the server"""

servercom/implementations/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
GameStatus = namedtuple("GameStatus",
1717
['time',
18-
'score']
18+
'score',
19+
'CubeServer_version']
1920
)
2021

2122
HTTPResponse = namedtuple("HTTPResponse",

servercom/implementations/cpy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ def get_status(self) -> GameStatus:
337337
"""
338338
resp = self.request('GET', '/status')
339339
resp_json = loads(resp[1])
340-
return GameStatus(Time(resp_json['unix_time']), resp_json['status']['score'])
340+
return GameStatus(Time(resp_json['unix_time']), resp_json['status']['score'], resp_json['CubeServer_version'])
341341

342342
def sync_time(self) -> bool:
343343
"""Syncs the current clock against the server"""

0 commit comments

Comments
 (0)