You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The plugin's purpose IS the reflection approach, so name it by technique: the
pair is now Reflection vs Publicized. Renames the folder, project, namespace,
class, and solution entry, and updates the README + Dependabot directories.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Both reference the **same game build** (`3.26.3.3`) and both read `SDG.Unturned.
10
10
11
11
| Project | Redist package | How it reads the non-public field |
12
12
| --- | --- | --- |
13
-
|[`NonPublicized/`](NonPublicized)|`RocketModFix.Unturned.Redist.Server`|**Reflection** — string-keyed, not compile-checked, slower |
13
+
|[`Reflection/`](Reflection)|`RocketModFix.Unturned.Redist.Server`|**Reflection** — string-keyed, not compile-checked, slower |
14
14
|[`Publicized/`](Publicized)|`RocketModFix.Unturned.Redist.Server.Publicized` (+ `AllowUnsafeBlocks`) |**Direct field access** — compile-checked, fast |
15
15
16
16
## Why publicize instead of reflection?
@@ -21,7 +21,7 @@ A direct `Provider.isDedicatedUGCInstalled` **doesn't compile** against the plai
21
21
CS0117: 'Provider' does not contain a definition for 'isDedicatedUGCInstalled'
22
22
```
23
23
24
-
So without publicizing, your only option is **reflection** ([`NonPublicized/`](NonPublicized/NonPublicizedExamplePlugin.cs)):
24
+
So without publicizing, your only option is **reflection** ([`Reflection/`](Reflection/ReflectionExamplePlugin.cs)):
25
25
26
26
```csharp
27
27
FieldInfofield=typeof(Provider).GetField(
@@ -71,8 +71,8 @@ Builds both projects (via `UnturnedRedistExample.sln`); the DLLs land in each pr
71
71
3. Start the server and watch the console — both read the same value, the hard way and the easy way:
72
72
73
73
```
74
-
[UnturnedRedistExample.NonPublicized] Loaded. Read non-public isDedicatedUGCInstalled = False via REFLECTION ...
75
-
[UnturnedRedistExample.Publicized] Loaded. Read NON-public Provider.isDedicatedUGCInstalled = False via the .Publicized redist.
74
+
[UnturnedRedistExample.Reflection] Loaded. Read non-public isDedicatedUGCInstalled = False via REFLECTION ...
75
+
[UnturnedRedistExample.Publicized] Loaded. Read NON-public Provider.isDedicatedUGCInstalled = False via the .Publicized redist.
76
76
```
77
77
78
78
Seeing those lines confirms each plugin **loaded** and read the non-public member **at runtime**. (For the publicized one, that also proves `AllowUnsafeBlocks` did its job — if publicization were broken you'd get a `FieldAccessException` instead.)
0 commit comments