Skip to content

Commit

Permalink
release 1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jagt committed May 1, 2024
1 parent f2bbdc4 commit 4ecfa10
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ FDcResult HandlerTransientTextDeserialize(FDcDeserializeContext& Ctx)
{
using namespace DcSerDeCommon;

FText Text;
FTextAccess& TextAccess = (FTextAccess&)Text;

#if UE_VERSION_OLDER_THAN(5, 4, 0)
void* ObjectPtr;
void* SharedRefPtr;
uint32 Flags;
Expand All @@ -157,9 +161,6 @@ FDcResult HandlerTransientTextDeserialize(FDcDeserializeContext& Ctx)
DC_TRY(Ctx.Reader->ReadUInt32(&Flags));
DC_TRY(Ctx.Reader->ReadArrayEnd());

FText Text;
FTextAccess& TextAccess = (FTextAccess&)Text;

#if ENGINE_MAJOR_VERSION == 5
{
using RefControllerType = SharedPointerInternals::TReferenceControllerBase<ESPMode::ThreadSafe>;
Expand All @@ -184,6 +185,24 @@ FDcResult HandlerTransientTextDeserialize(FDcDeserializeContext& Ctx)
}
#endif

#else
void* ObjectPtr;
uint32 Flags;

DC_TRY(Ctx.Reader->ReadArrayRoot());
DC_TRY(DcMsgPackHandlersDetails::ReadPointerRaw(Ctx.Reader, ObjectPtr));
DC_TRY(Ctx.Reader->ReadUInt32(&Flags));
DC_TRY(Ctx.Reader->ReadArrayEnd());

{
using RefCountPtr = TRefCountPtr<ITextData>;
RefCountPtr TextPtr((ITextData*)ObjectPtr, true);

TextAccess.TextData = MoveTemp(TextPtr);
}
#endif // !UE_VERSION_OLDER_THAN(5, 4, 0)


TextAccess.Flags = Flags;
DC_TRY(Ctx.Writer->WriteText(Text));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,16 @@ FDcResult HandlerTransientTextSerialize(FDcSerializeContext& Ctx)
DC_TRY(Ctx.Reader->ReadText(&Value));
FTextAccess& ValueAccess = (FTextAccess&)(Value);

FSharedRefAccess& SharedRefAccess = (FSharedRefAccess&)ValueAccess.TextData;
DC_TRY(Ctx.Writer->WriteArrayRoot());

#if UE_VERSION_OLDER_THAN(5, 4, 0)
FSharedRefAccess& SharedRefAccess = (FSharedRefAccess&)ValueAccess.TextData;
DC_TRY(DcMsgPackHandlersDetails::WritePointer(Ctx.Writer, SharedRefAccess.Object));
DC_TRY(DcMsgPackHandlersDetails::WritePointer(Ctx.Writer, SharedRefAccess.SharedReferenceCount));
#else
DC_TRY(DcMsgPackHandlersDetails::WritePointer(Ctx.Writer, ValueAccess.TextData.GetReference()));
#endif // !UE_VERSION_OLDER_THAN(5, 4, 0)

DC_TRY(Ctx.Writer->WriteUInt32(ValueAccess.Flags));
DC_TRY(Ctx.Writer->WriteArrayEnd());

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma once

#define DATA_CONFIG_CORE_VERSION "1.6.0"
#define DATA_CONFIG_CORE_VERSION_NUMBER 10600
#define DATA_CONFIG_CORE_VERSION "1.6.1"
#define DATA_CONFIG_CORE_VERSION_NUMBER 10601
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

#include "CoreMinimal.h"

#if !UE_VERSION_OLDER_THAN(5, 4, 0)
#include "Internationalization/ITextData.h"
#endif // !UE_VERSION_OLDER_THAN(5, 4, 0)

namespace DcSerDeCommon
{
Expand Down Expand Up @@ -37,7 +40,11 @@ struct FMulticastScriptDelegateAccess : public FMulticastScriptDelegate

struct FTextAccess
{
#if UE_VERSION_OLDER_THAN(5, 4, 0)
TSharedRef<ITextData, ESPMode::ThreadSafe> TextData;
#else
TRefCountPtr<ITextData> TextData;
#endif // !UE_VERSION_OLDER_THAN(5, 4, 0)
uint32 Flags;

};
Expand Down
1 change: 1 addition & 0 deletions Misc/Docs/Source/Advanced/UEUpgrades.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ DataConfig is committed to support multiple UE versions with no deprecations and
- New property `Optional` and `VValue` are added. We fully support `Optional` starting by adding `EDcDataEntry::OptionalRoot/OptionalEnd` and then evantually it works with all DataConfig APIs including JSON/MsgPack serialization and property builder.
- `FObjectPtrProperty/FClassPtrProperty` are deprecated. It's introduced in 5.0 now removed and alias to `FObjectProperty/FClassProperty` respectively.
- Defaults to MSVC `\W4` flag now which checks for unreachable code. It reports confusing locations and you can set `bUseUnity = false` in your `*.Build.cs` module rules to locate whereabout.
- `FText` internal pointer changed from `TSharedRef` to `TRefCountPtr`.

# UE5.3

Expand Down
6 changes: 5 additions & 1 deletion Misc/Docs/Source/Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## 1.6.1 - 2024-4-28

- Fix compilation for UE 5.4.

## 1.6.0 - 2024-3-31

- **BREAKING** Removed `PredicateIsUStruct`. Use struct handlers instead.
Expand Down Expand Up @@ -29,7 +33,7 @@ All notable changes to this project will be documented in this file.
- UE 5.4 support.
- See [UE version upgrade 5.4](Advanced/UEUpgrades.md#ue54)
- **NEW** Optional support.
- See [Optional](Extra/Optional.md)
- See [Optional](Advanced/Optional.md)

## 1.4.3 - 2023-8-27

Expand Down
4 changes: 2 additions & 2 deletions Misc/Docs/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ RepoRoot = "https://github.com/slowburn-dev/DataConfig/tree/release/"

# renamed fields
[output.html.redirect]
"/Formats/PipeProperty.html" = "/Formats/Property.html"
"/Extra/Optional.html" = "/Advanced/Optional.html"
"/Formats/PipeProperty.html" = "./Formats/Property.html"
"/Extra/Optional.html" = "../Advanced/Optional.html"

0 comments on commit 4ecfa10

Please sign in to comment.