alliedmodders / sourcemod

SourceMod - Source Engine Scripting and Administration
http://www.sourcemod.net/
973 stars 421 forks source link

[Feature request] GetFunctionByName for methodmaps #1932

Open Alienmario opened 1 year ago

Alienmario commented 1 year ago

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).

Kenzzer commented 1 year ago

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.

dvander commented 1 year ago

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

Alienmario commented 1 year ago

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