-
Notifications
You must be signed in to change notification settings - Fork 71
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
player_count incorrect and blank player names #42
Comments
Well this is weird. The problem seems to be gone now during the times the server isn't as active. Perhaps some players were left in the query after leaving the server or something? They didn't show up with a |
@danielunderwood It appears that the original dev abandoned this project. I'm maintaining a fork and merging PRs and squashing bugs over at https://github.com/thel3l/python-valve. Could you please provide some more data, preferably at the other fork? Thanks :) |
@thel3l I'll switch to your fork and open an issue there if I encounter the issue again. The tricky thing is that I haven't been able to reproduce the issue so far. It's only happened once besides the time that I reported it. |
@danielunderwood awesome, thanks 😃 |
I must say I'm not too impressed with my own "maintenance" of python-valve. Recent changes in circumstances for me should free up some time. Hence I've been looking at investing a bit of that time back into python-valve recently. Specifically, I've been trying to get a bearing on the development that's gone on in the various forks and trying to see what can be merged back in. @thel3l I must say I'm deeply appreciative of your voluntarily continuing the work I started. I'm yet to have a close look at it yet, but would you say that your fork is suitable for merging -- and, more importantly, would you be happy for me to do that? I could understand if you preferred, perhaps, to maintain your fork independently. Either way, 👍 for the care you and others have shown this sorely neglected library! @danielunderwood So ... I've always been acutely aware of the "empty player name" thing and how that can cause/relate to player counts being misleading. In fact, in a secondary project that depends on python-valve, I had an explicit work around for it. Would you say the assertion in the linked comment is consistent with the behaviour you're seeing? E.g., newly connected users show up blank. Note, I had mostly been observing that behaviour with TF2 servers circa 2015. If that is the same sorta thing you're getting, then my personal instinct would be to say that it's not strictly a bug in python-valve. As long as the behaviour isn't exhibited due to a flaw in the way python-valve implements the A2S protocol. My initial aim was for python-valve (at least the A2S bits referred to here) to be a relatively low-level interface for Source servers. An interface upon which higher abstractions could be built. Therefore, what the server returns is what the server returns. Python-valve isn't necessarily in a position to be too opinionated about that -- at least not at the |
@Holiverh - Yes! I would love to merge my fork back with the main project and I'll open a PR soon. Thanks for all the work that you've done, it's absolutely fantastic 😃 |
I'm not so sure that what I was seeing was due to newly connected players not showing up, although it certainly was happening when the server was more active and people were joining. From what I could tell, all the people that were actually in the server were showing up in The closest thing that I thought of were maybe players were leaving the server and their names were being removed, but were somehow still represented in the list of players. I would have tried to dig further, but the problem seems to be pretty rare. I'm considering throwing the data in a database for my project, which may give some info as to what's going on. For now, I'm just throwing away any players where the name is blank, which seems to produce the correct player names at least. I could probably take the length of that to correct the player number too, but haven't gotten to that point yet. |
So I've added various notices and a workaround about this in the docs with 6a699bb. Note sure what to do with it other than that though. Because, as I said, if a server is returning silly things then what position am I in to question that. Unless of course its an actual bug in python-valve that is; so I welcome any efforts you put into continuing to debug it -- hence I'm leaving this issue open. Alternately, I'm tempted to look at extending |
I'll take a look at the a2s decoding code when I get a chance to see if I can find anything that may be wrong. I suppose there's a chance the a2s format could have changed, but I'd imagine that they'd have some type of version built in for backwards compatibility. I found the following bug trackers for source and didn't see an issue like this in either: |
I just noticed this while trying to reproduce #55. It happens very inconsistently. The message still parses correctly, so I'm pretty sure the server is sending garbage here. I think we should try to match the steam behavior, which is to ignore the empty players. I'll do some more testing tomorrow though to be sure about this. Edit: The entries have a valid-looking but very short playtime. After some time the player name appears and continues to appear in every following response. I'm assuming these entries are players currently connecting to the server where the name is not yet known, but they still show up in the player count, so others know the spot is reserved. |
I've encountered a problem with player_count for Squad server yesterday. Usually number of blank names varies a bit but clears itself up somehow. Past few days it kept growing and growind and I ended up with constant 231 blank names in responses (server emptied meanwhile), meaning there was no more place for all actual (80 max) players in limited response of 255 players. |
Can you give us more details like server address or at least game name? |
Game is Squad, server IP is 79.136.73.35 and query port 27100. Server has since been restarted (12h ago). I'm not yet sure if blank names are accumulating again. |
I just tested with the steam server browser, the server does send the names somehow but not in a format the client understands. I may look into it at some point but can't make any promises as this is clearly an implementation error on the game's side. |
I'm querying a CSGO server and the returned
player_count
is incorrect through bothget_info()
andget_players()
.get_players()['players']
gets the players in the server, but also gets a number of players with blank names. If these blank names are removed fromplayer_count
, it's correct. Any idea of what's going on here?The text was updated successfully, but these errors were encountered: