Major Netcode Refactor #180
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Notes
The reflection code in
PacketRegistry
will be kept as it completely removes the need to manually register each individual packet class. Maybe in the future a source generator could handle this task so the reflection cost on startup is completely removed.Changelog
Performance
GetOpcode()
does not need to retrieve them on every lookupAssembly.GetExecutingAssembly().GetTypes()
inPacketRegistry
is now cached for single lookupMapPackets<T>
now uses an array instead of aList
IgnoredPackets
now uses aHashSet
instead ofList
Readability
PacketRegistry
GodotServer
GodotClient
Usability
res://Framework/GodotUtils/Netcode/Sandbox/TopDown/
NetControlPanelLow
now requires its extending class to implementENetOptions Options
and all the UI button nodesNETCODE_ENABLED
which can easily be disabled by removing the constant from.csproj
Bug Fixes
ToFormattedString(this object v)
in GodotUtils returning extra blank linesSystem.IO.EndOfStreamException
is thrownLogger.Update()
now only runs ifNETCODE_ENABLED
constant existsDEBUG
define wrapped aroundVisualize
using causing non-debug release builds to failValdiateResourceFile(...)
inOptionsManager
now also detects resource files with empty script paths caused by projects being ran in exported release mode