Raised This Month: $12 Target: $400
 3% 

F2P Detections not working correctly!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
El Diablo War3Evo
Veteran Member
Join Date: Jun 2013
Old 12-13-2015 , 19:35   F2P Detections not working correctly!
Reply With Quote #1

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


__________________

Last edited by El Diablo War3Evo; 12-13-2015 at 19:38. Reason: making stuff more understandable
El Diablo War3Evo is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 12-13-2015 , 20:51   Re: F2P Detections not working correctly!
Reply With Quote #2

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;
}
__________________
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
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 12-14-2015 , 05:10   Re: F2P Detections not working correctly!
Reply With Quote #3

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 .
__________________

Last edited by asherkin; 12-14-2015 at 05:14.
asherkin is offline
El Diablo War3Evo
Veteran Member
Join Date: Jun 2013
Old 12-16-2015 , 19:53   Re: F2P Detections not working correctly!
Reply With Quote #4

Quote:
Originally Posted by asherkin View Post
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 .
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.
__________________

Last edited by El Diablo War3Evo; 12-16-2015 at 20:13.
El Diablo War3Evo is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 12-17-2015 , 20:52   Re: F2P Detections not working correctly!
Reply With Quote #5

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.
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.

Last edited by Dr. Greg House; 12-17-2015 at 20:53.
Dr. Greg House is offline
El Diablo War3Evo
Veteran Member
Join Date: Jun 2013
Old 12-18-2015 , 21:47   Re: F2P Detections not working correctly!
Reply With Quote #6

Its just a modified version of my Unicode Filter that I have published.
Attached Files
File Type: sp Get Plugin or Get Source (UnicodeNameFilter.sp - 454 views - 15.4 KB)
__________________
El Diablo War3Evo is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 12-18-2015 , 22:04   Re: F2P Detections not working correctly!
Reply With Quote #7

What I said earlier.
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.
Dr. Greg House is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 12-19-2015 , 18:27   Re: F2P Detections not working correctly!
Reply With Quote #8

Quote:
Originally Posted by arne1288 View Post
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 View Post
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 View Post
What I said earlier.
+1.

Code:
public OnClientDisconnect(client)
{
    FreeToPlay[client] = false;
}
__________________
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


Thread Tools
Display Modes

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 03:58.


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