sm returns INVALID_HANDLE when retrieving <disabled> plugin's handle, even if plugin is listed:
PHP Code:
sm plugins list
...
52 Disabled: "[ANY] Sample" (1.0) by XXX
and considered as loaded:
PHP Code:
sm plugins load fault.smx
[SM] Plugin fault.smx is already loaded.
so by logic,
GetPluginStatus() should have an opportunity to show status:
Plugin_Running
but it require plugin handle, that I cannot provide.
Is it a bug?
Fault.sp
PHP Code:
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
{
return APLRes_SilentFailure;
}
+ map change (to reproduce).
Iterator.sp
PHP Code:
public void OnPluginStart()
{
RegConsoleCmd("sm_iter", CmdIter);
}
Action CmdIter(int client, int args)
{
char sFilename[] = "fault.smx";
Handle hPlugin = FindPluginByFile(sFilename);
PrintToChatAll("Plugin handle: %i", hPlugin); // returns 0
// ==============
char sLog[PLATFORM_MAX_PATH];
BuildPath(Path_SM, sLog, sizeof(sLog), "logs/_status.log");
Handle hIter = GetPluginIterator();
Handle hPlug;
char name[64];
// Iterate plugins
while( MorePlugins(hIter) )
{
hPlug = ReadPlugin(hIter);
GetPluginFilename(hPlug, name, sizeof name);
ps = GetPluginStatus(hPlug);
LogToFileEx(sLog, "Plugin %s (Handle: %i) - status: %i", name, hPlug, ps);
// last record of iterator returns Handle: 0
}
Handle h = FindPluginByNumber(52);
PrintToChatAll("52-th plugin handle is: %i", h); // returns 0
return Plugin_Handled;
}
FindPluginByFile returns 0;
FindPluginByNumber returns 0;
GetPluginIterator +
MorePlugins can see disabled plugin. They returns in total 52 records, but that last record is:
so no information about name of disabled plugin cannot be retrieved from this handle.
__________________