AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   SteamTools (https://forums.alliedmods.net/forumdisplay.php?f=147)
-   -   F2P Detections not working correctly! (https://forums.alliedmods.net/showthread.php?t=276055)

El Diablo War3Evo 12-13-2015 19:35

F2P Detections not working correctly!
 
Code used to detect F2P:

Code:

public OnClientPostAdminCheck(client)
{
    if (CheckCommandAccess(client, "BypassPremiumCheck", ADMFLAG_ROOT, true))
    {
        return;
    }

    if (Steam_CheckClientSubscription(client, 0) && !Steam_CheckClientDLC(client, 459))
    {
        FreeToPlay[client] = true;
    }
    else
    {
        FreeToPlay[client] = false;
    }

    return;
}

Sometimes F2P detects work, but before thanksgiving update.. they worked all the time!

I know I'm not F2P, and several of my regular players are not F2P. Please help fix!

Exts list:

] sm_Rcon sm exts list
[SM] Displaying 18 extensions:
[01] Automatic Updater (1.7.3-dev+5250): Updates SourceMod gamedata files
[02] Webternet (1.7.3-dev+5250): Extension for interacting with URLs
[03] Equinox Console Cleaner (): Bite me alien boi
[04] Accelerator (2.0.1): Take back control
[05] TF2Items (1.6.2): TF2 Item Modifier
[06] Sound Info Library (1.0): Access information of sound files
[07] <FAILED> file "geoipcity.ext.so": Failed to open: */addons/sourcemod/configs/geoip/GeoIPCity.dat
[08] TF2 Tools (1.7.3-dev+5250): TF2 extended functionality
[09] BinTools (1.7.3-dev+5250): Low-level C/C++ Calling API
[10] SDK Hooks (1.7.3-dev+5250): Source SDK Hooks
[11] SDK Tools (1.7.3-dev+5250): Source SDK Tools
[12] Regex (1.7.3-dev+5250): Provides regex natives for plugins
[13] Top Menus (1.7.3-dev+5250): Creates sorted nested menus
[14] Socket (3.0.1): Socket extension for SourceMod
[15] SteamTools (0.9.1+7202836): SteamWorks for SourceMod.
[16] Client Preferences (1.7.3-dev+5250): Saves client pre


http://i.imgur.com/Jqf4Pj9.jpg

DarkDeviL 12-13-2015 20:51

Re: F2P Detections not working correctly!
 
Most plugins unset this FreeToPlay[client] status variable when people disconnect, however, based on your shared code, it doesn't seem like you do that.

If some F2P client has been on your server, but you are now using his/her ID, and you are except from this check, then your FreeToPlay[client] might returns true if you are not removing / clearing the variable in OnClientDisconnect.

Based on your own code - you could eventually try something like this:

Code:

public OnClientPostAdminCheck(client)
{
    if (CheckCommandAccess(client, "BypassPremiumCheck", ADMFLAG_ROOT, true))
    {
        FreeToPlay[client] = false; /* People bypassing our check means ... not a F2P player. */
        return;
    }

    if (Steam_CheckClientSubscription(client, 0) && !Steam_CheckClientDLC(client, 459))
    {
        FreeToPlay[client] = true;
    }
    else
    {
        FreeToPlay[client] = false;
    }

    return;
}

Or eventually less code, by starting with false for all, then change to true if F2P is being detected:
Code:

public OnClientPostAdminCheck(client)
{
    FreeToPlay[client] = false; /* By default, Let's assume everyone has the game license ... */

    if (CheckCommandAccess(client, "BypassPremiumCheck", ADMFLAG_ROOT, true))
    {
        return;
    }

    if (Steam_CheckClientSubscription(client, 0) && !Steam_CheckClientDLC(client, 459))
    {
        FreeToPlay[client] = true;
    }

    return;
}


asherkin 12-14-2015 05:10

Re: F2P Detections not working correctly!
 
Is there anything in your SourceMod error logs regarding failing to parse tickets?

EDIT: TF2 is still using ISteamGameServer012, so there shouldn't be any problems here.
Best thing you can do is set steamtools_dump_tickets to 1 and send me the file it writes when you join the server.

That said, for you the [F2P] tag is at the end of your name unlike everyone else... so make sure it's actually this code detecting you.
I wont be happy if I spend time investigating this and everything is fine :P.

El Diablo War3Evo 12-16-2015 19:53

Re: F2P Detections not working correctly!
 
Quote:

Originally Posted by asherkin (Post 2372313)
Is there anything in your SourceMod error logs regarding failing to parse tickets?

EDIT: TF2 is still using ISteamGameServer012, so there shouldn't be any problems here.
Best thing you can do is set steamtools_dump_tickets to 1 and send me the file it writes when you join the server.

That said, for you the [F2P] tag is at the end of your name unlike everyone else... so make sure it's actually this code detecting you.
I wont be happy if I spend time investigating this and everything is fine :P.

If you wear the -W3E- tag, your [F2P] will be at the end of your name.

I don't see anything in the tf/addons/sourcemod/logs/errors_*.log files

I'll set steamtools_dump_tickets to 1

How do you want me to send you the file once i have it and does it put it in the logs folder?

This has been a on going bug since thanksgiving update and I've exhausted everything else I could think it could be.



arne1288, I'll try your second shared code and i'll just remove the commandcheckaccess (cause i dont use the commandcheckaccess anyhow). I'll see if it helps any.

Dr. Greg House 12-17-2015 20:52

Re: F2P Detections not working correctly!
 
You're not giving us the full code here.
I assume OnClientPostAdminCheck will be called after authorization which can be delayed(?).

From what I know about you, you're probably not resetting the value when the players disconnect thus giving false/old results.
Also you don't show us where and how you rename the players.

El Diablo War3Evo 12-18-2015 21:47

Re: F2P Detections not working correctly!
 
1 Attachment(s)
Its just a modified version of my Unicode Filter that I have published.

Dr. Greg House 12-18-2015 22:04

Re: F2P Detections not working correctly!
 
What I said earlier.

DarkDeviL 12-19-2015 18:27

Re: F2P Detections not working correctly!
 
Quote:

Originally Posted by arne1288 (Post 2372241)
Most plugins unset this FreeToPlay[client] status variable when people disconnect, however, based on your shared code, it doesn't seem like you do that.

Quote:

Originally Posted by Dr. Greg House (Post 2373418)
From what I know about you, you're probably not resetting the value when the players disconnect thus giving false/old results.

Quote:

Originally Posted by Dr. Greg House (Post 2373851)
What I said earlier.

+1.

Code:

public OnClientDisconnect(client)
{
    FreeToPlay[client] = false;
}



All times are GMT -4. The time now is 13:24.

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