AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Off-Topic (https://forums.alliedmods.net/forumdisplay.php?f=15)
-   -   Steam id 32 In PHP ? (https://forums.alliedmods.net/showthread.php?t=299218)

albisse 07-07-2017 12:41

Steam id 32 In PHP ?
 
Hello !

For my server i want i use the Steam ID so the Steam ID 32 like the Steam id who use source ban.
So i search and i have find that : https://stackoverflow.com/questions/...d64-to-steamid

But if you see the PHP code you can see :
" $steamID = "STEAM_0:" . (string)$steamX . ":" . (string)$steamY; "
So with that you must have steam ID like STEAM_0.
But i have : STEAM_1:0:32679369

So the Code don't work and i can't find a better code ...


Plz Help me ;)

Kxnrl 07-08-2017 02:57

Re: Steam id 32 In PHP ?
 
PHP Code:

function ConvertSteamID64To32($oriSteamID64)
{
    
$tsid = array(substr($oriSteamID64, -11) % == 1);
    
$tsid[1] = bcsub($oriSteamID64'76561197960265728');
    if(
bccomp($tsid[1], '0') != 1){
        
$STEAMID '';
    }
    
$tsid[1] = bcsub($tsid[1], $tsid[0]);
    list(
$tsid[1], ) = explode('.',bcdiv($tsid[1], 2), 2);
    
$STEAMID implode(':'$tsid);
    
$STEAMID 'STEAM_0:'.$STEAMID;
    return 
$STEAMID;



CamerDisco 07-08-2017 04:39

Re: Steam id 32 In PHP ?
 
https://github.com/sejbr/SIDClib

DarkDeviL 07-08-2017 04:48

Re: Steam id 32 In PHP ?
 
If we're up for sharing libraries rather than functions, this one has more to offer:

-> https://github.com/xPaw/SteamID.php

Works both with Player and Server Steam ID's etc....

albisse 07-08-2017 09:11

Re: Steam id 32 In PHP ?
 
Yes this is the same " STEAM_0 " this is always " STEAM_0" and no " STEAM_1".
So if i use your script, i cant match to my steam id because i have this stream id " STEAM_1:0:32679369 " with STEAM_1.

asherkin 07-15-2017 08:13

Re: Steam id 32 In PHP ?
 
The STEAM_0 or STEAM_1 prefix depends on the game, just ignore the first 8 characters when comparing.


All times are GMT -4. The time now is 01:20.

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