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

7 days to die (7dtd) player names empty #40

Closed
zachross90210 opened this issue Oct 24, 2016 · 8 comments
Closed

7 days to die (7dtd) player names empty #40

zachross90210 opened this issue Oct 24, 2016 · 8 comments

Comments

@zachross90210
Copy link

zachross90210 commented Oct 24, 2016

index always 0, score always 0 too

players = server.get_players()
for player in players['players']:
    print player.items()
[(u'duration', 3707.952880859375), (u'index', 0), (u'score', 0), (u'name', u'')]
[(u'duration', 3146.773193359375), (u'index', 0), (u'score', 0), (u'name', u'')]
[(u'duration', 2702.712158203125), (u'index', 0), (u'score', 0), (u'name', u'')]
[(u'duration', 2188.73193359375), (u'index', 0), (u'score', 0), (u'name', u'')]
[(u'duration', 1989.33203125), (u'index', 0), (u'score', 0), (u'name', u'')]
[(u'duration', 1640.9486083984375), (u'index', 0), (u'score', 0), (u'name', u'')]
[(u'duration', 1288.8568115234375), (u'index', 0), (u'score', 0), (u'name', u'')]
[(u'duration', 1080.558349609375), (u'index', 0), (u'score', 0), (u'name', u'')]
[(u'duration', 1063.529541015625), (u'index', 0), (u'score', 0), (u'name', u'')]
[(u'duration', 1037.4505615234375), (u'index', 0), (u'score', 0), (u'name', u'')]
[(u'duration', 1037.064453125), (u'index', 0), (u'score', 0), (u'name', u'')]
[(u'duration', 1030.4398193359375), (u'index', 0), (u'score', 0), (u'name', u'')]
[(u'duration', 1029.0120849609375), (u'index', 0), (u'score', 0), (u'name', u'')]
[(u'duration', 927.1685791015625), (u'index', 0), (u'score', 0), (u'name', u'')]
[(u'duration', 831.4614868164062), (u'index', 0), (u'score', 0), (u'name', u'')]
[(u'duration', 287.7505798339844), (u'index', 0), (u'score', 0), (u'name', u'')]
@kirill-tsurkan
Copy link

Same thing, but for other game. For example:
"MaxPlayers":"72", "NumPlayers":"41", "Players":[ { "Name":"" }, { "Name":"" }, { "Name":"" }, { "Name":"" }, { "Name":"" }, { "Name":"" }, { "Name":"" }, { "Name":"GokuGM" }, { "Name":"Schultz_TcK" }, { "Name":"Levinthal" }, { "Name":"APOKALIPSE" }, { "Name":"BA.gLm" },...

@Holiverh
Copy link
Member

Holiverh commented Jul 6, 2017

Possibly related #42?

However, the example provided by @Megido6 is a little more concerning. It seems to not be able to get any names at all ... I'm assuming the above snippet hasn't been truncated. I might try to get my hands on a 7DTD server and have a closer look.

@danielunderwood
Copy link

For these errors, were you guys able to look at how many players were actually in the server? I opened #42 where the players with blank names weren't actually in the server so player_count was also incorrect and it'd be helpful to know if that's the same behavior you guys are seeing.

@Yepoleb
Copy link
Member

Yepoleb commented Nov 5, 2017

Steam can't query the players, so I'd file this as a server side bug. #42 is most likely not related to this.

@fosspill
Copy link

fosspill commented Feb 7, 2018

I'm experiencing this too, every single field returns values except the actual player names. Are we sure this is server side?

@Yepoleb
Copy link
Member

Yepoleb commented Feb 7, 2018

If you can provide an example where the response isn't parsed correctly I'm willing to take a look again.

@fosspill
Copy link

fosspill commented Feb 7, 2018

#!/usr/bin/env python
import time
import valve.source.a2s

SERVER = "85.236.100.48"
PORT = 25001

def serverinfo(server):
    result = None
    tries = 1
    while result is None and tries <= 3:
        try:
            serverdict = {}

            serverObj = valve.source.a2s.ServerQuerier(server)
            players = serverObj.players()
            if len(players) > 0:
                playernamelist = []
                playertimelist = []
                for player in players["players"]:
                    playernamelist.append(player["name"])
                    playertimelist.append(player["duration"])
                serverdict["playernames"] = playernamelist
                serverdict["playertimes"] = playertimelist
            serverdict["num_players"], serverdict["max_players"], serverdict["server_name"], serverdict["version"] = \
            serverObj.info()["player_count"], \
            serverObj.info()["max_players"], \
            serverObj.info()["server_name"], \
            serverObj.info()["version"]
            serverdict["ping"] = round(serverObj.ping())
            result = serverdict
        except Exception as e:
            print(e)
            time.sleep(1)
            tries += 1
            pass
    if not tries > 3:
        print(result)
    else:
        print("Tried too many times.")

serverinfo((SERVER, PORT))

Of course there are no players on at this very moment. Poke me and I'll jump on :)

@Yepoleb
Copy link
Member

Yepoleb commented Feb 8, 2018

I've added the server to my Steam client and could not get a single valid response after more than 20 refreshes. I'm looking for an example where the result is parsed correctly by some other client, but not by python-valve.

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

7 participants