Error when displaying information about the CS 1.6 server. It works correctly for servers that have the Valve Anti-Cheat sign in CS client (as I understand, maybe wrong). For servers with VAC enabled but no VAC sign displayed, an error occurred. For example two servers without differents in Steam WebAPI:
First(don`t work)Second(work)
Code:
import valve.source
import valve.source.a2s
import valve.source.master_server
SERVER_ADDRESS = ('46.174.52.5', 27269)
with valve.source.a2s.ServerQuerier(SERVER_ADDRESS, timeout=5) as server:
info = server.info()
players = server.players()
print (server.ping())
print("{player_count}/{max_players} {server_name}".format(**info))
Error:
Traceback (most recent call last):
File "C:\Program Files (x86)\Python37-32\lib\site-packages\valve\source\messages.py", line 90, in validate
raise ValueError
ValueError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "test.py", line 11, in <module>
info = server.info()
File "C:\Program Files (x86)\Python37-32\lib\site-packages\valve\source\a2s.py", line 140, in info
return messages.InfoResponse.decode(self.get_response())
File "C:\Program Files (x86)\Python37-32\lib\site-packages\valve\source\messages.py", line 414, in decode
values[field.name], buffer = field.decode(buffer, values)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\valve\source\messages.py", line 40, in needs_buffer
return func(self, buffer, *args, **kwargs)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\valve\source\messages.py", line 130, in decode
struct.unpack(self.format, field_data)[0]), left_overs)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\valve\source\messages.py", line 94, in validate
value, self.name))
valve.source.messages.BrokenMessageError: Invalid value (109) for field 'response_type'
This is because the server uses the legacy query response, which is not implemented in this library. I've instead implemented it in Yepoleb/python-a2s, which is a rewrite of the query part.
Error when displaying information about the CS 1.6 server. It works correctly for servers that have the Valve Anti-Cheat sign in CS client (as I understand, maybe wrong). For servers with VAC enabled but no VAC sign displayed, an error occurred. For example two servers without differents in Steam WebAPI: First(don`t work) Second(work)
Code:
Error: