View Single Post
RumbleFrog
Great Tester of Whatever
Join Date: Dec 2016
Location: Fish Tank
Old 11-11-2017 , 19:33   Re: [ANY] Anti Private Profile & Inventory
Reply With Quote #12

Quote:
Originally Posted by Chdata View Post
For a long time I've been planning to rewrite those plugins, but seeing as this plugin is similar - do you think you could throw in these features?

1. Ban based on total playtime. (sm_addban, which works with sourcebans I think)
2. Ban based on total playtime, minus past 2 weeks. (Basically the thing from veteran's only)
3. Something that'll output a log specific to this plugin, and also chat messages which reveal the following data:
- All connections
- The playtime amount detected by the plugin
- The playtime minus the past 2 weeks
- Profile status (Public, Private, Not set up, Friend's-Only, etc)
- HTTP Status / Success / Failure / Errors for each call on a player or w/e
- Were they kicked or not
- Was steam up/down at the time

PHP Code:
stock CPrintToAdmins(const AdminFlag:fFlag, const String:message[], any:...)
{
    
CCheckTrie();

    
decl String:szBuffer[MAX_BUFFER_LENGTH], String:szBuffer2[MAX_BUFFER_LENGTH];

    for(new 
1<= MaxClientsi++)
    {
        if (!
IsClientInGame(i) || !GetAdminFlag(GetUserAdmin(i), fFlag) || CSkipList[i])
        {
            
CSkipList[i] = false;
            continue;
        }
        
SetGlobalTransTarget(i);
        
Format(szBuffersizeof(szBuffer), "\x01%s"message);
        
VFormat(szBuffer2sizeof(szBuffer2), szBuffer3);
        
CReplaceColorCodes(szBuffer2);
        
CSendMessage(iszBuffer2);
        
CRemoveTags(szBuffer2sizeof(szBuffer2));
        
PrintToServer(szBuffer2);
    }

^ I use that, could be useful if you use morecolors

4. Kicking based on private inventory ought to be optional (cvar). I'm okay with that, though I'd rather still kick all of the private profiles.

5. I noticed the thing about steam API's rate limit on Github.

Some quick googling says something like 100,000 per day and only 10 calls every 10s or something.

You could make a 1-2 second repeating timer and use an ADT array that gets filled when people connect and emptied as they get checked, to funnel your calls one at a time or something, which might help.

----

I looked at the plugin real quick and noticed a typo.

PHP Code:
enum FailMethod
{
    
f_KICK 1,
    
f_STAY
}

cFail CreateConVar("sm_anti_private_fail_method""1""1 - Allow them to stay on the server, 2 - Kicks them from the server"FCVAR_NONEtrue1.0true2.0);

void HandleHTTPError(int iClient)
{
    if (
iFailMethod == f_KICK)
        
KickClient(iClient"%T""Error"iClient);
        
    
LogError("Failed to send HTTP request (Is Steam Down?)");

f_kick and f_stay seem to be backwards here, when compared to the convar description.
Thanks for suggesting those features, I, unfortunately, cannot add them as it's outside the scope of this plugin.
__________________
RumbleFrog is offline