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

Vanilla Counter-Strike:Global Offensive server returns invalid value in response_type #29

Open
fantoms opened this issue Jan 4, 2016 · 1 comment

Comments

@fantoms
Copy link
Contributor

fantoms commented Jan 4, 2016

An error producing issue was observed after creating 3 brand new CS:GO servers. If host_players_show does not equal 2, responses using the following code are returning a BrokenMessageError exception:

# !/usr/bin/python3.4

import time
import valve.source.a2s

address = ('65.103.35.106', 27015)

while(True):
  try:
      server = valve.source.a2s.ServerQuerier(address)
      info = server.info()
      players = server.players()
      print("{player_count}/{max_players} {server_name}".format(**info))
      for player in sorted(players["players"],
          key=lambda p: p["score"], reverse=True):
              print("{score} {name}".format(**player))
  except valve.source.messages.BrokenMessageError as ErrorMsg:
      print("!******\* Broken server response ********! " , ErrorMsg)
  except valve.source.a2s.NoResponseError:
      print("Server request timed out!")
  time.sleep(1)

Error string from BrokenMessageException:
Invalid value (68) for field 'response_type'

The issue was resolved remotely by setting a host cvar variable on the cs:go server cfg file to allow for "old format" player reporting:
host_players_show 2

To duplicate this error set host_players_show 1

Warning:CS:GO Server by default returns only max players and server uptime. You have to change server cvar "host_players_show" in server.cfg to value "2" if you want to revert to old format with players list

Valve reference: https://developer.valvesoftware.com/wiki/Server_queries#A2S_PLAYER

@Yepoleb
Copy link
Member

Yepoleb commented Nov 7, 2017

The problem here is that the server sends the player response right away without requiring a challenge number. It will be fixed once cdf5bd9 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants