Raised This Month: $32 Target: $400
 8% 

Anti Family Share 2022 [WORKING]


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Server Management       
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 12-15-2022 , 11:07   Anti Family Share 2022 [WORKING]
Reply With Quote #1

Requirements:
AmxModX 1.8.3+
AmxxEasyHttp LINK TO DOWNLOAD
Steam Web API KEY CLICK TO GET YOURS (You get access to it once you spend $5 or more on steam)

How it works:
Player connects > We query his steam id if he's not in the white list
Steam profile private > We punish the player until he sets it to public so he can pass our check, of course we also print in console why we punish him.
(Note that this is a caveat because the proper API call was deprecated by steam, so we have to do it in another way which requires the privacy settings of the player to be public)
Steam profile public > If he owns cs 1.6 we let him play and write his steamid in a whitelist file (afs_whitelist.ini located in configs folder) this way we save queries next time they join!
Player passed check > We don't care anymore if his profile is private or not, forever! (unless you clear the afs_whitelist.ini file)
Cvars:
Whether it will be enabled or not...
amx_antifs_enabled 0|1
The steam web api key cvar
amx_antifs_steam_api_key "THIS_IS_WHERE_YOUR_STEAM_WEB_API_KEY_GOE S"
The type of punishment, 0 = kick, 1 = ban
amx_antifs_punish_type 0|1
The amount of ban duration in minutes
amx_antifs_punish_duration 0|1|2|3|4|5...
Whether to announce to other players, 0 = no, 1 = only success, 2 = both success and fail
amx_antifs_announce_others 0|1|2

