From b2046b21c4412c84c85ffd933119871888fe22cb Mon Sep 17 00:00:00 2001 From: ZoNiCaL Date: Mon, 25 Nov 2024 13:48:25 +1300 Subject: [PATCH] [no ci] Shuffle player documentation, add to game event documentation (#685) --- docfx/docs/features/game-events.md | 3 +++ docfx/docs/{reference => guides}/referencing-players.md | 0 docfx/docs/guides/toc.yml | 3 +++ docfx/docs/reference/toc.yml | 5 +---- 4 files changed, 7 insertions(+), 4 deletions(-) rename docfx/docs/{reference => guides}/referencing-players.md (100%) diff --git a/docfx/docs/features/game-events.md b/docfx/docs/features/game-events.md index 3c330a3f7..5faab3797 100644 --- a/docfx/docs/features/game-events.md +++ b/docfx/docs/features/game-events.md @@ -54,6 +54,9 @@ The specific subclass of `GameEvent` will provide strongly typed parameters from These event properties are mutable so you can update them as normal and they will update in the event instance. +> [!CAUTION] +> `GameEvent` instances and their properties will cease to exist after the event listener function is called, which means that you will encounter errors when accessing properties in timers and functions like `Server.NextFrame()`. You should store the value of properties in variables before calling functions like `Server.NextFrame()` so you can read the data safely. + ## Preventing Broadcast You can modify a game event so that it does not get broadcast to clients by modifying the `bool info.DontBroadcast` property. e.g. diff --git a/docfx/docs/reference/referencing-players.md b/docfx/docs/guides/referencing-players.md similarity index 100% rename from docfx/docs/reference/referencing-players.md rename to docfx/docs/guides/referencing-players.md diff --git a/docfx/docs/guides/toc.yml b/docfx/docs/guides/toc.yml index 477af3f63..903a358f0 100644 --- a/docfx/docs/guides/toc.yml +++ b/docfx/docs/guides/toc.yml @@ -6,3 +6,6 @@ - name: Dependency Injection href: dependency-injection.md + +- name: Referencing Players + href: referencing-players.md \ No newline at end of file diff --git a/docfx/docs/reference/toc.yml b/docfx/docs/reference/toc.yml index b4de3a76c..62b630950 100644 --- a/docfx/docs/reference/toc.yml +++ b/docfx/docs/reference/toc.yml @@ -1,5 +1,2 @@ - name: Core Configuration - href: core-configuration.md - -- name: Referencing Players - href: referencing-players.md + href: core-configuration.md \ No newline at end of file