Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for GoldSrc responses #30

Closed
k0st1an opened this issue Jan 28, 2016 · 10 comments
Closed

Add support for GoldSrc responses #30

k0st1an opened this issue Jan 28, 2016 · 10 comments

Comments

@k0st1an
Copy link

k0st1an commented Jan 28, 2016

Example: doc
Error at info = server.info()

Traceback (most recent call last):
  File "./test.py", line 9, in <module>
    info = server.info()
  File "/home/kruglov/.virtualenvs/py-valve/local/lib/python2.7/site-packages/valve/source/a2s.py", line 156, in info
    return messages.InfoResponse.decode(self.get_response())
  File "/home/kruglov/.virtualenvs/py-valve/local/lib/python2.7/site-packages/valve/source/messages.py", line 415, in decode
    values[field.name], buffer = field.decode(buffer, values)
  File "/home/kruglov/.virtualenvs/py-valve/local/lib/python2.7/site-packages/valve/source/messages.py", line 41, in needs_buffer
    return func(self, buffer, *args, **kwargs)
  File "/home/kruglov/.virtualenvs/py-valve/local/lib/python2.7/site-packages/valve/source/messages.py", line 131, in decode
    struct.unpack(self.format, field_data)[0]), left_overs)
  File "/home/kruglov/.virtualenvs/py-valve/local/lib/python2.7/site-packages/valve/source/messages.py", line 95, in validate
    value, self.name))
valve.source.messages.BrokenMessageError: Invalid value (109) for field 'response_type'
@kirill-tsurkan
Copy link

Yep, can't get it working because of this error :(

@xer0nine
Copy link

xer0nine commented Nov 14, 2016

I am also having a similar error with the same example code:

Traceback (most recent call last):
  File "/Users/*****/PycharmProjects/steam_master_server_query/servertest.py", line 10, in <module>
    info = server.info()
AttributeError: 'ServerQuerier' object has no attribute 'info'

EDIT: For me the issue was due to having an older version of a2s.py in my library. Updated and resolved the issue.

@VatsalP
Copy link

VatsalP commented Feb 7, 2017

Installing using setup.py from git repo rather than pip solves this.

@vigilancer
Copy link

seems 109 (or x6D) is code for InfoResponse from Obsolete GoldSource servers.
https://developer.valvesoftware.com/wiki/Server_queries#Request_Format
not sure how this info makes any good without adding support for this into library.

anyway, in my case every second request failing with valve.source.messages.BrokenMessageError: Invalid value (109) for field 'response_type'.
surprisingly, every first gives me info without errors. guess I'll just query it twice, but still problem exists.

@vigilancer
Copy link

@darkchemist
no, this is not the same issue.

@VatsalP
are you sure you had same issue? failing to see how installation method can possibly fix response code support.

@Yepoleb
Copy link
Member

Yepoleb commented Nov 5, 2017

Can you provide a server address or at least a game name so I can try to reproduce this?

@nugasescuserbun
Copy link

Here's one:

from valve.source.a2s import ServerQuerier
address=("89.44.246.23",27015)
with ServerQuerier(address) as server:
    print(server.info())

@Yepoleb
Copy link
Member

Yepoleb commented Dec 31, 2017

@lxnch I just tested with this address and the info request works for me, the player request doesn't, but that seems to be a server side implementation error. Unfortunately it's not related to the original issue. Thank you for submitting the example though!

Edit: Oops, mixed up the issues and tested the address from #48 instead. This seems to be indeed the right issue and I will have a look later.

@Yepoleb
Copy link
Member

Yepoleb commented Jan 5, 2018

I was able to confirm that the server in question returns a 109 response, which is not handled correctly. This is to be expected from a CounterStrike server, as it runs on the older GoldSrc engine, which is currently not supported by this library. But while this is working as intended, I think adding support for GoldSrc responses should not be too difficult for the increase in compatibility it provides.

@Yepoleb Yepoleb changed the title Invalid value Add support for GoldSrc responses Jan 5, 2018
@Yepoleb
Copy link
Member

Yepoleb commented Jan 17, 2020

I've added support for GoldSrc in python-a2s

@k0st1an k0st1an closed this as completed Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants