1.0.4c-zio7: don't reapply tags in OnAllPluginsLoaded at server start
CSS runs OnAllPluginsLoaded before the engine's globals exist, so Utilities.GetPlayers() threw
("Global Variables not initialized yet"). Nobody is connected then anyway; tags are only
reapplied there after a hot reload.
This commit is contained in:
parent
b0e67b1ee0
commit
851397c7d9
2 changed files with 5 additions and 3 deletions
|
|
@ -44,7 +44,7 @@ public class CS2_Tags : BasePlugin
|
|||
public override string ModuleName => "CS2-Tags";
|
||||
public override string ModuleDescription => "Add player tags easily in cs2 game";
|
||||
public override string ModuleAuthor => "daffyy";
|
||||
public override string ModuleVersion => "1.0.4c-zio6";
|
||||
public override string ModuleVersion => "1.0.4c-zio7";
|
||||
|
||||
private static string TagsPath => Path.Combine(Server.GameDirectory, "csgo", "addons", "counterstrikesharp",
|
||||
"configs", "plugins", "CS2-Tags", "tags.json");
|
||||
|
|
@ -89,7 +89,9 @@ public class CS2_Tags : BasePlugin
|
|||
Logger.LogInformation(_verify == null
|
||||
? "GroupVerify isn't loaded: players without a rank tag keep their own"
|
||||
: "Using GroupVerify's clan tag for verified players without a rank tag");
|
||||
if (_verify != null)
|
||||
// Only after a hot reload: at server start nobody is connected, and the engine's globals
|
||||
// (which GetPlayers needs) don't exist yet.
|
||||
if (_verify != null && hotReload)
|
||||
ApplyAllClanTags();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,4 +112,4 @@ FORGEJO_TOKEN=... ./release.sh v<ModuleVersion>
|
|||
|
||||
`release.sh` rebuilds from the committed source and publishes `CS2-Tags-<tag>.tar.gz`, laid out
|
||||
like `game/csgo/`, to https://git.zio.sh/cs2/CS2-Tags. The tag must equal `v<ModuleVersion>`
|
||||
(`v1.0.4c-zio6` now).
|
||||
(`v1.0.4c-zio7` now).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue