Skip to content

Commit 4ecfa10

Browse files
committed
release 1.6.1
1 parent f2bbdc4 commit 4ecfa10

7 files changed

Lines changed: 46 additions & 9 deletions

File tree

DataConfig/Source/DataConfigCore/Private/DataConfig/Deserialize/Handlers/MsgPack/DcMsgPackTransientDeserializers.cpp

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ FDcResult HandlerTransientTextDeserialize(FDcDeserializeContext& Ctx)
147147
{
148148
using namespace DcSerDeCommon;
149149

150+
FText Text;
151+
FTextAccess& TextAccess = (FTextAccess&)Text;
152+
153+
#if UE_VERSION_OLDER_THAN(5, 4, 0)
150154
void* ObjectPtr;
151155
void* SharedRefPtr;
152156
uint32 Flags;
@@ -157,9 +161,6 @@ FDcResult HandlerTransientTextDeserialize(FDcDeserializeContext& Ctx)
157161
DC_TRY(Ctx.Reader->ReadUInt32(&Flags));
158162
DC_TRY(Ctx.Reader->ReadArrayEnd());
159163

160-
FText Text;
161-
FTextAccess& TextAccess = (FTextAccess&)Text;
162-
163164
#if ENGINE_MAJOR_VERSION == 5
164165
{
165166
using RefControllerType = SharedPointerInternals::TReferenceControllerBase<ESPMode::ThreadSafe>;
@@ -184,6 +185,24 @@ FDcResult HandlerTransientTextDeserialize(FDcDeserializeContext& Ctx)
184185
}
185186
#endif
186187

188+
#else
189+
void* ObjectPtr;
190+
uint32 Flags;
191+
192+
DC_TRY(Ctx.Reader->ReadArrayRoot());
193+
DC_TRY(DcMsgPackHandlersDetails::ReadPointerRaw(Ctx.Reader, ObjectPtr));
194+
DC_TRY(Ctx.Reader->ReadUInt32(&Flags));
195+
DC_TRY(Ctx.Reader->ReadArrayEnd());
196+
197+
{
198+
using RefCountPtr = TRefCountPtr<ITextData>;
199+
RefCountPtr TextPtr((ITextData*)ObjectPtr, true);
200+
201+
TextAccess.TextData = MoveTemp(TextPtr);
202+
}
203+
#endif // !UE_VERSION_OLDER_THAN(5, 4, 0)
204+
205+
187206
TextAccess.Flags = Flags;
188207
DC_TRY(Ctx.Writer->WriteText(Text));
189208

DataConfig/Source/DataConfigCore/Private/DataConfig/Serialize/Handlers/MsgPack/DcMsgPackTransientSerializers.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,16 @@ FDcResult HandlerTransientTextSerialize(FDcSerializeContext& Ctx)
8484
DC_TRY(Ctx.Reader->ReadText(&Value));
8585
FTextAccess& ValueAccess = (FTextAccess&)(Value);
8686

87-
FSharedRefAccess& SharedRefAccess = (FSharedRefAccess&)ValueAccess.TextData;
8887
DC_TRY(Ctx.Writer->WriteArrayRoot());
88+
89+
#if UE_VERSION_OLDER_THAN(5, 4, 0)
90+
FSharedRefAccess& SharedRefAccess = (FSharedRefAccess&)ValueAccess.TextData;
8991
DC_TRY(DcMsgPackHandlersDetails::WritePointer(Ctx.Writer, SharedRefAccess.Object));
9092
DC_TRY(DcMsgPackHandlersDetails::WritePointer(Ctx.Writer, SharedRefAccess.SharedReferenceCount));
93+
#else
94+
DC_TRY(DcMsgPackHandlersDetails::WritePointer(Ctx.Writer, ValueAccess.TextData.GetReference()));
95+
#endif // !UE_VERSION_OLDER_THAN(5, 4, 0)
96+
9197
DC_TRY(Ctx.Writer->WriteUInt32(ValueAccess.Flags));
9298
DC_TRY(Ctx.Writer->WriteArrayEnd());
9399

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#pragma once
22

3-
#define DATA_CONFIG_CORE_VERSION "1.6.0"
4-
#define DATA_CONFIG_CORE_VERSION_NUMBER 10600
3+
#define DATA_CONFIG_CORE_VERSION "1.6.1"
4+
#define DATA_CONFIG_CORE_VERSION_NUMBER 10601

DataConfig/Source/DataConfigCore/Public/DataConfig/SerDe/DcSerDeCommon.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
#include "CoreMinimal.h"
44

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

69
namespace DcSerDeCommon
710
{
@@ -37,7 +40,11 @@ struct FMulticastScriptDelegateAccess : public FMulticastScriptDelegate
3740

3841
struct FTextAccess
3942
{
43+
#if UE_VERSION_OLDER_THAN(5, 4, 0)
4044
TSharedRef<ITextData, ESPMode::ThreadSafe> TextData;
45+
#else
46+
TRefCountPtr<ITextData> TextData;
47+
#endif // !UE_VERSION_OLDER_THAN(5, 4, 0)
4148
uint32 Flags;
4249

4350
};

Misc/Docs/Source/Advanced/UEUpgrades.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ DataConfig is committed to support multiple UE versions with no deprecations and
66
- 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.
77
- `FObjectPtrProperty/FClassPtrProperty` are deprecated. It's introduced in 5.0 now removed and alias to `FObjectProperty/FClassProperty` respectively.
88
- 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.
9+
- `FText` internal pointer changed from `TSharedRef` to `TRefCountPtr`.
910

1011
# UE5.3
1112

Misc/Docs/Source/Changes.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

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

5+
## 1.6.1 - 2024-4-28
6+
7+
- Fix compilation for UE 5.4.
8+
59
## 1.6.0 - 2024-3-31
610

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

3438
## 1.4.3 - 2023-8-27
3539

Misc/Docs/book.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ RepoRoot = "https://github.com/slowburn-dev/DataConfig/tree/release/"
2121

2222
# renamed fields
2323
[output.html.redirect]
24-
"/Formats/PipeProperty.html" = "/Formats/Property.html"
25-
"/Extra/Optional.html" = "/Advanced/Optional.html"
24+
"/Formats/PipeProperty.html" = "./Formats/Property.html"
25+
"/Extra/Optional.html" = "../Advanced/Optional.html"

0 commit comments

Comments
 (0)