summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Glüpker <git@wgmd.de>2018-06-04 20:02:42 +0200
committerAndré Glüpker <git@wgmd.de>2018-06-04 20:02:42 +0200
commit4a58fb5e8bc547ff4ccec4426bea497766f3415a (patch)
tree7563b96d2d260c2b4f22c33c22bc166b4541a3a0
parentee6fe5419d2cb87301236023ddf10ea2f0503c83 (diff)
downloadsteam-4a58fb5e8bc547ff4ccec4426bea497766f3415a.tar.gz
steam-4a58fb5e8bc547ff4ccec4426bea497766f3415a.tar.bz2
steam-4a58fb5e8bc547ff4ccec4426bea497766f3415a.zip
Use unpackt to parse Query result
-rwxr-xr-xQueryServer.py3
1 files changed, 1 insertions, 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:]