Skip to content

Fix unnecessary ConCommand cache misses#1256

Merged
Headline merged 2 commits intoalliedmodders:masterfrom
wanted241:patch-3
May 8, 2020
Merged

Fix unnecessary ConCommand cache misses#1256
Headline merged 2 commits intoalliedmodders:masterfrom
wanted241:patch-3

Conversation

@wanted241
Copy link
Contributor

Fixes a rare crash caused by GetCommandFlags() if there are some commands registered by plugins (Reg*Cmd()) which containing capitals. The same command ending up in the cache multiple times would explain the bug. (https://crash.limetech.org/stats/dc3d4e0530c48bb491d6b448c5a4d8a3)

Fixes a rare crash caused by GetCommandFlags() if there are some commands registered by plugins (Reg*Cmd()) which containing capitals. The same command ending up in the cache multiple times would explain the bug. (https://crash.limetech.org/stats/dc3d4e0530c48bb491d6b448c5a4d8a3)
@wanted241
Copy link
Contributor Author

This is the same problem as it was in #1166, but related to ConCommand rather than ConVar.

Copy link
Member

@Headline Headline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine; I know there was some weirdness about console commands and case sensitivity, so I'll wait for @asherkin or another to give a thumbs up before pulling this in.

@Headline Headline added the Bug general bugs; can be anything label May 8, 2020
Copy link
Member

@asherkin asherkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks correct to me for fixing the issue - I wanted to have a look to see if we could do a more efficient implementation but it probably makes sense to take this as-is to fix the bug.

@Headline Headline merged commit 5177cfd into alliedmodders:master May 8, 2020
fengjixuchui added a commit to fengjixuchui/sourcemod that referenced this pull request May 14, 2020
Fix unnecessary ConCommand cache misses (alliedmodders#1256)
@GamerXCZ
Copy link

GamerXCZ commented Apr 9, 2021

Any plans with this changes move to stable build?

@asherkin
Copy link
Member

asherkin commented Apr 9, 2021

It won't be backported to 1.10, but 1.11 is very usable and we're hard at work towards getting it promoted.

@GamerXCZ
Copy link

GamerXCZ commented Apr 9, 2021

Those array enum structs sadly won't magically recode themselves to the new enum structs.

@peace-maker
Copy link
Member

You can always compile the plugins using deprecated syntax with an older compiler until they're updated. The .smx created by any older compiler will load and run fine on newer runtimes. The forum remembers which compiler version was used to create the plugin in the release post and uses the correct version when clicking "Get Plugin". I know this isn't optimal, but at least you don't HAVE to touch a plugin's code just to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug general bugs; can be anything

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants