Requirements:
AmxModX 1.8.3+ AmxxEasyHttpLINK TO DOWNLOAD Steam Web API KEYCLICK 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...
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:
//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"
[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!
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
PHP Code:
L 12/15/2022 - 15:08:15: [admin.amxx] Login: "iloveyoursmile<12><STEAM_0:0:1965426><>" became an admin (account "STEAM_0:0:1965426") (access "abcdefghijlmnopqrstu") (address "127.0.0.1") L 12/15/2022 - 15:30:13: -------- Mapchange to de_dust2 -------- L 12/15/2022 - 15:30:13: [soccerjam.amxx] performance issue. Function plugin_precache executed more than 4.4ms. L 12/15/2022 - 15:30:13: [soccerjam.amxx] performance issue. Function plugin_init executed more than 11.7ms. L 12/15/2022 - 15:30:13: [admin.amxx] Login: "iloveyoursmile<12><STEAM_0:0:1965426><>" became an admin (account "STEAM_0:0:1965426") (access "abcdefghijlmnopqrstu") (address "127.0.0.1") L 12/15/2022 - 15:30:34: [admin.amxx] Login: "iloveyoursmile<13><STEAM_0:0:1965426><>" became an admin (account "STEAM_0:0:1965426") (access "abcdefghijlmnopqrstu") (address "127.0.0.1") L 12/15/2022 - 15:31:03: -------- Mapchange to de_dust2 -------- L 12/15/2022 - 15:31:03: [soccerjam.amxx] performance issue. Function plugin_precache executed more than 4.5ms. L 12/15/2022 - 15:31:03: [soccerjam.amxx] performance issue. Function plugin_init executed more than 12.5ms. L 12/15/2022 - 15:31:03: [admin.amxx] Login: "iloveyoursmile<13><STEAM_0:0:1965426><>" became an admin (account "STEAM_0:0:1965426") (access "abcdefghijlmnopqrstu") (address "127.0.0.1") L 12/15/2022 - 15:31:09: [test10.amxx] performance issue. Function Complete_RequestPlayer executed more than 4.2ms. L 12/15/2022 - 15:32:46: [admincmd.amxx] Ban: "CS MIX #1<0><><>" ban and kick "iloveyoursmile<14><STEAM_0:0:657050212><>" (minutes "1") (reason "") L 12/15/2022 - 15:37:34: -------- Mapchange to de_dust2 -------- L 12/15/2022 - 15:37:34: [soccerjam.amxx] performance issue. Function plugin_precache executed more than 4.2ms. L 12/15/2022 - 15:37:34: [soccerjam.amxx] performance issue. Function plugin_init executed more than 11.9ms. L 12/15/2022 - 15:37:43: [admincmd.amxx] Ban: "CS MIX #1<0><><>" ban and kick "iloveyoursmile<15><STEAM_0:0:657050212><>" (minutes "1") (reason "") L 12/15/2022 - 15:37:52: -------- Mapchange to de_dust2 -------- L 12/15/2022 - 15:37:53: [GEOIP] Database info: GeoLite2 City database 2.0 L 12/15/2022 - 15:37:53: [soccerjam.amxx] performance issue. Function plugin_precache executed more than 4.6ms. L 12/15/2022 - 15:37:53: [soccerjam.amxx] performance issue. Function plugin_init executed more than 10.9ms. L 12/15/2022 - 15:37:59: [admincmd.amxx] Kick: "CS MIX #1<0><><>" kick "iloveyoursmile<1><STEAM_0:0:657050212><>" (reason "") L 12/15/2022 - 15:38:09: [admincmd.amxx] Kick: "CS MIX #1<0><><>" kick "iloveyoursmile<2><STEAM_0:0:657050212><>" (reason "") L 12/15/2022 - 15:38:29: -------- Mapchange to de_dust2 -------- L 12/15/2022 - 15:38:29: [soccerjam.amxx] performance issue. Function plugin_precache executed more than 4.2ms. L 12/15/2022 - 15:38:29: [soccerjam.amxx] performance issue. Function plugin_init executed more than 11.6ms. L 12/15/2022 - 15:38:34: [admincmd.amxx] Kick: "CS MIX #1<0><><>" kick "iloveyoursmile<3><STEAM_0:0:657050212><>" (reason "") L 12/15/2022 - 15:39:27: -------- Mapchange to de_dust2 -------- L 12/15/2022 - 15:39:27: [soccerjam.amxx] performance issue. Function plugin_precache executed more than 4.2ms. L 12/15/2022 - 15:39:28: [soccerjam.amxx] performance issue. Function plugin_init executed more than 11.6ms. L 12/15/2022 - 15:39:35: [admincmd.amxx] Kick: "CS MIX #1<0><><>" kick "iloveyoursmile<4><STEAM_0:0:657050212><>" (reason "") L 12/15/2022 - 15:39:57: [admincmd.amxx] Cmd: "CS MIX #1<0><><>" ban "#5" (minutes "1") (reason "ANTI_FAMILY_SHARE") L 12/15/2022 - 15:41:08: -------- Mapchange to de_dust2 -------- L 12/15/2022 - 15:41:08: [soccerjam.amxx] performance issue. Function plugin_precache executed more than 4.5ms. L 12/15/2022 - 15:41:08: [soccerjam.amxx] performance issue. Function plugin_init executed more than 12.4ms. L 12/15/2022 - 15:41:14: [admincmd.amxx] Ban: "CS MIX #1<0><><>" ban and kick "iloveyoursmile<5><STEAM_0:0:657050212><>" (minutes "1") (reason "ANTI_FAMILY_SHARE")
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.