sourcemod icon indicating copy to clipboard operation
sourcemod copied to clipboard

[PVKII] Not firing OnConfigsExecuted

Open Mart-User opened this issue 2 years ago • 3 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.
  • [X] I can always reproduce the issue with the provided description below.

Environment

  • Operating System version: Windows
  • Game/AppID (with version if applicable): 17570 (Version 0.4.3.3)
  • Current SourceMod version: 1.11.0.6863
  • Current Metamod: Source snapshot: 1.12.0-dev+1157V
  • [ 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

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 avatar Apr 09 '22 13:04 Mart-User

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.

Mart-User avatar Apr 14 '22 17:04 Mart-User

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

ambaca avatar Jul 28 '22 07:07 ambaca

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.

Mart-User avatar Jul 28 '22 08:07 Mart-User

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

nicedayzhu avatar Feb 06 '23 16:02 nicedayzhu

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

Mart-User avatar Feb 01 '24 19:02 Mart-User