azalty / sm-no-dupe-account

No Dupe Account is a plugin that prevents players from joining the server if they have a duplicate or recent account
https://forums.alliedmods.net/showthread.php?t=330779
GNU General Public License v3.0
7 stars 2 forks source link

Problems with the whitelist while using R1KO's VIP Core plugin #46

Open crashzk opened 1 year ago

crashzk commented 1 year ago

I'm using VIP Core to add privileges for players, all privileges are working correctly, my only problem would be the issue of the whitelist I created for players without the requirements yet.

Configuration I'm using:

"no_dupe_account"
{
    "Players" // Players whitelist
    {       
        "a" "csgo_playtime"
        "e" "bans_game"
    }
    "Countries" // Countries blacklist
    {       

    }
}

However, whenever the player enters, he is kicked due to the hours requirements he does not have.

Player in question would be this: https://steamcommunity.com/profiles/76561199035768735

Hours requirements are 120 hours but if you have the flag a you are immune and the VIP group would have it because I configured it in VIP Core.

The strange thing is that if this same player I add his privileges through SourceBans++, the VIP group also works fine, can he enter even without having the necessary hours?

I have some error logs and VIP Core logs showing that the player received the privileges correctly. errors_20230912.log L20230912.log VIP_Logs.log

Server console log also:

L 09/12/2023 - 14:54:31: [no_dupe_account.smx] Boby Psicótico (STEAM_1:1:537751503) database status: Checked

Values: csgo_level=-1, csgo_coin=0, prime=0, csgo_playtime=4662 (minutes), steam_level=-1, steam_age=-1 (minutes), last_check=1694540015 (timestamp)

L 09/12/2023 - 14:54:32: [no_dupe_account.smx] Updated Boby Psicótico (STEAM_1:1:537751503) [Checked] into the database: csgo_level=-1, csgo_coin=0, prime=0, csgo_playtime=4662 (minutes), steam_level=-1, steam_age=-1 (minutes), last_check=1694540015 (timestamp)

Dropped Boby Psicótico from server: Você deve ter jogado CS:GO pelo menos 120 horas para se conectar ao servidor, ou Adquira VIP e seja imune!
azalty commented 1 year ago

So you're saying they get kicked if VIP through VIP Core, but don't get kicked if manually set on SourceBans?

Are you sure they indeed have the a flag? Please try whitelisting their steamid with "STEAM_1:1:537751503" "csgo_playtime" and then check in game that they indeed have the a/reserved slot permission by using sm_who

Might also be an issue with VIP Core assigning the VIP status too late, will have to check

crashzk commented 1 year ago

So you're saying they get kicked if VIP through VIP Core, but don't get kicked if manually set on SourceBans?

Exactly, but in both I configure the privileges using the Admin Group model, that is, the VIP group has access to the flag a and only it.

Example: image

Are you sure they indeed have the a flag? Please try whitelisting their steamid with "STEAM_1:1:537751503" "csgo_playtime" and then check in game that they indeed have the a/reserved slot permission by using sm_who

image

Might also be an issue with VIP Core assigning the VIP status too late, will have to check

I thought about this too, because on the server I have two messages, one that only shows to VIP when he enters.

And another welcome that shows for players without privileges, VIP does not see it in this case. However, with the VIP added by VIP Core it shows two messages.

image

Apparently it would be an attraction to receive VIP status through VIP Core, you only receive it after connecting, something like that.

crashzk commented 1 year ago

VIP Core would have this cvar:

// Delay before setting privileges when a player spawns
// -
// Default: "1.0"
// Minimum: "0.100000"
// Maximum: "60.000000"
sm_vip_spawn_delay "0.1"

Could this be?

azalty commented 1 year ago

Could this be?

Yea it seems like it's the problem. It should give privileges waaay earlier, when the player is finishing loading and entering the game, before the team selection menu appears. NDA uses the OnClientPostAdminCheck event, which VIP Core doesn't seem to respect as it gives prilileges AFTER

Called once a client is authorized and fully in-game, and after all post-connection authorizations have been performed.

If VIP Core wants to check for privileges a bit later, it should use OnClientPreAdminCheck and NotifyPostAdminCheck, but it isn't recommended as well as it'll slow down a lot of plugins. I don't understand why the plugin doesn't simply give permissions using the default system, so that they are applied automatically upon connection, and just check after each connection for expiration.

I might be able to add support for this plugin to delay further the verification process. Seems like it has an API. I would like to know if this github repo is the official source though. I'm pretty bad with all those russian/hlmod plugins.

crashzk commented 1 year ago

Yea it seems like it's the problem. It should give privileges waaay earlier, when the player is finishing loading and entering the game, before the team selection menu appears. NDA uses the OnClientPostAdminCheck event, which VIP Core doesn't seem to respect as it gives prilileges AFTER

I understand, I believe it really is...

