Skip to content

Refactor serialization system#702

Merged
Slendy merged 43 commits into
LBPUnion:mainfrom
Slendy:serialization-refactor
Mar 28, 2023
Merged

Refactor serialization system#702
Slendy merged 43 commits into
LBPUnion:mainfrom
Slendy:serialization-refactor

Conversation

@Slendy
Copy link
Copy Markdown
Contributor

@Slendy Slendy commented Mar 10, 2023

This PR does away with the whole LbpSerializer string concatenation serialization system and moves to a modified version of the C# XML serializer. It had to be changed because LBP doesn't exactly follow XML specifications, so things like namespaces and type-identifying attributes aren't used and must be removed from the normal output. There are some potential performance benefits to this PR because data for an object needed for serialization is now loaded separately rather than having to inner join an entire user with a slot just to get their username.
The main takeaway from this PR is that all database entities have been renamed to follow the Entity naming convention to differentiate them from other types. They have also been stripped of all serialization-related types, attributes, and methods so that they are strictly for storing data. Then there are objects that implement ILbpSerializable that have methods to take an Entity and convert it to a serializable class. For deserializing objects, there are methods in the serialization classes to convert an ILbpSerializable to its Entity counterpart.

Slendy added 28 commits March 3, 2023 04:12
Still needs to be fine tuned to match original implementation
Many things are left in a broken state like website features/api endpoints/lbp3 categories
Many things are still broken but progress is steadily being made
Fix recursive PrepareSerialization when recursive item is set during root item's PrepareSerialization, items, should be properly indexed in order but it's only tested to 1 level of recursion
…amed result

instead of StatusCode(403) everything is now in the form of Forbid()
@Slendy Slendy marked this pull request as ready for review March 15, 2023 09:53
Copy link
Copy Markdown
Contributor

@W0lf4llo W0lf4llo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just quickly skimmed over most of the changes and from what I can see there doesn’t seem to be anything gamebreaking.

TL;DR
LGTM

Copy link
Copy Markdown
Member

@sudokoko sudokoko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not seeing anything production-breaking, though might be worth testing on staging.slendy.pw if not already.

LGTM.

Slendy added 15 commits March 16, 2023 15:06
# Conflicts:
#	ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs
#	ProjectLighthouse.Servers.GameServer/Types/Categories/CategoryWithUser.cs
#	ProjectLighthouse.Servers.GameServer/Types/Categories/CustomCategory.cs
#	ProjectLighthouse.Servers.GameServer/Types/Categories/HeartedCategory.cs
#	ProjectLighthouse.Servers.GameServer/Types/Categories/LuckyDipCategory.cs
#	ProjectLighthouse.Servers.GameServer/Types/Categories/MostPlayedCategory.cs
#	ProjectLighthouse.Servers.GameServer/Types/Categories/NewestLevelsCategory.cs
#	ProjectLighthouse.Servers.GameServer/Types/Categories/QueueCategory.cs
#	ProjectLighthouse.Servers.GameServer/Types/Categories/TeamPicksCategory.cs
#	ProjectLighthouse/Types/Entities/Level/Slot.cs
@Slendy Slendy added this pull request to the merge queue Mar 28, 2023
Merged via the queue into LBPUnion:main with commit 329ab66 Mar 28, 2023
@daggintosh
Copy link
Copy Markdown
Contributor

i declare this pr yolo'd

@Slendy Slendy deleted the serialization-refactor branch March 28, 2023 00:46
Oo1Toyo1oO added a commit to Oo1Toyo1oO/ProjectLighthouse that referenced this pull request May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants