AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Plugin that checks steam profiles and warns/kicks private profile holders (https://forums.alliedmods.net/showthread.php?t=299120)

Obyboby 07-03-2017 16:33

Plugin that checks steam profiles and warns/kicks private profile holders
 
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!

DarkDeviL 07-03-2017 17:03

Re: Plugin that checks steam profiles and warns/kicks private profile holders
 
Veterans Only claims to be able to do what you want, and a little bit more than that.. :-)

Obyboby 07-03-2017 17:03

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

Originally Posted by arne1288 (Post 2533232)
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!!

WatchDogs 07-03-2017 17:57

Re: Plugin that checks steam profiles and warns/kicks private profile holders
 
Download The Latest Version From Here Please

DarkDeviL 07-03-2017 19:56

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

Originally Posted by WatchDogs (Post 2533250)
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 (Post 2533250)
Not tested. Please test it and tell the result :)

Well, hope you're OK with feedback coming towards your code, even without testing it.

WatchDogs 07-04-2017 07:36

Re: Plugin that checks steam profiles and warns/kicks private profile holders
 
Download The Latest Version From Here Please

Obyboby 07-04-2017 14:43

Re: Plugin that checks steam profiles and warns/kicks private profile holders
 
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 07-04-2017 16:46

Re: Plugin that checks steam profiles and warns/kicks private profile holders
 
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

WatchDogs 07-05-2017 03:20

Re: Plugin that checks steam profiles and warns/kicks private profile holders
 
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

DarkDeviL 07-05-2017 03:36

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

Originally Posted by WatchDogs (Post 2533346)
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 (Post 2533346)
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.


All times are GMT -4. The time now is 19:02.

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