AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   SteamTools (https://forums.alliedmods.net/forumdisplay.php?f=147)
-   -   Check client against custom community string (https://forums.alliedmods.net/showthread.php?t=271755)

Tentacle Master 09-19-2015 01:51

Check client against custom community string
 
I have a db where users insert their steam profiles in the form of:

http://steamcommunity.com/id/<custom username string>

As oppose to the http://steamcommunity.com/profiles/765611980* url

What is the easiest way, using steam tools hopefully, to check a connected client against my db of custom strings?

DarkDeviL 09-19-2015 07:37

Re: Check client against custom community string
 
Technically, it is possible to do - but not directly by using SteamTools / SteamWorks alone.

You would need to call the Steam API to resolve the vanity URL to the numerical format.

You didn't specify how exactly your users are inserting this into your DB, but under the assumption that this happens from a website, the easiest (and most likely best) way would be to to re-develop your website, and make your website handle the vanity URL resolving.

That way, you won't use your with your precious gaming resources on doing that, and your game servers can simply select the information they need, rather than first converting from one thing to another.

The call format to do it is to execute a HTTP call to
Code:

https://api.steampowered.com/ISteamUser/ResolveVanityURL/v0001/?key=STEAM_API_KEY&vanityurl=CUSTOM_USERNAME_STRING_HERE
Using the vanity URL "John", you would (at the time of writing this) receive a JSON response with:

Code:

{
        "response": {
                "steamid": "76561197985607672",
                "success": 1
        }

Meaning that those are the same user:
- http://steamcommunity.com/id/John
- http://steamcommunity.com/profiles/76561197985607672

By saving only "76561197985607672", and not "John" into your database, you wouldn't have to worry about users changing their vanity URL either.

I hope this helps you.


All times are GMT -4. The time now is 12:18.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.