Commit Graph

36 Commits

Author SHA1 Message Date
Ben Marsh
0f2489886e Update Engine/Source/Programs/Shared to use same .editorconfig rules as Horde.
[CL 27945430 by Ben Marsh in ue5-main branch]
2023-09-16 12:23:02 -04:00
Ben Marsh
14aee7947a Horde: Enable code style warnings in "Analyze" configuration for Horde.Agent and Horde.Agent.TrayApp, and fix current violations.
[CL 27806357 by Ben Marsh in ue5-main branch]
2023-09-12 16:20:59 -04:00
Ben Marsh
a18916d4e7 Horde: Various static analyzer fixes.
[CL 27059541 by Ben Marsh in ue5-main branch]
2023-08-12 10:14:12 -04:00
Joakim Lindqvist
09c59bec33 Fixed inconsistencies between CbPackage serialization in C# and from Zen, these now write the same format. Resolves issues when using CbPackage during cook against Unreal Cloud DDC.
#preflight none

[CL 24589690 by Joakim Lindqvist in ue5-main branch]
2023-03-10 06:59:02 -05:00
Ben Marsh
f69c510598 EpicGames.Serialization: Fix writing of CB fields at the root of the output object.
* CbWriter was expecting BeginObject/BeginArray call before any fields were written, so did not handle writing fields directly to the root scope.
* Fields written at the root scope were not being flushed immediately after writing. Rest of the class assumes that any complete fields at root scope had already been accounted for in object size.

#preflight none
#fyi Joakim.Lindqvist

[CL 24520927 by Ben Marsh in ue5-main branch]
2023-03-06 09:00:40 -05:00
Ben Marsh
6fac200317 EpicGames.Serialization: Refactoring CbWriter.
* New base class (CbWriterBase) has a virtual method to allocate chunks of memory for output, while still sharing common functionality for tracking scope state.
* Data for fixing up size/offset fields is written to blocks of memory returned by the CbWriterBase allocator rather than just to the final output buffer.
* Added support for embedded externally allocated blocks of data into the output stream, correctly updating size fields of containing fields.

#preflight none
#fyi Joakim.Lindqvist

[CL 24505997 by Ben Marsh in ue5-main branch]
2023-03-03 15:37:45 -05:00
Ben Marsh
39c3634a64 EpicGames.Serialization: Fix static analysis warnings.
#preflight none

[CL 22315522 by Ben Marsh in ue5-main branch]
2022-10-03 17:36:19 -04:00
Ben Marsh
60fb2115fb Horde: Upgrade all NuGet packages to latest.
#preflight 630cf402e1124837752f0cb3

[CL 21682720 by Ben Marsh in ue5-main branch]
2022-08-29 13:34:15 -04:00
Joakim Lindqvist
6c0afc1fcb CbPackage - Fixed up some warnings in the C# CbPackage code, reducing access scope on things that should be private
Also fixed up inconsistent whitespace.

#jira UE-158872
#preflight https://horde.devtools.epicgames.com/job/62c80bc6f671e8d2fac950f7

[CL 21004958 by Joakim Lindqvist in ue5-main branch]
2022-07-08 07:04:41 -04:00
Joakim Lindqvist
0e6faae889 Fixed failing CbPackage test, Assert.ThrowsException does not support async lambda.
#preflight none

[CL 20964595 by Joakim Lindqvist in ue5-main branch]
2022-07-06 06:46:36 -04:00
Joakim Lindqvist
c8798de32a C# implementation of CompactBinaryPackage (cbpkg)
#rb carl.bystrom
#preflight none

[CL 20964277 by Joakim Lindqvist in ue5-main branch]
2022-07-06 06:02:07 -04:00
Ben Marsh
cbd0f5ea19 Add a common interface for reading/writing to memory (IMemoryReader/IMemoryWriter), which is implemented by the legacy MemoryReader/MemoryWriter classes as well as the newer ByteArrayBuilder.
Also moves VarInt into EpicGames.Core.
#preflight 62bb5e3efd06251187efd3d7

[CL 20863839 by Ben Marsh in ue5-main branch]
2022-06-28 16:14:51 -04:00
Ben Marsh
27ff743762 Fix xmldoc warnings in EpicGames.Serialization.
#preflight none

