sourcemod icon indicating copy to clipboard operation
sourcemod copied to clipboard

Incorrect plugin status reported

Open dragokas opened this issue 3 years ago • 2 comments

Help us help you

  • [x] I have checked that my issue doesn't exist yet.
  • [x] I have tried my absolute best to reduce the problem-space and have provided the absolute smallest test-case possible.
  • [ ] I can always reproduce the issue with the provided description below.

Environment

  • Operating System version: Debian 10
  • Game/AppID (with version if applicable):
  • Current SourceMod version: 1.11.0.6911
  • Current SourceMod snapshot: 1.11.0.6911
  • Current Metamod: Source snapshot: 1.11.0-dev+1145
  • [x] I have updated SourceMod to the latest version and it still happens.
  • [x] I have updated SourceMod to the latest snapshot and it still happens.
  • [x] I have updated SourceMM to the latest snapshot and it still happens.

Description

"Plugin_Running" status is reported regardless it is in "disabled" state.

Reproducing

Well, it is not easy to reproduce. Every time I tried, I failed. However, it is absolutely not the first time I noticed that situation. My observing:

Let's imagine we have failure.sp, like:

public void OnPluginStart()
{
	HookEvent("XYZ", XYZ);
}
public void XYZ(Event event, const char[] name, bool dontBroadcast) { }

For some circumstances (periodically load / reload it ...), you'll have:

sm plugins list

and this plugin is present here in the list (without "disabled" state).

Also:

public void OnPluginStart()
{
	Handle hPlugin = FindPluginByFile("failure.smx");
	PluginStatus ps;
	
	if( hPlugin )
	{
		ps = GetPluginStatus(hPlugin);
		PrintToServer("Status is: %i", ps);
	}
}

the result is:

Status is: 0

which is Plugin_Running

However:

sm plugins reload failure.smx

returning:

 Plugin failure.smx is not loaded.

And, I'll double that's not reliable way to reproduce the case.

dragokas avatar Oct 06 '22 16:10 dragokas

This seems like logic that should be performed in OnAllPluginsLoaded, not OnPluginStart

JoinedSenses avatar Oct 06 '22 19:10 JoinedSenses

I used late load (reload) for all checks.

dragokas avatar Oct 06 '22 20:10 dragokas