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

Privacy information link


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alphaearth
Senior Member
Join Date: Feb 2018
Location: Turkey
Old 12-01-2019 , 09:34   Privacy information link
Reply With Quote #1

Code:
http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key={key}&appids_filter[0]={game}&steamid={steamid}&format=json
http://api.steampowered.com/ISteamUser/GetFriendList/v0001/?key={key}&steamid={steamid}&relationship=friend&format=json
The above 2 links provide game time and profile privacy information.
These links are not working properly right now.

Can you share the right links?
__________________

Last edited by alphaearth; 12-01-2019 at 15:59. Reason: edit link
alphaearth is offline
NomisCZ
AlliedModders Donor
Join Date: Mar 2014
Location: Czech_Republic
Old 12-02-2019 , 12:26   Re: Privacy information link
Reply With Quote #2

Quote:
Originally Posted by alphaearth View Post
Code:
http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key={key}&appids_filter[0]={game}&steamid={steamid}&format=json
http://api.steampowered.com/ISteamUser/GetFriendList/v0001/?key={key}&steamid={steamid}&relationship=friend&format=json
The above 2 links provide game time and profile privacy information.
These links are not working properly right now.

Can you share the right links?
GetOwnedGames returns a list of games a player owns along with some playtime information, if the profile is publicly visible. Private, friends-only, and other privacy settings are not supported unless you are asking for your own personal details (ie the WebAPI key you are using is linked to the steamid you are requesting).

Code:
https://api.steampowered.com/IPlayerService/GetOwnedGames/v1/?key={key}&steamid={steamid}
Returns the friend list of any Steam user, provided their Steam Community profile visibility is set to "Public".
Code:
https://api.steampowered.com/ISteamUser/GetFriendList/v1/?key={key}&steamid={steamid}
This should help you: https://steamapi.xpaw.me/
__________________

Last edited by NomisCZ; 12-02-2019 at 12:28.
NomisCZ is offline
alphaearth
Senior Member
Join Date: Feb 2018
Location: Turkey
Old 12-02-2019 , 16:14   Re: Privacy information link
Reply With Quote #3

The plugin was already running. It no longer works properly. Can you check the codes?

Other plugins don't do exactly what I want. With this add-on, I can get players to play according to game time. But the profile is open, the game hours is off, the player can enter the server. Even if the specified game time is lower.

PHP Code:
#include <sourcemod>
#include <SteamWorks>
char apiTimeUrl[256] , apiSecretUrl[256] , apiSecretToken[64] , adminFlag[26];
ConVar c_secretProfilLogin c_playedTimeLogin c_apiSecretToken c_adminLoginFlags;
StringMap adminFlags;

public 
void OnPluginStart()
{
    
LoadTranslations("secret_profile.phrases");
    
setFlags();
    
c_apiSecretToken    CreateConVar("secret_api_key" "");
    
c_playedTimeLogin   CreateConVar("secret_time""150");
    
c_secretProfilLogin CreateConVar("secret_login""1");
    
c_adminLoginFlags   CreateConVar("secret_admin_flags" "a" );
    
AutoExecConfig(true"secret_profile""sourcemod");
    
FormatapiTimeUrl 256 "http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key={key}&appids_filter[0]={game}&steamid={steamid}&format=json" );
    
FormatapiSecretUrl 256 "http://api.steampowered.com/ISteamUser/GetFriendList/v0001/?key={key}&steamid={steamid}&relationship=friend&format=json" );
}

public 
void OnClientPostAdminCheck (int client)
{
    
checkPlayerSecretProfilclient );
}

stock void getTimeApiFormat(char[] steamid char[] str int len)
{
    
c_apiSecretToken.GetStringapiSecretToken 64 );
    
Formatstr len apiTimeUrl);
     
ReplaceString(strlen"{key}"apiSecretToken);
     
ReplaceString(strlen"{game}""730");
     
ReplaceString(strlen"{steamid}"steamid);
}

