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 ability to use the steam API as an alternative for Valve Master Server queries. #110

Open
CosminPerRam opened this issue Oct 2, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request protocol This is something regarding a protocol v1.0.X Things about v1.0.X
Milestone

Comments

@CosminPerRam
Copy link
Member

What is this feature about?
Add the possibility to use the steam API for the valve master server queries, this might or might not fix #106.

Additional context/references
On the documentation page for querying the Valve master server, there is a short description for querying the steam API as an alternative, but seems to be undocumented.

@CosminPerRam CosminPerRam added the enhancement New feature or request label Oct 2, 2023
@CosminPerRam CosminPerRam changed the title [Protocol] Add ability to use the steam API as an alternative for Valve Master Server queries. Add ability to use the steam API as an alternative for Valve Master Server queries. Oct 2, 2023
@CosminPerRam CosminPerRam self-assigned this Oct 2, 2023
@CosminPerRam CosminPerRam added the protocol This is something regarding a protocol label Oct 2, 2023
@cainthebest cainthebest added this to the Backlog milestone Sep 30, 2024
@cainthebest
Copy link
Collaborator

cainthebest commented Nov 7, 2024

i looked into this and i think it looks good, i was able to get this response from the steam api. it does need a api key but all you need is 1 game on a steam account to gen a key from https://steamcommunity.com/dev/apikey. when testing i just used "test" as the domain and it worked fine. still unsure on the filter field though here https://steamapi.xpaw.me/#IGameServersService/GetServerList.

Will re prioritize this as a v1 service

{
    "response": {
        "servers": [
            {
                "addr": "169.254.109.52:24712",
                "gameport": 24712,
                "steamid": "90208014253273118",
                "name": "(5)'s Server",
                "appid": 10,
                "gamedir": "cstrike",
                "version": "1.1.2.7/Stdio",
                "product": "cstrike",
                "region": -1,
                "players": 2,
                "max_players": 2,
                "bots": 0,
                "map": "cs_mansion",
                "secure": true,
                "dedicated": false,
                "os": "w"
            },
            {
                "addr": "169.254.136.14:27704",
                "gameport": 27704,
                "steamid": "90208014778927126",
                "name": "iOS-Andrei's Server",
                "appid": 10,
                "gamedir": "cstrike",
                "version": "1.1.2.7/Stdio",
                "product": "cstrike",
                "region": -1,
                "players": 5,
                "max_players": 32,
                "bots": 0,
                "map": "cs_assault",
                "secure": true,
                "dedicated": false,
                "os": "w"
            },
            {
                "addr": "169.254.186.27:7456",
                "gameport": 7456,
                "steamid": "90208015003881495",
                "name": "oapinilla's Server",
                "appid": 10,
                "gamedir": "cstrike",
                "version": "1.1.2.7/Stdio",
                "product": "cstrike",
                "region": -1,
                "players": 1,
                "max_players": 32,
                "bots": 30,
                "map": "de_vertigo",
                "secure": true,
                "dedicated": false,
                "os": "w"
            }
           // .... very long
        ]
    }
}

@cainthebest cainthebest modified the milestones: Backlog, v1.0.0-beta Nov 7, 2024
@cainthebest cainthebest added the v1.0.X Things about v1.0.X label Nov 7, 2024
@cainthebest
Copy link
Collaborator

found a post on stack on how someone was filtering the ip, i would assume filtering other props follow the same structure.

https://stackoverflow.com/questions/71612241/steam-api-how-to-query-a-server-to-get-server-info-not-using-a2s

php example:

    $url = "https://api.steampowered.com/IGameServersService/GetServerList/v1/?key=API_KEY&filter=addr\185.254.99.6:27015";
    $json = file_get_contents($url);
    $table2 = json_decode($json, true);
    $table = $table2["response"]["servers"][0];
    $mapname = $table['map'];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request protocol This is something regarding a protocol v1.0.X Things about v1.0.X
Projects
None yet
Development

No branches or pull requests

2 participants