Nitrox icon indicating copy to clipboard operation
Nitrox copied to clipboard

Upgrade packet serializer

Open SpaceMonkeyy86 opened this issue 2 years ago • 3 comments

Replaces the current serializer, BinaryFormatter, with a modified version of BinaryPack: https://github.com/SubnauticaNitrox/BinaryPack

This serializer is faster, uses less memory, is more secure, and produces a smaller output.

Resolves a part of #1473.

SpaceMonkeyy86 avatar May 10 '22 21:05 SpaceMonkeyy86

Ok, the pr already seems pretty solid. Things I thought about we need to look into:

  • [x] Reviewing/Merging the parameter constructor pr (https://github.com/SubnauticaNitrox/BinaryPack/pull/1)
  • [x] Using parameter constructor where it makes sense (important to double check parameter spelling)
  • [x] Updating README of the BinaryPack repo so it doesn't look like a 1:1 copy
  • [x] Uploading our fork to NuGet (will be done by Meas but acc will take a little to be verified) and replacing the dll file with a reference

Jannify avatar May 21 '22 19:05 Jannify

Parameter constructors have been implemented, all that's left to do now is in-game testing, fixing the unit tests, and uploading the library to NuGet.

SpaceMonkeyy86 avatar Aug 26 '22 22:08 SpaceMonkeyy86

It's done 🎉

SpaceMonkeyy86 avatar Sep 14 '22 21:09 SpaceMonkeyy86

In NitroxModel.DataStructures.GameLogic.VehicleModel public NitroxTechType TechType { get; } needs to also have the set or json serialization fails.

Jannify avatar Oct 05 '22 10:10 Jannify

Doing a quick in-game test it seems like something partially breaks the game/sync. Every time I joined a world both players joined in different (fully repaired) escapepods which weren't visible to the other. While they could see each other flora wasn't synced either. Do you have the same result or something different?

Jannify avatar Oct 05 '22 11:10 Jannify

Doing a quick in-game test it seems like something partially breaks the game/sync. Every time I joined a world both players joined in different (fully repaired) escapepods which weren't visible to the other. While they could see each other flora wasn't synced either. Do you have the same result or something different?

Yes, I got that same issue. I briefly looked into it but couldn't find anything wrong with the class definitions so I concluded that some other part of the codebase was at fault. If it helps there is a NullReferenceException thrown upon joining that might help pinpoint the issue.

SpaceMonkeyy86 avatar Oct 05 '22 11:10 SpaceMonkeyy86

Tested IG with Jannify No outstanding errors yet, seems to improve user experience quite a bit.

Might need to do a bigger test sessions with 5+ players doing a casual gameplay

dartasen avatar Oct 26 '22 11:10 dartasen

Really glad development is coming along nicely. I got to test all the new changes

sarayuuki avatar Oct 26 '22 12:10 sarayuuki