stock void getSecretApiFormat(char[] steamid char[] str int len)
{
    
c_apiSecretToken.GetStringapiSecretToken 64 );
    
Formatstr len apiSecretUrl);
     
ReplaceString(strlen"{key}"apiSecretToken);
     
ReplaceString(strlen"{steamid}"steamid);
}

void checkPlayerSecretProfilint clientID )
{
    
char steamid[18];
    if( 
GetClientAuthId(clientIDAuthId_SteamID64steamid 18) )
    {
        if ( !
checkAdminFlagsGetUserFlagBitsclientID ) ) )
        {
            if( 
c_playedTimeLogin.IntValue != )
                
playedTimeControlsteamid clientID );
            if( 
c_secretProfilLogin.IntValue != )
                
secretProfilControlsteamid clientID );
        }
    }
    else
    {
        
setLogError("Oyuncu STEAMID Doğrulaması Başarısız");
    }


bool checkAdminFlagsint flag )
{
    
int value;
    
char _value[30];
    
c_adminLoginFlags.GetStringadminFlag 30 );
    for( 
int i 0sizeofadminFlag ); i++ )
    {    
        if( 
adminFlag] == )
            return 
false;
        
_value substradminFlag );
        
adminFlags.GetValue_value value);
        if( 
flag value )
            return 
true;
    }
    return 
false;
}

void setFlags()
{
    
adminFlags = new StringMap();
    
adminFlags.SetValue("a" ADMFLAG_RESERVATION );
    
adminFlags.SetValue("b" ADMFLAG_GENERIC );
    
adminFlags.SetValue("c" ADMFLAG_KICK );
    
adminFlags.SetValue("d" ADMFLAG_BAN );
    
adminFlags.SetValue("e" ADMFLAG_UNBAN );
    
adminFlags.SetValue("f" ADMFLAG_SLAY );
    
adminFlags.SetValue("g" ADMFLAG_CHANGEMAP );
    
adminFlags.SetValue("h" ADMFLAG_CONVARS );
    
adminFlags.SetValue("i" ADMFLAG_CONFIG );
    
adminFlags.SetValue("j" ADMFLAG_CHAT );
    
adminFlags.SetValue("k" ADMFLAG_VOTE );
    
adminFlags.SetValue("l" ADMFLAG_PASSWORD );
    
adminFlags.SetValue("m" ADMFLAG_RCON );
    
adminFlags.SetValue("n" ADMFLAG_CHEATS );
    
adminFlags.SetValue("z" ADMFLAG_ROOT );
    
adminFlags.SetValue("o" ADMFLAG_CUSTOM1 );
    
adminFlags.SetValue("p" ADMFLAG_CUSTOM2 );
    
adminFlags.SetValue("q" ADMFLAG_CUSTOM3 );
    
adminFlags.SetValue("r" ADMFLAG_CUSTOM4 );
    
adminFlags.SetValue("s" ADMFLAG_CUSTOM5 );
    
adminFlags.SetValue("t" ADMFLAG_CUSTOM6 );
}

stock char substr(char[] inpstrint startposint len=-1)
{
    
char outstr[20];
    
strcopy(outstr20 inpstr[startpos]);
    
outstr[len] = 0;
    return 
outstr
}

void secretProfilControlchar[] steamid int clientID )
{
    
char apiFormatUrl[256];
    
getSecretApiFormat(steamid apiFormatUrl 256);
    
Handle request SteamWorks_CreateHTTPRequest(EHTTPMethod:1apiFormatUrl);
    if( 
request )
    {
        
SteamWorks_SetHTTPRequestContextValue(requestclientID);
        
SteamWorks_SetHTTPCallbacks(requestsecretProfil_OnHTTPResponse);
        
SteamWorks_SendHTTPRequest(request);    
    }
    else
    {
        
setLogError("Steam Secret IP Bağlantısı Başarısız");
    }
}

