Commit eef6f9d
committed
chore: rename the internal NetworkMetrics to ToolsNetworkMetrics
The last of the three type names NGO and Netcode for Entities share. This one is internal, so no user
sees it and it is not a compile error either way: a source-declared type beats an imported one, so
NGO's own assembly would take its own and warn CS0436. But once the two namespaces converge the
warning appears in our build log for a name nobody can act on from outside, and "Unity.Netcode holds
no name that collides" is a simpler thing to be able to say than "two of the three".
ToolsNetworkMetrics keeps the suffix, so it still reads as a pair with its sibling
NullNetworkMetrics - the two INetworkMetrics implementations, one behind MULTIPLAYER_TOOLS and one
not.
Five sites in two files: the declaration, both constructors, the profiler marker and the single
construction site. Everything else that reads NetworkMetrics is a property of that name on
NetworkManager, NetworkMetricsManager or NetworkTransport, all typed INetworkMetrics and untouched.
The profiler marker keeps its old string rather than following the rename. It is what shows up in the
Profiler, and an internal rename is not a reason to move it, so nameof gives way to the literal with
a comment saying why.
Verified as far as this machine allows: runtime, editor and runtime tests all compile clean, which
covers the #else branch. The renamed class is entirely inside #if MULTIPLAYER_TOOLS and the harness
has no Unity.Multiplayer.Tools references, so that branch cannot be built here. A parse pass over the
file with the define on reports only CS0246/CS0234 for the tools types and no structural error, which
is what a class and constructor disagreeing on a name would produce. The define-on path still wants a
real editor build before this is trusted.1 parent 110bc18 commit eef6f9d
3 files changed
Lines changed: 7 additions & 5 deletions
File tree
- com.unity.netcode.gameobjects/Runtime/Metrics
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
88 | | - | |
| 90 | + | |
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
| |||
0 commit comments