Techno Posted October 30, 2016 Report Share Posted October 30, 2016 How would you go about coding a method in which a steamid is within a config file, and upon a trigger it gets the server that the client is on, if at all, and then henceforth gets the map that the server is on. Planned to implement with twitch as a !map command. Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted October 30, 2016 Report Share Posted October 30, 2016 This is one of those things that has multiple solutions, and even then won't always work. For example, CS:GO by default won't announce game server IPs to Steam friends, so you can't see what map someone is playing in CS:GO if they haven't enabled that client-side option. However, for games that do announce to Steam, this is probably the easiest way: 1. Call GetPlayerSummaries for the user in question to get their game server SteamID (e.g. "gameserversteamid": "90104923353593862",)2. Call GetServerList to look up the data for that server (e.g. https://api.steampowered.com/IGameServersService/GetServerList/v1/?key=xxx&limit=1&filter=\steamid\90104923353593862) This will give you the data for that server: { "response": { "servers": [ { "addr": "195.154.166.219:27015", "gameport": 27015, "steamid": "90104923353593862", "name": "Meta Construct - how do u carate your charecter", "appid": 4000, "gamedir": "garrysmod", "version": "16.04.30", "product": "garrysmod", "region": 3, "players": 37, "max_players": 123, "bots": 0, "map": "gm_construct_m_222", "secure": false, "dedicated": true, "os": "l", "gametype": " gm:sandbox" } ] } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.