void playedTimeControl(char[] steamid int clientID )
{
    
char apiFormatUrl[256];
    
getTimeApiFormat(steamid apiFormatUrl 256);
    
Handle request SteamWorks_CreateHTTPRequest(EHTTPMethod:1apiFormatUrl);
    if( 
request )
    {
        
SteamWorks_SetHTTPRequestContextValue(requestclientID);
        
SteamWorks_SetHTTPCallbacks(requestTimePlayed_OnHTTPResponse);
        
SteamWorks_SendHTTPRequest(request);
    }
    else
    {
        
setLogError("Steam Time IP Bağlantısı Başarısız");
    }
}

public 
TimePlayed_OnHTTPResponse(Handle requestbool bFailurebool bRequestSuccessfulEHTTPStatusCode eStatusCode,int client)
{
    if ( 
bFailure || !bRequestSuccessful || eStatusCode != EHTTPStatusCode:200 )
    {
        
setLogError("Steam TimePlayed_OnHTTPResponse IP Bağlantısı Başarısız");
        
CloseHandle(request);
        return;
    }
    
int iBufferSize 0;
    
SteamWorks_GetHTTPResponseBodySize(requestiBufferSize);
    
char[] result = new char[iBufferSize];
    
SteamWorks_GetHTTPResponseBodyData(requestresultiBufferSize);
    
int playedTime playedGetTimeUserresult );
    if( 
playedTime <= )
    {
        if( 
c_secretProfilLogin.IntValue != )
            
KickClientclient "%t" "Kick Mesaj");
    }
    else
    {
        if( 
c_playedTimeLogin.IntValue && ( playedTime 60 ) < c_playedTimeLogin.IntValue)
            
KickClientclient "%t" "Kick Saat Mesaj" c_playedTimeLogin.IntValue);
    }
    
CloseHandle(request);
    return;
}

public 
secretProfil_OnHTTPResponse(Handle requestbool bFailurebool bRequestSuccessfulEHTTPStatusCode eStatusCode,int client)
{
    if( 
eStatusCode == EHTTPStatusCode:401 )
    {
        if( 
c_secretProfilLogin.IntValue != 0)
            
KickClientclient "%t" "Kick Mesaj");
        
CloseHandle(request);
        return;            
    }
    else if ( 
bFailure || !bRequestSuccessful || eStatusCode != EHTTPStatusCode:200 )
    {
        
setLogError("Steam secretProfil_OnHTTPResponse IP Bağlantısı Başarısız");
        
CloseHandle(request);
        return;
    }
    
int iBufferSize 0;
    
SteamWorks_GetHTTPResponseBodySize(requestiBufferSize);
    
char[] result = new char[iBufferSize];
    
SteamWorks_GetHTTPResponseBodyData(requestresultiBufferSize);
    
int secretProfile secretProfileUserresult );
    if( 
c_secretProfilLogin.IntValue != && secretProfile)
        
KickClientclient "%t" "Kick Mesaj");
    
CloseHandle(request);
    return;
}

bool secretProfileUserchar[] result )
{
    
char str2[2][64];
    
ExplodeString(result"\"friendslist\""str2sizeof(str2), sizeof(str2[]));
    if( !
StrEqual(str2[1] , "") )
        return 
false;
    return 
true;
}

int playedGetTimeUserchar[] result )
{
    
char str2[2][64];
    
ExplodeString(result"\"playtime_forever\":"str2sizeof(str2), sizeof(str2[]));
    if( !
StrEqual(str2[1] , "") )
    {
        
char lastString[2][64];
        
ExplodeString(str2[1], "}"lastStringsizeof(lastString), sizeof(lastString[]));
        return 
StringToIntlastString[0] );
    }
    
// secret profil
    
return -1;
}

void setLogError(char[] message)
{
    
LogError("LOG => %s" message);

__________________

Last edited by alphaearth; 12-02-2019 at 16:15.
alphaearth is offline
Reply



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 15:54.


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