alliedmodders / sourcemod

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

[PVKII] Not firing OnConfigsExecuted #1738

Closed Mart-User closed 9 months ago

Mart-User commented 2 years ago

Help us help you

Environment

Description

OnConfigsExecuted forward is not being triggered for the PVKII game.

Problematic Code (or Steps to Reproduce)

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

public Plugin myinfo = {
    name = "asdf",
    author = "author",
    description = "asdf",
    version = "1.0.0",
    url = ""
}

public bool AskPluginLoad(Handle myself, bool late, char[] error, int err_max) { PrintToServer("AskPluginLoad"); return true; }
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max) { PrintToServer("AskPluginLoad2"); return APLRes_Success; }
public void OnAllPluginsLoaded() { PrintToServer("OnAllPluginsLoaded"); }
public void OnAutoConfigsBuffered() { PrintToServer("OnAutoConfigsBuffered"); }
public bool OnClientFloodCheck(int client) { PrintToServer("OnClientFloodCheck"); return true; }
public void OnClientFloodResult(int client, bool blocked) { PrintToServer("OnClientFloodResult"); return; }
public void OnConfigsExecuted() { PrintToServer("OnConfigsExecuted"); }
public int once;
public void OnGameFrame() { if (once > 0) return; PrintToServer("OnGameFrame"); once++; }
public void OnLibraryAdded(const char[] name) { PrintToServer("OnLibraryAdded"); }
public void OnLibraryRemoved(const char[] name) { PrintToServer("OnLibraryRemoved"); }
public void OnMapEnd() { PrintToServer("OnMapEnd"); }
public void OnMapStart() { PrintToServer("OnMapStart"); }
public void OnPluginEnd() { PrintToServer("OnPluginEnd"); }
public void OnPluginPauseChange(bool pause) { PrintToServer("OnPluginPauseChange"); }
public void OnServerCfg() { PrintToServer("OnServerCfg"); }
ConVar g_hCvar_Enabled;
public void OnPluginStart() {
    PrintToServer("OnPluginStart");
    CreateConVar("pvkii_version", "VERSION", "DESCRIPTION", FCVAR_NOTIFY);
    g_hCvar_Enabled = CreateConVar("pvkii_version_enable", "1", "Test", FCVAR_NOTIFY, true, 0.0, true, 1.0);
    g_hCvar_Enabled.AddChangeHook(Event_ConVarChanged);
    AutoExecConfig(true, "pvkii_test");
}
public void Event_ConVarChanged(ConVar convar, const char[] oldValue, const char[] newValue) { PrintToServer("Event_ConVarChanged"); }

Logs

Console output: ] sm plugins load pvkii_test.smx AskPluginLoad2 OnPluginStart OnLibraryAdded OnLibraryAdded OnAllPluginsLoaded OnMapStart [SM] Loaded plugin pvkii_test.smx successfully. OnGameFrame

pvkii_test.txt

Mart-User commented 2 years ago

Probably a game issue, anyway I did a workaround in the plugin that I call a RequestFrame after OnMapStart to run the OnConfigsExecuted.

Seems to work, although I'm not sure if this is "correct", anyway just letting this note here in case another game build has the same issue.

ambaca commented 2 years ago

Worked fine in Windows. And I'm using SRCDS.exe (AppID 17575)


meta version
 Metamod:Source Version Information
    Metamod:Source version 1.11.0-dev+1148
    Plugin interface version: 16:14
    SourceHook version: 5:5
    Loaded As: Valve Server Plugin
    Compiled on: Jun 24 2022 14:27:03
    Built from: https://github.com/alliedmodders/metamod-source/commit/4bdc218
    Build ID: 1148:4bdc218
    http://www.metamodsource.net/
sm version
 SourceMod Version Information:
    SourceMod Version: 1.11.0.6906
    SourcePawn Engine: 1.11.0.6906, jit-x86 (build 1.11.0.6906)
    SourcePawn API: v1 = 5, v2 = 16
    Compiled on: Jul  8 2022 14:44:49
    Built from: https://github.com/alliedmodders/sourcemod/commit/aa4145c7
    Build ID: 6906:aa4145c7
    http://www.sourcemod.net/
version
Build Label:                 0   # Uniquely identifies each build
Network PatchVersion:  0.4.3.3   # Determines client and server compatibility
Protocol version:           24   # High level network protocol version
Server version:              0
Server AppID:            17570
Mart-User commented 2 years ago

I gonna update the SM and MM and try again if don't work I will try using the same version as you. I should report again in a week.

nicedayzhu commented 1 year ago

try to set sv_hibernate_when_empty 0 in your server.cfg. Tested successfully! ref: Service hibernating

Mart-User commented 9 months ago

I updated sourcemod and did several tests in both Listen/Dedicated seems working fine now. Ty all.