Apparently I have two more problems in addition to your plugin, the messaging one I mentioned and AFK Manager.

If VIP Core wants to check for privileges a bit later, it should use OnClientPreAdminCheck and NotifyPostAdminCheck, but it isn't recommended as well as it'll slow down a lot of plugins. I don't understand why the plugin doesn't simply give permissions using the default system, so that they are applied automatically upon connection, and just check after each connection for expiration.

I might be able to add support for this plugin to delay further the verification process. Seems like it has an API. I would like to know if this github repo is the official source though. I'm pretty bad with all those russian/hlmod plugins.

Yes, this would be the official repository. If you can do that for me it would be perfect.

In any case, this solves the problem I've been having with your plugin due to VIP Core, but I'm also going to go back and correct the other two plugins, check with the VIP Core author about this issue as well.

azalty commented 1 year ago

I'm currently working on an integration with this plugin to make it work correctly :)

azalty commented 1 year ago

Support added in 1.5.3 BETA 1, more testing might be needed

azalty commented 1 year ago

New fix in 1.5.3 BETA 2 related to the verification of players when using the integration.

Oh, by the way, the integration can be manually disabled by going into cfg/sourcemod/no_dupe_account_advanced.cfg and setting nda_integration_vipcore to 0

crashzk commented 1 year ago

@azalty Testing here, so far I'm getting this error on the server:

L 09/16/2023 - 18:43:49: [no_dupe_account.smx] Steam Bans request failed: CommunityBanned field is missing (potential Steam maintenance)! - Status Code: 200

L 09/16/2023 - 18:43:49: [no_dupe_account.smx] [DEBUG] Steam Bans request body: {"players":[]}

L 09/16/2023 - 18:43:49: [no_dupe_account.smx] Steam Bans request failed: CommunityBanned field is missing (potential Steam maintenance)! - Status Code: 200

L 09/16/2023 - 18:43:49: [no_dupe_account.smx] [DEBUG] Steam Bans request body: {"players":[]}

I understand that the message would be about Steam maintenance, but I had doubts regarding this message:

Steam Bans request body: {"players":[]}

[EDIT1] And I'm still being kicked from the server even with VIP active through VIP Core.

  79 "No Dupe Account" (1.5.3 BETA 2) by azalty
crashzk commented 1 year ago
L 09/16/2023 - 21:22:07: [no_dupe_account.smx] Boby Psicótico (STEAM_1:1:537751503) database status: Checked

Values: csgo_level=-1, csgo_coin=0, prime=0, csgo_playtime=4854 (minutes), steam_level=-1, steam_age=-1 (minutes), last_check=1694900792 (timestamp)

L 09/16/2023 - 21:22:08: [no_dupe_account.smx] Updated Boby Psicótico (STEAM_1:1:537751503) [Checked] into the database: csgo_level=-1, csgo_coin=0, prime=0, csgo_playtime=4869 (minutes), steam_level=-1, steam_age=-1 (minutes), last_check=1694900792 (timestamp)

Dropped Boby Psicótico from server: Você deve ter jogado CS:GO pelo menos 120 horas para se conectar ao servidor, ou Adquira VIP e seja imune!
crashzk commented 1 year ago

Nothing changes, but the version of VIP Core that I use is version 3.1-dev

azalty commented 1 year ago

@azalty Testing here, so far I'm getting this error on the server:

L 09/16/2023 - 18:43:49: [no_dupe_account.smx] Steam Bans request failed: CommunityBanned field is missing (potential Steam maintenance)! - Status Code: 200

L 09/16/2023 - 18:43:49: [no_dupe_account.smx] [DEBUG] Steam Bans request body: {"players":[]}

L 09/16/2023 - 18:43:49: [no_dupe_account.smx] Steam Bans request failed: CommunityBanned field is missing (potential Steam maintenance)! - Status Code: 200

L 09/16/2023 - 18:43:49: [no_dupe_account.smx] [DEBUG] Steam Bans request body: {"players":[]}

I understand that the message would be about Steam maintenance, but I had doubts regarding this message:

Steam Bans request body: {"players":[]}

That's so weird, I never figured out why this happens. I guess it just randomly doesn't work? My guess is that the SteamID is invalid for some reason. The server might try to retrieve the SteamID64 but fail and return STOP_IGNORING_RET_VAL. That's my guess, and it could be problematic for the rest of the plugin as well and cause all sorts of problems. I'll try to get this patched by delaying verification as long as the client's steamid hasn't been verified by the server.

The problem is that SteamID validity should be guaranteed with OnClientPostAdminCheck, so this just makes no sense to me :-/

And I'm still being kicked from the server even with VIP active through VIP Core.

I'll investigate further, and I'll try to send you test versions on discord

azalty commented 1 year ago

I've added an API in 1.6.0 BETA 1 that should help with the integration of other plugins with NDA.