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

Block and Ban Family Sharing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
homerjsimpson
BANNED
Join Date: Feb 2009
Location: https://t.me/pump_upp
Old 04-20-2014 , 16:39   Block and Ban Family Sharing
Reply With Quote #1

It's possible identify and block/ban who're using the CSS with this Family Sharing ?!

If yes, how can I do this?


Regards
homerjsimpson is offline
Send a message via ICQ to homerjsimpson Send a message via AIM to homerjsimpson Send a message via Yahoo to homerjsimpson Send a message via Skype™ to homerjsimpson
klausenbusk
AlliedModders Donor
Join Date: Jan 2011
Old 04-20-2014 , 19:44   Re: Block and Ban Family Sharing
Reply With Quote #2

Quote:
Originally Posted by KorDen View Post
Tested: copied server to the PC without Steam - see random garbage. Installed Steam, updated it and close - see real ID. Uninstalled Steam - grabage. Downloaded and updated SteamCMD - garbage. Copied files from SDK - real ID

Attached MSVC10 project files. Using environment variables HL2SDK and STEAMWORKS_SDK, other paths are relative to sourcemod/extensions folder. It's enough for compile.

Also, here is simple fix for SB plugin (add this to the end of sourcebans.sp) that will just check if the user using Family sharing and if the owner banned.
PHP Code:
#include <SteamWorks>
public SW_OnValidateClient(OwnerSteamIDClientSteamID)
{
    if(
OwnerSteamID && OwnerSteamID!=ClientSteamID)
    {
        new 
tmp;
        for(new 
1<= MaxClientsi++)
        {
            if(
IsClientConnected(i))
            {
                
tmp GetSteamAccountID(i);
                if(
tmp && tmp == ClientSteamID)
                {
                    
decl String:steamid[32];
                    
Format(steamidsizeof(steamid),"STEAM_0:%d:%d", (OwnerSteamID 1), (OwnerSteamID >> 1));
                    
LogMessage("[SB] Checking FamilySharing user %L  Owner: %s (OSID: %d, CSID: %d)",i,steamid,OwnerSteamID,ClientSteamID);
                    
OnClientAuthorized(i,steamid);
                    break;
                }
            }
        }
    }

The only problem with this fix is that if OwnerID banned, than query in VerifyBan function that insert info into banlogs table will fail, because this ID will not be in banlist. I think that I need to modify VerifyBan query to select not only bid, but authid too.. I will try to realize it later.
Also, later I will try to modify banning system to ban only owner SteamID.
You just need to change the code a little bit. Requires SteamWork extension
klausenbusk is offline
sheo
SourceMod Donor
Join Date: Jul 2013
Location: Russia, Moscow
Old 04-21-2014 , 03:07   Re: Block and Ban Family Sharing
Reply With Quote #3

Final plugin
Code:
#include <sourcemod>
#include <SteamWorks>

public SteamWorks_OnValidateClient(ownerauthid, authid)
{
	if (ownerauthid > 0 && ownerauthid != authid)
	{
		decl String:SteamID[32];
		Format(SteamID, 32, "STEAM_1:%d:%d", (authid & 1), (authid >> 1));
		new client = GetIndexBySteamID(SteamID);
		if (client != -1)
		{
			KickClient(client, "Family Sharing users are not allowed to join this server");
		}
	}
}

GetIndexBySteamID(const String:SteamID[])
{
	decl String:AuthStringToCompareWith[32];
	for (new i = 1; i <= MaxClients; i++)
	{
		if (IsClientConnected(i) && GetClientAuthString(i, AuthStringToCompareWith, sizeof(AuthStringToCompareWith)) && StrEqual(AuthStringToCompareWith, SteamID))
		{
			return i;
		}
	}
	return -1;
}
And, same as above, it requires SteamWorks extension
sheo is offline
s.m.a.c head
Senior Member
Join Date: Apr 2012
Location: Liverpool
Old 06-14-2015 , 05:27   Re: Block and Ban Family Sharing
Reply With Quote #4

Quote:
Originally Posted by sheo View Post
Final plugin
Code:
#include <sourcemod>
#include <SteamWorks>

public SteamWorks_OnValidateClient(ownerauthid, authid)
{
	if (ownerauthid > 0 && ownerauthid != authid)
	{
		decl String:SteamID[32];
		Format(SteamID, 32, "STEAM_1:%d:%d", (authid & 1), (authid >> 1));
		new client = GetIndexBySteamID(SteamID);
		if (client != -1)
		{
			KickClient(client, "Family Sharing users are not allowed to join this server");
		}
	}
}

GetIndexBySteamID(const String:SteamID[])
{
	decl String:AuthStringToCompareWith[32];
	for (new i = 1; i <= MaxClients; i++)
	{
		if (IsClientConnected(i) && GetClientAuthString(i, AuthStringToCompareWith, sizeof(AuthStringToCompareWith)) && StrEqual(AuthStringToCompareWith, SteamID))
		{
			return i;
		}
	}
	return -1;
}
And, same as above, it requires SteamWorks extension
I have no access to my server compiler and I cant use the online one as it requires Steamworks, could someone compile this and upload it for me please?
s.m.a.c head is offline
uurbyrkdr
Senior Member
Join Date: Apr 2015
Old 06-14-2015 , 05:45   Re: Block and Ban Family Sharing
Reply With Quote #5

Done with 1 warning:

warning 234: symbol "GetClientAuthString" is marked as deprecated: Use GetClientAuthId
Attached Files
File Type: smx familyBan.smx (4.1 KB, 377 views)
File Type: sp Get Plugin or Get Source (familyBan.sp - 342 views - 759 Bytes)

Last edited by uurbyrkdr; 06-15-2015 at 22:07.
uurbyrkdr is offline
Darkness_
Veteran Member
Join Date: Nov 2014
Old 06-14-2015 , 15:37   Re: Block and Ban Family Sharing
Reply With Quote #6

Quote:
Originally Posted by uurbyrkdr View Post
Done with 1 warning:

warning 234: symbol "GetClientAuthString" is marked as deprecated: Use GetClientAuthId
GetClientAuthId(client, AuthId_Steam2, buffer, sizeof(buffer));

https://sm.alliedmods.net/new-api/cl...etClientAuthId

Last edited by Darkness_; 06-14-2015 at 15:38.
Darkness_ is offline
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 06-15-2015 , 14:56   Re: Block and Ban Family Sharing
Reply With Quote #7

Quote:
Originally Posted by uurbyrkdr View Post
Done with 1 warning:

warning 234: symbol "GetClientAuthString" is marked as deprecated: Use GetClientAuthId
Please provide the .sp as well since .smx binaries without it will be removed.
__________________
My plugins :
Red Maze
Afk Bomb
RAWR (per player/rounds Awp Restrict.)
Kill Assist
Be Medic

You can also Donate if you appreciate my work

Last edited by RedSword; 06-15-2015 at 14:56.
RedSword is offline
uurbyrkdr
Senior Member
Join Date: Apr 2015
Old 06-15-2015 , 22:08   Re: Block and Ban Family Sharing
Reply With Quote #8

Quote:
Originally Posted by RedSword View Post
Please provide the .sp as well since .smx binaries without it will be removed.
done.
uurbyrkdr is offline
s.m.a.c head
Senior Member
Join Date: Apr 2012
Location: Liverpool
Old 07-04-2015 , 08:48   Re: Block and Ban Family Sharing
Reply With Quote #9

ok with this plugin server crashes
Thanks for compile
s.m.a.c head 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 02:56.


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