Fix Exception reported: Invalid convar handle #843
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
L 11/13/2024 - 00:53:35: [SM] Exception reported: Invalid convar handle 41400405 (error 3)
L 11/13/2024 - 00:53:35: [SM] Blaming: match_vote.smx
L 11/13/2024 - 00:53:35: [SM] Call stack trace:
L 11/13/2024 - 00:53:35: [SM] [0] ConVar.SetInt
L 11/13/2024 - 00:53:35: [SM] [1] Line 102, x:\GitHub\L4D2-Competitive-Rework\addons\sourcemod\scripting\match_vote.sp::OnPluginEnd
This occurred because the plugin was trying to access ConVar handles that had already been cleaned up by SourceMod during the unload process.
Solution
Listener_Quitto resetsv_maxplayersbefore server shutdownTechnical Details
sv_maxplayersreset logic toListener_Quitwhich triggers before server shutdowng_bShutdownflag to track proper shutdown sequenceWhile this error was mostly cosmetic and didn't affect core functionality, this fix provides a cleaner shutdown process and eliminates error messages in server logs.