View Single Post
rallfo
Junior Member
Join Date: May 2010
Old 08-11-2011 , 06:04   Re: [TF2] PropHunt 1.7.12
Reply With Quote #767

Quote:
Originally Posted by crazydog View Post
So I fixed the problem by not putting the plugin into the disabled folder and loading it ondemand.

I want my admins to be able to load the plugin on demand, so that prophunt isn't always enabled, which is why it was in the disabled folder, and I guess why the problem I was having was occurring.

I knew there was a good reason why I was doing this, and not using the ph_enable cvar, but I forgot why. After trying ph_enable again, I remembered why.

When prophunt.smx is in the /plugins/ folder, even if ph_enable is set to 0 in sourcemod.cfg, it tries to load prophunt, and then sees that the map is not valid, since there is no config. It then unloads itself.

When it unloads itself, the following issues occur:
-Gravity stays at 500
-Pyro airblast no longer works

These are very gamebreaking issues. I added an option to our server admins to fix the gravity, but there is no way to fix the airblast problem without moving prophunt.smx to the disabled folder and reloading the map.

Is there something I'm doing terribly wrong, or is prophunt designed to be a 24/7 thing, so what I'm trying to do will inherently have issues?
There's a race condition in OnPluginLoad() that's triggered when manually loading the plugin that means sometimes g_PropNames is accessed before it's loaded.

Moving
Code:
    decl String:Path[256];
    BuildPath(Path_SM, Path, sizeof(Path), "data/prophunt/propnames.txt");
    g_PropNames = CreateKeyValues("g_PropNames");
    if (!FileToKeyValues(g_PropNames, Path))
        LogError("Could not load the g_PropNames file!");
To the top of OnPluginStart() i.e. before the various timers and hooks are initialized avoids it.

We've got it gracefully loading and unloading in cfgs that allows us to neatly switch our server into prophunt mode and back.

Hope this helps
rallfo is offline