Browse Source

fix exception on empty response in get_server_list

0.9
Rossen Georgiev 7 years ago
parent
commit
b9884068c6
  1. 14
      steam/client/builtins/gameservers.py

14
steam/client/builtins/gameservers.py

@ -103,16 +103,20 @@ class SteamGameServers(object):
resp = self.steam.unified_messages.send_and_wait("GameServers.GetServerList#1", { resp = self.steam.unified_messages.send_and_wait("GameServers.GetServerList#1", {
"filter": filter_text, "filter": filter_text,
"limit": max_servers, "limit": max_servers,
}, timeout=30) }, timeout=20)
if resp is None: return None if resp is None:
return None
resp = proto_to_dict(resp) resp = proto_to_dict(resp)
for server in resp['servers']: if not resp:
server['steamid'] = SteamID(server['steamid']) return []
else:
for server in resp['servers']:
server['steamid'] = SteamID(server['steamid'])
return resp['servers'] return resp['servers']
def get_ips_from_steamid(self, server_steam_ids): def get_ips_from_steamid(self, server_steam_ids):
"""Resolve IPs from SteamIDs """Resolve IPs from SteamIDs

Loading…
Cancel
Save