[Bug]: AutoExecConfig regression in SM 1.13
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 68/100
Direzione di ricerca
Start from the commit linked in the issue (87d668afce37caea584886b29fa013a6d1b27767) to find where the config writer strips FCVAR_DONTRECORD convars — that is where the behavior revert goes. Then search the tree for the AutoExecConfig native registration and the script includes to see where a new AutoExecConfigEx plus AECFLAG_* constants and an sm_configs_cleanup_unsafe command would live. Done when a plugin config keeps manually added DONTRECORD convars across a map change while such convars are still not auto-inserted, with the new API reproducing the current stripping behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Prerequisites
- I have checked that my issue doesn't exist yet in the issue tracker
Operating System and Version
Debian 12
Game / AppID and Version
Any
SourceMod Version
1.13.0.7472
Metamod:Source Version
1.12.0-dev+1226
Version Verification
- I have updated SourceMod to the latest version and the issue persists
- I have updated SourceMod to the latest snapshot and the issue persists
- I have updated Metamod:Source to the latest snapshot and the issue persists
Updated SourceMod Version
1.13.0.7472
Updated Metamod:Source Version
1.12.0-dev+1226
Description
Expected behavior:
AutoExecConfig(true, ...)generates a config file for a plugin with convars which don't haveFCVAR_DONTRECORDflag set. Never removes any plugin-related settings (convars) from it which were added manually later.
Current behavior:
AutoExecConfig(true, ...)overwrites the plugin config file, removing plugin-related convars from it if they have theFCVAR_DONTRECORDflag set, even if they were added manually.
It seems like this regression was introduced in this PR. While automatically adding new convars to the config file may be useful, removing existing convars is a breaking change. IMO, this destructive behavior shouldn't have been introduced to AutoExecConfig in the first place. Instead, a separate function - such as AutoExecConfigEx - should've been created.
The proper fix would be:
- Revert the behavior change of
AutoExecConfigto maintain backward compatibility with old plugins and servers setups.FCVAR_DONTRECORDconvars still should not be inserted into generated configs. This behavior should be documented (right now it is "documented" only on the wiki, but not in the includes nor docs);- Create an
AutoExecConfigExfunction. I'll describe the function signature below;- Add an
sm_configs_cleanup_unsafe <all/specific/config/path>command for server operators so they can execute the current behavior if they need to.
AutoExecConfigEx:
The default function signature should look like this:
void AutoExecConfigEx(int iFlags = 0, int iCvarFlags = FCVAR_HIDDEN | FCVAR_PROTECTED | FCVAR_CHEAT | FCVAR_DEVELOPMENTONLY, const char[] sConfigName = "", const char[] sFolderName = "sourcemod")The arguments:
- iFlags -
AECFLAG_*, described below;- iCvarFlags -
FCVAR_*flags that cause a convar to be ignored when generating the config file;- sConfigName - name of the config. Same as in the current
AutoExecConfig;- sFolderName - name of the parent folder. Same as in the current
AutoExecConfig.Function flags:
AECFLAG_GENERATE_CONFIG = (1 << 0)- if set, the plugin config will be generated. Does nothing if the plugin config already exists. RespectsiCvarFlags;AECFLAG_STRIP_CONVARS = (1 << 1)- if set, convars not registered by the plugin will be removed from the config;AECFLAG_STRIP_CONVARS_STRICT = (1 << 2)- overridesAECFLAG_STRIP_CONVARSif both are set. Extends theAECFLAG_STRIP_CONVARSbehavior but respects theiCvarFlagsargument. Any convar that has an ignored flag or does not belong to the plugin will be removed;AECFLAG_INSERT_NEW_CONVARS = (1 << 3)- inserts new convars into the existing plugin config with respect toiCvarFlags. If no plugin config exists, this does nothing.
Steps to Reproduce
- Make a plugin which registers convars with
FCVAR_DONTRECORDflag set and executesAutoExecConfig(true, ...)after that. - Add and set a convar in the config which wasn't already there (has
FCVAR_DONTRECORDflag set) but belongs to the plugin. - Change map and you will see the convar removed from the config. This happens only in SM 1.13.
Relevant Log Output
- Lingua principale
- C++
- Stelle
- 1.2k
- Fork
- 476
- Merge medio
- 2g 9h
- PR unite (30g)
- 13
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di alliedmodders/sourcemod
-
[Bug]: RoundToNearest truncates in plugins compiled with spcomp 1.13Forse già presa @fmu1337 l’ha presa oggi. ApertaBug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
alliedmodders/sourcemod#2627 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
alliedmodders/sourcemod#2615 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
alliedmodders/sourcemod#2613 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
alliedmodders/sourcemod#2571 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Disable Nextmap for CSGO?ApertaFeature Request
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 64/100
alliedmodders/sourcemod#2555 · 3 reazioni ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di alliedmodders/sourcemod
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
patrick-hudson/put.gd-desktop#2044 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
uxlfoundation/oneDNN#6604 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni