Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large-scale engine refactor #58

Merged
merged 272 commits into from
Apr 5, 2023
Merged
Changes from 1 commit
Commits
Show all changes
272 commits
Select commit Hold shift + click to select a range
abb947a
Move performance overlay just above console overlay
xezno Feb 7, 2023
5fec8c3
Start splitting Root into Client/ServerRoot
xezno Feb 8, 2023
10cb567
Gigarefactor 1: Move all global vars into Root
xezno Feb 8, 2023
9911615
Gigarefactor 2: Rename old global variables, prefix with m_
xezno Feb 8, 2023
60d83a5
Gigarefactor 3: Give all ISubSystems a Root parent, don't derive Root…
xezno Feb 8, 2023
c623d04
Gigarefactor 4: Re-write all bindings (see desc)
xezno Feb 8, 2023
de82ffe
Cleanup
xezno Feb 8, 2023
7121b7f
New entity and input bindings
xezno Feb 9, 2023
075668b
Gigarefactor: Replace ClientRoot singleton with inline FindInstance()
xezno Feb 9, 2023
7caabd1
Use ref for FindInstance instead of pointer
xezno Feb 9, 2023
6629d13
Handle pointers properly in interop glue
xezno Feb 9, 2023
38edfa4
Add ctor binding for Model
xezno Feb 9, 2023
5874e3c
Delete physics.h bindings file, bind PhysicsManager directly
xezno Feb 9, 2023
1dd3555
Switch more things over to using root parent instead of FindInstance()
xezno Feb 9, 2023
638d0b2
Move more stuff over to m_parent
xezno Feb 9, 2023
a31dade
Delete engine.h bindings file, move into Root
xezno Feb 9, 2023
3385334
Add global managed `Engine` property based on root
xezno Feb 9, 2023
777bac2
Rename `Engine` to `NativeEngine`
xezno Feb 9, 2023
127ad51
Remove mocha-minimal API test
xezno Feb 9, 2023
ac73051
Set root based on host manager parent
xezno Feb 9, 2023
36cc2f6
Merge remote-tracking branch 'origin/master' into networking
xezno Feb 9, 2023
f4cf045
Merge remote-tracking branch 'origin/master' into networking
xezno Feb 9, 2023
f3a724b
Interopgen pointer returns shouldn't call ctors - we might not have one
xezno Feb 9, 2023
2c72e0f
Pass root to everything render-related too
xezno Feb 9, 2023
bed3e1a
Create two threads - client & listen server - for now
xezno Feb 10, 2023
fc15f73
Only load some stuff once. I'm really tired so I'll do this better in…
xezno Feb 10, 2023
4b5ca1a
Detach server thread, only do game compiles on server (think I'll rew…
xezno Feb 10, 2023
ce8ba07
Move editor bindings into a subsystem
xezno Feb 11, 2023
5f60807
Remove FindInstance() and all instances of it
xezno Feb 11, 2023
8207ccc
Fuck Singletons
xezno Feb 11, 2023
e98e559
Pass m_parent to CVarEntry...
xezno Feb 11, 2023
da6718f
Move C++ stuff into proper folders and update includes
xezno Feb 13, 2023
1a6a4a1
Remove parent root system, put everything in a `Globals` namespace in…
xezno Feb 13, 2023
ef4ec65
Add `Globals::m_isDedicatedServer` so we can change things like loggi…
xezno Feb 13, 2023
376256b
Logger: take logger name from managed, log to console in dedicated se…
xezno Feb 13, 2023
3b9dff3
Load assembly multiple times - once for server, once for client
xezno Feb 14, 2023
0a20a5d
Split public/private BaseGame API
xezno Feb 14, 2023
e29b84d
Cleanup
xezno Feb 14, 2023
ee7ec91
Cleanup 2
xezno Feb 14, 2023
8135606
Crappy Server/Client Only test funcs
xezno Feb 14, 2023
fdcec82
Notifications: fix instances where notifications would share the same…
xezno Feb 14, 2023
e8218b8
Set server context before calling IGame.Startup
xezno Feb 14, 2023
c612c88
Only spawn entities on server, only spawn UI on client
xezno Feb 14, 2023
cbab982
We won't have enough specific code to warrant splitting networking in…
xezno Feb 14, 2023
078cf4c
Stop C# complaining about nullability in `Global`
xezno Feb 16, 2023
f83b758
Basic native GameNetworkingSockets bindings/setup
xezno Feb 17, 2023
e301a15
InteropGen managed type conversions for int32_t and Handle
xezno Feb 17, 2023
67537d2
Basic server outline - needs callbacks etc
xezno Feb 17, 2023
3c768e5
Start setting up C++ -> C# callbacks
xezno Feb 17, 2023
02624b0
Add SetConnectedCallback and Test method to Server class
xezno Feb 17, 2023
ee1e7ec
Split valvesockets into valvesocketclient and valvesocketserver
xezno Feb 17, 2023
754e816
Managed callback include fixes (oops)
xezno Feb 17, 2023
a975426
Call PumpEvents on server
xezno Feb 17, 2023
f552562
Implement GameNetworkingSockets init inside a NetworkingManager
xezno Feb 17, 2023
770d06b
client/server state change debug
xezno Feb 17, 2023
9f9d301
Undefine VMA_DEBUG_LOG for now because it's messing with my vibe...
xezno Feb 17, 2023
6582c63
Register SteamNetConnectionStatusChangedCallback in the same way as t…
xezno Feb 17, 2023
5eb314b
Pump events on client & run callbacks everywhere
xezno Feb 18, 2023
2e7cdd7
Only create server on dedicated instances for now (listen servers later)
xezno Feb 18, 2023
106fd7a
Run callbacks independently of events
xezno Feb 18, 2023
681702d
Call Update manually for client/server, need to move this stuff outsi…
xezno Feb 18, 2023
493767e
Fix unhelpful error message in ValveSocketServer::PumpEvents()
xezno Feb 18, 2023
3fecaf7
It is generally a good idea to initialise poll groups before using th…
xezno Feb 18, 2023
124b496
Don't automatically break on ErrorMessage
xezno Feb 18, 2023
9f649fa
Add logging to catch network connection errors
xezno Feb 18, 2023
62ba700
oopsie
xezno Feb 18, 2023
f528236
Assign s_client and s_server, accept connections serverside
xezno Feb 18, 2023
23a0f26
Cast HostManager::InvokeCallback handle to void pointer type, instead…
xezno Feb 18, 2023
771773f
Clean up ValveSocketClient::OnConnectionStatusChanged error handling
xezno Feb 18, 2023
e300045
Add sending of test data and logging of received messages in valvesoc…
xezno Feb 18, 2023
dc487ed
Add logging for callbacks, register callbacks for C++
xezno Feb 18, 2023
178a46b
Add generic `InvokeCallback` that accepts args on native side...
xezno Feb 18, 2023
19d6fac
Update c++ InvokeCallback to accept void* arg
xezno Feb 18, 2023
4797c85
Add support for managed callbacks with args
xezno Feb 18, 2023
92ec42c
Add client connection handle to connection map and invoke callback
xezno Feb 18, 2023
cc6c7b6
Refactor HostManager methods to use InternalInvokeCallback for callba…
xezno Feb 18, 2023
d07e7f2
Refactor ManagedCallback to use a single InvokeCallback method
xezno Feb 18, 2023
dc12630
HandleMap::RemoveAt and HandleMap::Remove
xezno Feb 18, 2023
a8a54a6
ValveSocketServer: remove connection on disconnect
xezno Feb 18, 2023
99e9afe
Free memory allocated in ValveSocketClient::OnConnectionStatusChanged
xezno Feb 19, 2023
9de4e50
Add HandleMap::Find function, locates a handle for a specified object
xezno Feb 19, 2023
045aa14
ValveSocketServer: check if a client is already connected, if so then…
xezno Feb 19, 2023
9a901a6
Clean up managed callbacks and ConnectedClient structure
xezno Feb 19, 2023
0d33469
ValveSocketClient: wrap logged IP in quotation marks
xezno Feb 19, 2023
8006601
Remove native Root::CreateListenServer() - we're doing this in manage…
xezno Feb 19, 2023
74d86f6
Remove gitdefs.h and associated GAME_VERSION macro
xezno Feb 19, 2023
9a7c99f
Add ValveSocketClient::SendData function, sends data from client to c…
xezno Feb 19, 2023
aa074a8
Don't invoke SendMessageToConnection if we aren't connected... (eg. s…
xezno Feb 19, 2023
d9d8f65
Add ValveSocketReceivedMessage struct and handle message reception in…
xezno Feb 19, 2023
fca9051
Move EntityRegistry, IEntity, Global, GlobalVars, ManagedCallbackDisp…
xezno Feb 19, 2023
2222ac9
Make server callbacks virtual, clean up
xezno Feb 19, 2023
4fdfbba
Add method to get remote address of client in ValveSocketServer
xezno Feb 19, 2023
7d628fa
Add BaseGameServer to Mocha.Networking
xezno Feb 19, 2023
00c97cc
Update logging messages to info level for BaseGameServer connection e…
xezno Feb 19, 2023
52b3019
Remove native test send/receive data
xezno Feb 19, 2023
2353022
Update Client to send data without a null terminator
xezno Feb 19, 2023
0ed44ed
Test to check that sending client data works - will re-write this in …
xezno Feb 19, 2023
225620a
New network message serialization scheme
xezno Feb 19, 2023
02c8d79
Add Kick() method to Server class
xezno Feb 19, 2023
453ddfa
Basic outline for networkable types, implicitly converted to/from C# …
xezno Feb 19, 2023
58e53f2
Use BinaryWriter/BinaryReader for serialize/deserialize in INetType
xezno Feb 20, 2023
dfbcf7f
Implement NetFloat (wonder if we could codegen some of these?)
xezno Feb 20, 2023
fda176c
Move INetType, NetFloat, and NetString into Mocha.Common
xezno Feb 21, 2023
e80bbb1
Make BaseNetworkMessage an interface, add static MessageId property
xezno Feb 21, 2023
336e79d
ValveSocketClient data received callbacks
xezno Feb 21, 2023
30c0ff8
Use JSON for network serialization for now, add BaseGameClient
xezno Feb 21, 2023
de1b1df
Add base `ConnectionManager`, client and server both inherit from thi…
xezno Feb 21, 2023
714e7ca
Add Send & SendData to IConnection interface
xezno Feb 21, 2023
86b1061
Add local vcpkg dirs to Mocha/MochaDedicatedServer projects, see if t…
xezno Feb 21, 2023
a78e2cc
Mocha & MochaDedicatedServer: use vcpkg manifest, specify x64-windows…
xezno Feb 21, 2023
1a422b3
Make INetType public so that users can define their own custom networ…
xezno Feb 21, 2023
c33be79
Add custom networked type to mocha-minimal
xezno Feb 21, 2023
9d63c9a
Fix CWD and mix mode debugging on Mocha executables
peter-r-g Feb 22, 2023
b47dd8b
Give client connections a nickname
xezno Feb 22, 2023
34c0d5e
Send handshake & initial snapshot update on connecting
xezno Feb 22, 2023
269b367
Update networking messages to use type name for identification and se…
xezno Feb 22, 2023
6b60cca
Assert that initial compile succeeds
peter-r-g Feb 22, 2023
92c6c31
Allow Server/ClientOnly to be put on any declarations
peter-r-g Feb 22, 2023
82b9078
Remove kick test
xezno Feb 22, 2023
918c8c3
Walk all declarations for server/client stripping
peter-r-g Feb 22, 2023
cff1eed
Prefer async method
peter-r-g Feb 22, 2023
2f3cd3a
Add NetworkId and NetworkIdConverter classes
xezno Feb 22, 2023
14dce2c
Add NetworkId property and create on instantiation
xezno Feb 22, 2023
9e2eb70
Add support for NetworkIdConverter in NetworkSerializer
xezno Feb 22, 2023
858e977
Add NetworkId to IEntity and populate SnapshotUpdateMessage for netwo…
xezno Feb 22, 2023
e547406
Remove logging for registering new callback and invoking it
xezno Feb 22, 2023
d104b6a
Spawn new entities inside SnapshotUpdateMessage
xezno Feb 22, 2023
2883424
Minor formatting fix
xezno Feb 22, 2023
26f414f
Add Quaternion, Vector2, Vector3 JSON converters; move all converters…
xezno Feb 23, 2023
924c89d
Document NetworkId
xezno Feb 23, 2023
4e44afa
Add [Replicated] for properties and fields we want to replicate over …
xezno Feb 23, 2023
b223c9a
Add [Replicated] to properties on BaseEntity and ModelEntity
xezno Feb 23, 2023
514efe4
Rename FieldChanges to MemberChanges, use fields and properties
xezno Feb 23, 2023
6ccb072
Use all new converters inside NetworkSerializer
xezno Feb 23, 2023
55c6b6b
Merge pull request #49 from peter-r-g/debugging-fix
xezno Feb 23, 2023
bde6860
NetworkId documentation - add fancy markup
xezno Feb 23, 2023
2fc043e
Piss-poor stop-gap implementation for physics serialization
xezno Feb 23, 2023
b16fa83
Spawn player in air
xezno Feb 23, 2023
9b08cd9
Compress JSON data inside NetworkSerializer - we should probably be s…
xezno Feb 23, 2023
ddf0d3a
Merge pull request #50 from peter-r-g/peter-r-g/networking-compiler-c…
xezno Feb 23, 2023
7bfae75
Custom sucky network serializer - replacing this with something more …
xezno Feb 25, 2023
36f6bde
Use MessagePack for serialization instead :)
xezno Feb 25, 2023
d28b0fb
Implement custom formatter for Vector3, link to MochaResolver for use…
xezno Feb 25, 2023
5113567
Implement IEquatable for NetworkId, override Equals
xezno Feb 25, 2023
23abdcf
Allow all Mocha projects to see internals for Mocha.Common
xezno Feb 25, 2023
5120f99
Implement NetworkIdFormatter, add serialization test
xezno Feb 25, 2023
6652e4b
Expand hex dump to 16 bytes per line
xezno Feb 25, 2023
6bece19
NetworkSerializerTests cleanup
xezno Feb 25, 2023
1a11225
Add Rotation formatter & add test titles
xezno Feb 25, 2023
b7750e7
Hex dump: only print characters in range [32...127]: https://www.asci…
xezno Feb 25, 2023
18422a5
Add MessagePack runtimes
xezno Feb 25, 2023
e0245b9
Serialize EntityMemberChange values as byte array data
xezno Feb 25, 2023
675d89c
Use explicitly declared enum for message IDs instead of string, this …
xezno Feb 25, 2023
a49b16f
Enable compression inside NetworkSerializer so that we're sending les…
xezno Feb 25, 2023
d8fcf3d
Don't log dump
xezno Feb 25, 2023
80a1505
NetType is kill
xezno Feb 25, 2023
74c309b
[Replicated] is now [Sync]
xezno Feb 25, 2023
c57ecbf
Fix sln
xezno Feb 27, 2023
ac48ec9
Add JetBrains .idea directory to gitignore
xezno Feb 27, 2023
d791f63
Big HostManager cleanup
xezno Feb 27, 2023
d46f6d1
Hide networking window by default (we're not even using it??)
xezno Feb 27, 2023
eb9ad43
Project/solution configuration changes (see desc)
xezno Feb 27, 2023
12b6b08
Release - build multi-threaded DLL instead of multi-threaded debug DLL
xezno Feb 27, 2023
e427551
Revert "Release - build multi-threaded DLL instead of multi-threaded …
xezno Feb 27, 2023
a72979a
Revert "Project/solution configuration changes (see desc)"
xezno Feb 27, 2023
32a0db2
Submodules: fix case sensitive paths in .gitmodules
xezno Feb 27, 2023
581ca9b
Move renderdoc_app.h back into Renderdoc/ (not sure how this happened?)
xezno Feb 28, 2023
3f142f8
Refactor player so that we can get rid of half extents, do velocity p…
xezno Feb 28, 2023
eedd969
Make game client & server static so hotload doesn't destroy them
xezno Feb 28, 2023
637e890
Mark messages with keyAsPropertyName true so we don't have to specify…
xezno Feb 28, 2023
4822fda
Remove and add a bunch of runtime DLLs
peter-r-g Mar 2, 2023
89e0110
Add IClient interface for representing connected clients
xezno Mar 2, 2023
1dafdcb
Don't manually call WalkController update - [Event.Tick] handles it f…
xezno Mar 2, 2023
e1af6aa
Add server connection events and methods to BaseGame class
xezno Mar 2, 2023
7e015d7
Ignore properties directory under mocha sample
peter-r-g Mar 4, 2023
4bae576
Hotload overhaul (See desc)
peter-r-g Mar 6, 2023
083decd
Replace hard-coded directories in launch settings
peter-r-g Mar 8, 2023
d4cc341
Add -project command-line option
peter-r-g Mar 8, 2023
9daebad
Add -project option to csproj launch settings
peter-r-g Mar 8, 2023
7fdea40
Refactor units to be readonly
peter-r-g Mar 9, 2023
dc1eddf
Make units sealed classes
peter-r-g Mar 9, 2023
ec926ae
Rename Field > Variable
peter-r-g Mar 9, 2023
596f716
Rename Structure > Struct
peter-r-g Mar 9, 2023
4b305bc
Fix fields not updating in Parser
peter-r-g Mar 9, 2023
d33482f
Minor changes
peter-r-g Mar 9, 2023
6534660
Add early bail to method parsing
peter-r-g Mar 9, 2023
957141f
Move constructor logic
peter-r-g Mar 9, 2023
2302bb4
Add destructor method parsing
peter-r-g Mar 9, 2023
ee9732f
Move HasGenerateBindingsAttribute to extension method
peter-r-g Mar 9, 2023
dcb7499
Minor changes
peter-r-g Mar 9, 2023
83605a1
Make Parser.GetUnits return IEnumerable instead
peter-r-g Mar 9, 2023
d9de125
Make BaseCodeGenerator.GetHeader a static property
peter-r-g Mar 9, 2023
1f9eb1e
Merge pull request #55 from peter-r-g/hotload-overhaul
xezno Mar 9, 2023
b3921bd
Minor change
peter-r-g Mar 9, 2023
602ef1c
Merge pull request #56 from peter-r-g/project-command-line
xezno Mar 9, 2023
e9f1ace
Update ThreadDispatcher to Mocha.Common version
peter-r-g Mar 9, 2023
2c1d882
Drop sleep timer on waiting for thread dispatcher
peter-r-g Mar 9, 2023
36c919b
Tweak ThreadDispatcher namespace
peter-r-g Mar 9, 2023
c9c2664
Refactor units to be readonly
peter-r-g Mar 9, 2023
0ed975a
Make units sealed classes
peter-r-g Mar 9, 2023
ae59d0c
Rename Field > Variable
peter-r-g Mar 9, 2023
065d841
Rename Structure > Struct
peter-r-g Mar 9, 2023
3b0083a
Fix fields not updating in Parser
peter-r-g Mar 9, 2023
f056e3e
Minor changes
peter-r-g Mar 9, 2023
f0b6440
Add early bail to method parsing
peter-r-g Mar 9, 2023
203f070
Move constructor logic
peter-r-g Mar 9, 2023
321f958
Add destructor method parsing
peter-r-g Mar 9, 2023
d0a3cba
Move HasGenerateBindingsAttribute to extension method
peter-r-g Mar 9, 2023
bef236c
Minor changes
peter-r-g Mar 9, 2023
c068836
Make Parser.GetUnits return IEnumerable instead
peter-r-g Mar 9, 2023
5641148
Make BaseCodeGenerator.GetHeader a static property
peter-r-g Mar 9, 2023
e14e791
Minor change
peter-r-g Mar 9, 2023
bb6eb45
Update ThreadDispatcher to Mocha.Common version
peter-r-g Mar 9, 2023
f203dad
Drop sleep timer on waiting for thread dispatcher
peter-r-g Mar 9, 2023
73fc8a7
Tweak ThreadDispatcher namespace
peter-r-g Mar 9, 2023
df59f55
Merge branch 'peter-r-g/interop-gen-cleanup' of https://github.com/pe…
peter-r-g Mar 10, 2023
9eece4e
Refactor code generators
peter-r-g Mar 10, 2023
7b77b44
Remove refs on reference type parameters
peter-r-g Mar 10, 2023
b594a59
Lots of cleanup
peter-r-g Mar 10, 2023
b53462a
Just send snapshots every frame (this will be slow af until we do del…
xezno Mar 4, 2023
2f73eeb
Release messages after we're done with them (and not before)
xezno Mar 6, 2023
4500774
Merge remote-tracking branch 'origin/master' into networking
xezno Mar 10, 2023
d169875
Apply formatting fixes
xezno Mar 10, 2023
d5bdcf1
Internalize/privatize everything
peter-r-g Mar 13, 2023
282e839
Documentation pass on Unit items
peter-r-g Mar 13, 2023
93ff2bc
Cleanup VcxprojParser
peter-r-g Mar 13, 2023
becc7a1
Documentation pass
peter-r-g Mar 15, 2023
04bcd3b
Switch to ILogger instead of Console writing
peter-r-g Mar 15, 2023
316fce7
Cleanup
peter-r-g Mar 15, 2023
ef57a22
Fix launchSettings.json working directory
peter-r-g Mar 15, 2023
c0cde01
Initialize lookup table once statically
peter-r-g Mar 15, 2023
2af966f
Only search Mocha.Host project for headers
peter-r-g Mar 15, 2023
e477302
Filter files by *.h instead of grabbing all
peter-r-g Mar 15, 2023
e643517
Document code generators
peter-r-g Mar 17, 2023
ec7ba13
Move extensions to separate namespace
peter-r-g Mar 17, 2023
7c791ab
Move code generators to separate namespace
peter-r-g Mar 17, 2023
3e0fdce
Move parsing items to separate namespace
peter-r-g Mar 17, 2023
9a5b6fe
Foundation -> Framework
xezno Mar 13, 2023
854ee9c
Implement basic linear allocator
xezno Mar 13, 2023
b22a96e
Implement SystemAllocator
xezno Mar 13, 2023
dc0be35
Implement custom array (currently unsafe)
xezno Mar 13, 2023
0846f53
Benchmark: add benchmarks for array w/ both allocators
xezno Mar 13, 2023
bd85095
AllowShortFunctionsOnASingleLine: None
xezno Mar 13, 2023
e3c8396
Mocha::Array safety checks
xezno Mar 13, 2023
207942b
Mocha::HandleMap refactor (see desc)
xezno Mar 13, 2023
0672bfb
Delete everything networking-related so we can merge this stuff into …
xezno Apr 5, 2023
d18d4ca
Remove all networking stuff from minimal
xezno Apr 5, 2023
2837fe0
Merge pull request #57 from peter-r-g/interop-gen-cleanup
xezno Apr 5, 2023
b773d09
Merge branch 'networking' into engine-refactor
xezno Apr 5, 2023
de35d9d
Apply formatting fixes
xezno Apr 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add support for NetworkIdConverter in NetworkSerializer
xezno committed Feb 22, 2023
commit 9e2eb70cf4fb518fd8b2b1f31aa1bfee5953d3d2
24 changes: 22 additions & 2 deletions Source/Mocha.Networking/Serialization/NetworkSerializer.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
using System.Text.Json;
using Mocha.Common;
using System.Text.Json;

namespace Mocha.Networking;

internal static class NetworkSerializer
{
private static JsonSerializerOptions CreateJsonSerializerOptions()
{
var deserializeOptions = new JsonSerializerOptions();
deserializeOptions.Converters.Add( new NetworkIdConverter() );

return deserializeOptions;
}

public static byte[] Serialize( object obj )
{
return JsonSerializer.SerializeToUtf8Bytes( obj );
return JsonSerializer.SerializeToUtf8Bytes( obj, CreateJsonSerializerOptions() );
}

public static T Deserialize<T>( byte[] data )
{
return JsonSerializer.Deserialize<T>( data, CreateJsonSerializerOptions() );
}

public static object? Deserialize( byte[] data, Type type )
{
return JsonSerializer.Deserialize( data, type, CreateJsonSerializerOptions() );
}
}
8 changes: 3 additions & 5 deletions Source/Mocha.Networking/Shared/ConnectionManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Text.Json;

namespace Mocha.Networking;
namespace Mocha.Networking;

public class ConnectionManager
{
@@ -16,13 +14,13 @@ protected void RegisterHandler<T>( Action<IConnection, T> handler ) where T : IB

protected void InvokeHandler( IConnection connection, byte[] data )
{
var message = JsonSerializer.Deserialize<NetworkMessageWrapper>( data )!;
var message = NetworkSerializer.Deserialize<NetworkMessageWrapper>( data )!;

foreach ( var (type, handler) in _messageHandlers )
{
if ( type == message.Type )
{
var messageData = JsonSerializer.Deserialize( message.Data, handler.type )!;
var messageData = NetworkSerializer.Deserialize( message.Data, handler.type )!;
handler.Action?.Invoke( connection, messageData );
return;
}