SessionInfo json does not populate players array

Discussion in 'Bug Reports' started by Cselt, Jun 10, 2020.

  1. Cselt

    Cselt Member

    Joined:
    Jan 12, 2012
    Messages:
    83
    Likes Received:
    361
    Hi,

    I'm trying to get the name of the players connected to a given server and I use the SessionInfo HTTP api: <server-ip>:<http-port>/SessionInfo.

    That returns a json file, but the players array is always empty, however the playersCount shows the right number of players connected to the server.

    E.g.: query: curl curl 95.140.37.50:62297/SessionInfo
    Response:
    {
    "build":1119,
    "details":{
    "ai_vehicles":[ ],
    "aids":6160,
    "allowCCTransfers":2,
    "damage_mult":40,
    "finish_type":2,
    "fixed_setups":false,
    "fixed_upgrades":false,
    "game_name":"rFactor2",
    "in_development":false,
    "is_anonymous":false,
    "is_closed":false,
    "laps_left":2147483647,
    "mod_id":"AAA9999",
    "mod_version":"3.0",
    "package_name":"SIMCO-F1-2020-R7.rfmod",
    "packed_flags":55,
    "ping":0,
    "rules":2,
    "session":1,
    "shared_skins":false,
    "shared_vehs":true,
    "special_pack":0,
    "stream":0,
    "time_left":9900
    },
    "httpPort":62297,
    "isiOfficial":false,
    "lanIp":"0.0.0.0",
    "maxPlayers":45,
    "mod":{
    "layout":"G.P. de Canada",
    "location":"RaceRfactor Montreal 2013",
    "name":"SIMCO-F1-2020-R7",
    "sig":"66fe50becf8cc06a55dab338f7ccf78c8d8005bf43a7845d06fe87c6f4c10dca"
    },
    "name":"!SIMCO F12020",
    "passwordProtected":true,
    "playerCount":1, <- one player connected
    "players":[ ], <- empty
    "simulationPort":52297,
    "wanIp":"0.0.0.0"
    }

    I'm using rFactor build 1119.

    Can you please populate player array or can you give me a way to get the name of the players connected to a given server?

    Thanks
    Tamás
     
  2. Cselt

    Cselt Member

    Joined:
    Jan 12, 2012
    Messages:
    83
    Likes Received:
    361
    Anybody? :confused:
     
  3. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    886
    Likes Received:
    931
    I don't think this is much use but I have this snippet from Python code I wrote a couple of years ago using the Valve API

    Code:
              _server = valve.source.a2s.ServerQuerier(self.serversDict[serverName])
              try:
                info = _server.info()
                if info['player_count'] != 0:
                  self.players = []
                  players = _server.players()
                  _server.close()
                    for p in range(players.values['player_count']):
                        _player = players.values['players'][p].values['name']
    
    and it ran when I just tried it.

    Code:
    Server: STOCKWOOD RACERS SERVER (Portland Full Course)
    has these drivers
    Majorbristol
    MAGNUM
    Kajetan Ernie
    Clemente Herbert
    Maximino Virgilio
    I don't see any AI names the way I used to, though there are lists of empty strings on several servers['', '', '', '', ''], matching the number of players so maybe they are the AI
     
    Last edited: Jul 12, 2020
  4. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    886
    Likes Received:
    931

Share This Page