Raised This Month: $12 Target: $400
 3% 

Check client against custom community string


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tentacle Master
Member
Join Date: Jan 2012
Old 09-19-2015 , 01:51   Check client against custom community string
Reply With Quote #1

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?
__________________
Maximum Online Gaming: Multi Tanks Maximum Spawn Servers (MTMS) Head Admin / Programmer

Plugins:
Automatic Main Menu Opener -public ||| My Little Pony Models Pack -public ||| No One Left4Dead -private ||| Fortspawn 2 -private

Last edited by Tentacle Master; 09-19-2015 at 01:52.
Tentacle Master is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 09-19-2015 , 07:37   Re: Check client against custom community string
Reply With Quote #2

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.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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