[CL 20777344 by Ben Marsh in ue5-main branch]
2022-06-22 13:31:00 -04:00
Ben Marsh
a11561ae5f Support for serializing signed and unsigned VarInt types from C#.
#preflight 62b1f6898e03312ad86e0757

[CL 20760159 by Ben Marsh in ue5-main branch]
2022-06-21 13:00:33 -04:00
Ben Marsh
b8e2cda212 EpicGames.Serialization: Add tests for deserializing dictionaries into read-only properties.
#preflight none

[CL 20252945 by Ben Marsh in ue5-main branch]
2022-05-17 18:40:04 -04:00
Ben Marsh
12a0d5010f EpicGames.Serialization: Support deserializing into getter-only collection properties.
#preflight none

[CL 20252879 by Ben Marsh in ue5-main branch]
2022-05-17 18:36:34 -04:00
Ben Marsh
b50740d5c1 Horde: Compact binary serialization improvements.
- Fix serialization of lists, directories and arrays that are set to null.
- Throw an exception when serializing a type that does not have any explicit compact binary field attributes. This is usually an error, caused by serializing a framework type with no matching converter, but can also occur when serializing an empty base class instance. To handle these situations, the class can be marked with [CbObject] to explicitly opt-in to being valid for serialization.

#fyi Joe.Kirchoff
#preflight none

[CL 19526671 by Ben Marsh in ue5-main branch]
2022-03-28 10:11:10 -04:00
Ben Marsh
7a0ca03010 Fix test failure.
#preflight none

[CL 19511958 by Ben Marsh in ue5-main branch]
2022-03-25 10:01:43 -04:00
Ben Marsh
6b226011d7 Change EpicGames.Serialization library to match standard coding style.
#preflight none

[CL 19501703 by Ben Marsh in ue5-main branch]
2022-03-24 15:56:16 -04:00
Ben Marsh
17ddfdfdfc Horde: More improvements to Bundles.
- Now does all string manipulations in UTF8 rather than converting to and fro with data received from Perforce
- Added support for reading a stream out of a CbWriter object. This allows pushing data directly to Horde Storage from the piecemeal 1kb buffers it allocates without having to concatenate everything into a contiguous array first, removing some big allocations and data copying on the common path for serializing objects into Horde Storage.
- Refactored the way that BundleNodeRef objects work so they don't need to track the Bundle that owns them, so we can add some serialization/deserialization tests without having to set up as much framework code.

#preflight none

[CL 19345769 by Ben Marsh in ue5-main branch]
2022-03-10 19:56:01 -05:00
Ben Marsh
1b3110c5ec Horde: Refactored system for creating bundles of tree objects.
- Tree can now be modified without having to have entire working set in memory.
- Multiple nodes can be compressed/decompressed together, and an optional IMemoryCache allows caching decompressed blocks.
- Added support for specifying custom compact-binary serializers on individual properties.
- Added test suite to test bundling functionality.
- Fixed issue where VarInts of negative values would not serialize correctly.
#preflight 621952f68849a7424fa36567

[CL 19158249 by Ben Marsh in ue5-main branch]
2022-02-25 17:11:58 -05:00
Joakim Lindqvist
28a6cd7b1b Missing file from change 19111703 (more tests for EpicGames.Serialization)
#preflight none

[CL 19111816 by Joakim Lindqvist in ue5-main branch]
2022-02-24 06:01:24 -05:00
Joakim Lindqvist
b37024fe9b C# Compact Binary Serialization - Added more tests from Horde Storage (Jupiter Tests) and fixed issues exposed by them.
#preflight none

[CL 19111703 by Joakim Lindqvist in ue5-main branch]
2022-02-24 05:44:12 -05:00
Ben Marsh
9e6e68ba17 CS: Add overloads for commonly serialized compact binary types.
#preflight 61e4a67d7b0f77175a5d6621

[CL 18630220 by Ben Marsh in ue5-main branch]
2022-01-16 18:26:30 -05:00
Ben Marsh
e0f2ac5e4c Target NET 6 for the EpicGames.Serialization.Tests library, so we can run it from the Docker image.
[CL 18272361 by Ben Marsh in ue5-main branch]
2021-11-23 13:01:18 -05:00