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

Plugin that checks steam profiles and warns/kicks private profile holders


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Obyboby
Veteran Member
Join Date: Sep 2013
Old 07-03-2017 , 16:33   Plugin that checks steam profiles and warns/kicks private profile holders
Reply With Quote #1

So in order to find smurfs/cheaters on our server, we ask players to keep their profile public while playing.
Is it easy to write a plugin that performs a check on users' Steam profiles, and if it finds a private profile, starts warning the user (via the in game chat) and after x amount of warnings, it kicks the client and displays a message about the rule (eg please make your profile public to play on our server)

Thanks for any help!
__________________
Obyboby is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 07-03-2017 , 17:03   Re: Plugin that checks steam profiles and warns/kicks private profile holders
Reply With Quote #2

Veterans Only claims to be able to do what you want, and a little bit more than that.. :-)
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
Obyboby
Veteran Member
Join Date: Sep 2013
Old 07-03-2017 , 17:03   Re: Plugin that checks steam profiles and warns/kicks private profile holders
Reply With Quote #3

Quote:
Originally Posted by arne1288 View Post
Veterans Only claims to be able to do what you want, and a little bit more than that.. :-)
Had totally missed that one!! Will look into it right now. Thank you sir!!
__________________
Obyboby is offline
WatchDogs
Senior Member
Join Date: Oct 2015
Location: Iran
Old 07-03-2017 , 17:57   Re: Plugin that checks steam profiles and warns/kicks private profile holders
Reply With Quote #4

Download The Latest Version From Here Please

Last edited by WatchDogs; 08-09-2017 at 07:37.
WatchDogs is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 07-03-2017 , 19:56   Re: Plugin that checks steam profiles and warns/kicks private profile holders
Reply With Quote #5

Quote:
Originally Posted by WatchDogs View Post
I picked up some of code from Veterans Only and made this:
  1. Do not do it in OnClientPutInServer, you will most likely never get a Steam ID in this place.
    Wait until OnClientAuthorized, or even better, OnClientPostAdminCheck, so you can check if the person is an admin or not, and that way ignore doing anything on admins.
  2. Use AuthId_Steam2, not AuthId_Engine. AuthId_Engine is not supported by that API end point.
  3. Always check the return value of GetClientAuthId, (it returns TRUE or FALSE), do not use it blindly:
    Bad Code

    Good Code
  4. Always check up with third parties, (e.g. if they have any terms of services / acceptable usage policies available) for their services, if they don't, ask them if you may use their API end points for things like this.
    There is also no guarantee that the end point used will be available next month, next year, or even the year after that.. So in theory, there are chances that your provided plugin will break too.


Quote:
Originally Posted by WatchDogs View Post
Not tested. Please test it and tell the result
Well, hope you're OK with feedback coming towards your code, even without testing it.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
WatchDogs
Senior Member
Join Date: Oct 2015
Location: Iran
Old 07-04-2017 , 07:36   Re: Plugin that checks steam profiles and warns/kicks private profile holders
Reply With Quote #6

Download The Latest Version From Here Please

Last edited by WatchDogs; 08-09-2017 at 07:38.
WatchDogs is offline
Obyboby
Veteran Member
Join Date: Sep 2013
Old 07-04-2017 , 14:43   Re: Plugin that checks steam profiles and warns/kicks private profile holders
Reply With Quote #7

Thank you so much for your prompt plugins WatchDogs, really appreciate it!
Will be testing this as soon as possible.
Thank you arne for your input as well.
__________________
Obyboby is offline
Obyboby
Veteran Member
Join Date: Sep 2013
Old 07-04-2017 , 16:46   Re: Plugin that checks steam profiles and warns/kicks private profile holders
Reply With Quote #8

Does it create a cfg file? Or should I be typing the settings inside another file?

EDIT: tried removing the admin immunity, then rejoining with my profile set to private..I didn't get any warnings :C a CFG file would be great (if possible, of course!)
thanks
__________________

Last edited by Obyboby; 07-04-2017 at 18:07.
Obyboby is offline
WatchDogs
Senior Member
Join Date: Oct 2015
Location: Iran
Old 07-05-2017 , 03:20   Re: Plugin that checks steam profiles and warns/kicks private profile holders
Reply With Quote #9

I edited the post and added cfg file creation.
Quote:
EDIT: Updated to 1.2.2 | Added cfg file creation
You should change the cvar "sm_private_kick_url" to your php script url & set sm_private_kick_gameid cvar correctly too. If you don't plugin doesn't work at all.

The php file is here

Last edited by WatchDogs; 07-05-2017 at 03:25.
WatchDogs is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 07-05-2017 , 03:36   Re: Plugin that checks steam profiles and warns/kicks private profile holders
Reply With Quote #10

Quote:
Originally Posted by WatchDogs View Post
Also I checked the license. It's GNU and you know it's free to edit and develop.
https://github.com/falahati/veterans#license
I have NEVER said you couldn't edit and re-develop on it?

The plugin is one thing, ... you can do whatever you want with it - that's correct!

However:

Quote:
Originally Posted by WatchDogs View Post
PHP Code:
public void OnPluginStart()
{
    
h_bEnable CreateConVar("sm_private_kick_enable""1""Enable / Disable the plugin"_true0.0true1.0);
    
h_iGameID CreateConVar("sm_private_kick_gameid""730""Steam's Store id of the game you want us to check against?");
    
h_bKickFailed CreateConVar("sm_private_kick_failed""0""Enable / Disable kicking client if didn't receive response"_true0.0true1.0);
    
h_sURL CreateConVar("sm_private_kick_url""http://falahati.net/steamapi/queryPlaytime.php""Address of the PHP file responsible for getting user profile status."); 

The "http://falahati.net/steamapi/queryPlaytime.php" thing is something else.

The GPL does not allow you to "spam away queries towards any site", nor does it disallow it either.

So if you don't have permission from the owner of falahati.net to use it, e.g. unless the owner of falahati.net said something like "Do whatever you want with it, just don't blame me for the results of your plugin", then you should either set up your own end point or find an alternative way of doing the public<->private profile check.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL 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 01:10.


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