Installation:
Get the plugin source, compile, put it in plugins folder
In plugins.ini add anti_family_share.amxx
In addons/amxmodx/data/lang/ put the anti_fs.txt file (it's the multi language file necessary for it to work properly, otherwise the players won't know why they're kicked... DO NOT FORGET)
Add your steam web api key in amxx.cfg via amx_antifs_steam_api_key, and change the other cvars as you see fit, but DO NOT FORGET ABOUT THE API KEY!

Bugs:
Unknown, waiting for feedback.

Also this differs to other existing solutions, those no longer work as valve has deprecated API calls to check for family sharing so I'm doing it in a stupider way which also requires the players to have steam privacy settings set to public for the first time they join your server, so yeah...
Attached Files
File Type: sma Get Plugin or Get Source (anti_family_share.sma - 184 views - 7.4 KB)
File Type: txt anti_fs.txt (16.0 KB, 93 views)
__________________

Last edited by deprale; 12-15-2022 at 21:45.
deprale is offline
AllMassive
Senior Member
Join Date: Sep 2004
Location: /dev/urandom
Old 01-15-2023 , 06:01   Re: Anti Family Share 2022 [WORKING]
Reply With Quote #2

thank you for sharing this.
installed it on a server and it seems to work.
havent seen any ingame msg yet, but the afs_whitelist.ini has been created and contains some steam-ids (maybe better use a mysql?!)
would be nice to be able to get some more verbose logging on the server side, to check if the whole thing is actually running/checking.
ever since running this plugin, the amx-logs show entries like:
Code:
[admincmd.amxx] Kick: "Servername<0><><>" kick "playerN<5><STEAM_0:1:xxxxxx><>" (reason "")
anti_fs.txt is available underneath data/lang

using these settings:
Code:
//Whether the plugin is enabled or not
amx_antifs_enabled "1"
//Steam WEB API Key (NEEDED)
amx_antifs_steam_api_key "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
//Whether the player gets kicked (0), gets banned (1)
amx_antifs_punish_type "0"
//For how many minutes the player gets banned if punish_type is 2
amx_antifs_punish_duration "1"
//Announce to other players (0) = no, (1) = only success, (2) = both success and fails! - dflt 1
amx_antifs_announce_others "2"
AllMassive is offline
McTavish
Senior Member
Join Date: May 2021
Old 01-15-2023 , 07:10   Re: Anti Family Share 2022 [WORKING]
Reply With Quote #3

take the two languages.
Code:
[hr]:
AFS_FAIL = "Dosli ste do neuspjeha u provjeri dijeljenja obiteljskog računa!"
AFS_FAIL_DETAIL1 = "Kada se prvi put pridružite našim poslužiteljima, morate postaviti svoj Steam profil na javno"
AFS_FAIL_DETAIL2 = "Jednom kada ste se prvi put pridružili i prošli provjeru, možete ga vratiti na privatno"
AFS_FAIL_DETAIL3 = "Ako se i dalje ne možete pridružiti, to znači da ne posjedujete CS 16, stoga niste dopušteni na našem poslužitelju (poslužiteljima)"
AFS_FAIL_DETAIL4 = "Ova ograničenja su postavljena kako bi se spriječili zlouporabe / varanja / spama itd.!"
AFS_PASS = "^3Prošli ste^4 provjeru dijeljenja obiteljskog računa^3^1!"
AFS_ANNOUNCE_PASS = "^3%s je ^4uspio^3 u ^4provjeri dijeljenja obiteljskog računa^3^4!"
AFS_ANNOUNCE_FAIL = "^3%s je ^4neuspio^3 u ^4provjeri dijeljenja obiteljskog računa^3^4!"
Code:
[mk]:
AFS_FAIL = Не успеавте да ја поминете проверката за делење на семејството!
AFS_FAIL_DETAIL1 = Кога прв пристапувате на нашите сервери, мора да го поставите вашиот профил на Steam на јавно
AFS_FAIL_DETAIL2 = Откако ќе се приклучите првиот пат и ќе го поминете пребарувањето, може да го вратите на приватно
AFS_FAIL_DETAIL3 = Ако пак не можете да се приклучите, тоа значи дека немате CS 16, па затоа не ви е дозволено на нашиот сервер (и)
AFS_FAIL_DETAIL4 = Оваа ограничување е на место за да се одбранат злоупотребители / измамци / спамери итн!
AFS_PASS = ^3Успешно сте го поминале^4 пребарувањето за делење на семејство^3 test^1!
AFS_ANNOUNCE_PASS = ^3%s го поминал^4 пребарувањето за делење на семејство^3 test^4!
AFS_ANNOUNCE_FAIL = ^3%s не успеал^4 да го помине пребарувањето за делење на семејство^3 test^4!
__________________
No Steam = No Support.
McTavish is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 01-15-2023 , 22:42   Re: Anti Family Share 2022 [WORKING]
Reply With Quote #4

Quote:
ever since running this plugin, the amx-logs show entries like:
Code:
[admincmd.amxx] Kick: "Servername<0><><>" kick "playerN<5><STEAM_0:1xxxxx><>" (reason "")
Absolutely normal, the player still sees why he is getting kicked, rest assured. This is how it looked during testing for me as well, occasionally it also shows up in the console too, sometimes the answer is empty and sometimes it actually contains the text (weird).
Spoiler



About displaying info in the console, I never thought about that as it seemed useless, I would have wanted for it to be included in the lang file too if I ever made it, even so you can easily add your own text with server_print if you wish so, but like I said I see no point in that. EVERY SINGLE exception is taken care of, so there's no way of it malfunctioning somehow - it's always gonna work as intended, as long as you don't mess with the API key or don't exceed the 250 requests per hour (which is the only exception I can't really take care of, because the response is empty there's no indication that you have exceeded that limit and I already use that as an indicator of a private profile and of course there are better ways to check for private profiles but then I'd make the plugin way too complicated, there are ways of course to keep track of how many you've sent in the last hour but still I feel like you should never have a problem with that especially in 2023)

Quote:
havent seen any ingame msg yet
Now this is strange, you should see them as I tested it on my server and it worked. I had someone else stay on the server while I purposefully failed the test, and he saw the texts of failure and success too. I'll test some more when I have free time and come back with maybe an update.

Also about MYSQL it is a valid suggestion, it will also help save on requests if you have more than 1 server, but also would be pretty painful to keep track of how many requests you have used in the last hour, and the plugin would just stop checking new players until the next hour rolls in, I mean if you have more than 250 new players every hour or so (which again, I state is kind of impossible in 2023)
One of the biggest reasons I didn't do it in mysql firsthand is because you can always just symlink the file on linux vds/vps servers and I didn't encounter any kind of funny access errors until now doing it this way.


Also thank you McTavish for the contribution, will add one of these days.
__________________

Last edited by deprale; 01-15-2023 at 22:54.
deprale 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 00:25.


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