sourcemod icon indicating copy to clipboard operation
sourcemod copied to clipboard

[Feature request] GetFunctionByName for methodmaps

Open Alienmario opened this issue 2 years ago • 3 comments

GetFunctionByName is not currently able to find functions within methodmaps, static or not, afaik.

Use case: If implemented, would allow to develop a kind of forward routing system when methodmaps are being used for namespace separation purposes. (At least until https://github.com/alliedmodders/sourcepawn/issues/789 gets resolved).

Alienmario avatar Feb 12 '23 22:02 Alienmario

This can technically already be implemented if you edit the sourcepawn compiler. So i wonder if that issue would also warrant being opened on the other repo ? Either way I second this idea, I used it in my own plugins https://github.com/Kenzzer/VSH-Rewrite

But since public functions arent supposed to have default parameters, and SM code base already has methodmap functions with default parameters, it's too late to correct the potential misuse ? of the public keyword to declare methodmap functions. We would need to introduce a new keyword when declaring actually public mm functions.

Kenzzer avatar Feb 12 '23 22:02 Kenzzer

Does it work if you use the encoded name? Eg GetFunctionByName("Methodmap.Method") ?

dvander avatar Jul 04 '23 04:07 dvander

It does not. I've tried every combination I could think of.

Alienmario avatar Jul 04 '23 11:07 Alienmario