From 4a58fb5e8bc547ff4ccec4426bea497766f3415a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Gl=C3=BCpker?= Date: Mon, 4 Jun 2018 20:02:42 +0200 Subject: Use unpackt to parse Query result --- QueryServer.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/QueryServer.py b/QueryServer.py index 43a8fd6..5193a2b 100755 --- a/QueryServer.py +++ b/QueryServer.py @@ -180,8 +180,7 @@ class QueryServer(): player['name'] = player_name.decode('utf-8', errors='replace') playerdata = playerdata[nullterm+1:] - playerscore = (playerdata[3] << 24) + (playerdata[2] << 16) + \ - (playerdata[1] << 8) + (playerdata[0]) + playerscore = int(struct.unpack('i', playerdata[0:4])[0]) player['score'] = playerscore playerdata = playerdata[4:] -- cgit v1.2.3