sourcebans-pp icon indicating copy to clipboard operation
sourcebans-pp copied to clipboard

[Feature Request] Change name of files in the configs/sourcebans folder

Open crashzk opened this issue 5 years ago • 4 comments

Currently the files found in the addons/sourcemod/configs/sourcebans folder are named:

  • sb_admin_groups.cfg
  • sb_admins.cfg
  • sourcebans.cfg
  • sourcecomms.cfg
  • sourcesleuth_whitelist.cfg

I believe that it should be updated, leaving a standard, as they did with the names of the plugins and translations, looking like this:

  • sbpp_admin_groups.cfg
  • sbpp_admins.cfg
  • sbpp_sourcebans.cfg
  • sbpp_sourcecomms.cfg
  • sbpp_sourcesleuth_whitelist.cfg

Something like that.

crashzk avatar Mar 14 '20 06:03 crashzk

I think it would be better if rename folder sourcebans to sbpp and remove duplicates from configs names.

  • sourcebans/sb_admin_groups.cfg
  • sourcebans/sb_admins.cfg
  • sourcebans/sourcebans.cfg
  • sourcebans/sourcecomms.cfg
  • sourcebans/sourcesleuth_whitelist.cfg

Like:

  • sbpp/admin_groups.cfg
  • sbpp/admins.cfg
  • sbpp/bans.cfg
  • sbpp/comms.cfg
  • sbpp/sleuth_whitelist.cfg

TheByKotik avatar Mar 14 '20 06:03 TheByKotik

I suggest another additional change. Data files (admin_groups, admins) should be moved into addons/sourcemod/data/sbpp (this files don't should be edited manually by admin), and migrate from KeyValues (used for writing) to another format. KeyValues have ancient bug when key name can be written into file with another letter case (because is cached on engine). For example, currently admin group with name admin can be written into admin_groups with name Admin, but in admins group name can be written as admin (as expected). Effect - SM returns INVALID_GROUP_ID when SB++ tries find group in SM cache and SB++ don't adds admin into cache.

CrazyHackGUT avatar Mar 14 '20 08:03 CrazyHackGUT

/**
 * Reproduce plugin for SB++.
 * After starting this plugin, user can't use adequately group names:
 * * Root
 * * Test
 * * Example
 * KV always change letter case to:
 * * root
 * * test
 * * example
 *
 * Any non-standard plugin can cause this effect, and user may can't
 * understand, what the fuck is going.
 */

#include <sourcemod>

stock const char    g_szWords[][]   = {
    "root",
    "test",
    "example"
};

public void OnPluginStart()
{
    for (int iId = 0; iId < sizeof(g_szWords); ++iId)
    {
        CloseHandle(CreateKeyValues(g_szWords[iId]));
    }
}

CrazyHackGUT avatar Mar 14 '20 09:03 CrazyHackGUT

Sorry for the notification on old issues, but any news on this feature?

And especially the bug you mentioned:

KeyValues have ancient bug when key name can be written into file with another letter case (because is cached on engine). For example, currently admin group with name admin can be written into admin_groups with name Admin, but in admins group name can be written as admin (as expected). Effect - SM returns INVALID_GROUP_ID when SB++ tries find group in SM cache and SB++ don't adds admin into cache.

I have it too, or would there be any way to clear this cache?

crashzk avatar Jun 30 '23 19:06 crashzk