Skip to content

Commit 8fc8cd0

Browse files
Merge remote-tracking branch 'origin/master' into Test/verifyUniqueSessionIdsOnLogins
2 parents d7ae33d + ae74a27 commit 8fc8cd0

86 files changed

Lines changed: 5478 additions & 982 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vsconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": "1.0",
3+
"components": [
4+
"Microsoft.Net.Component.4.6.2.TargetingPack",
5+
"Microsoft.VisualStudio.Component.VC.14.38.17.8.x86.x64",
6+
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
7+
"Microsoft.VisualStudio.Component.Windows10SDK.22621",
8+
"Microsoft.VisualStudio.Workload.CoreEditor",
9+
"Microsoft.VisualStudio.Workload.ManagedDesktop",
10+
"Microsoft.VisualStudio.Workload.NativeDesktop",
11+
"Microsoft.VisualStudio.Workload.NativeGame"
12+
]
13+
}

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @0xsequence/zemind-unreal @0xsequence/web3-unity-unreal-sdks
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:bc35eb2d43a47427d30aba0196f9eac90d089dd3abca319528c5d25c83510d0d
3-
size 72364642
2+
oid sha256:aa8c65256ddbe91768b2d942e120a636fe6a977c626c4cf866c433a7eef91444
3+
size 66789159
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:df84c8090be9a0e591b10ad34ade1af509ca39a6e09bb12ca7e913730cb1c835
3-
size 1841639
2+
oid sha256:10573b8cbd7d0227e1b076717a6f3ad32df4d95bb13ba798d3d581713ed13b23
3+
size 1779559
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:7ca972fc545d28337cdb028f2bfcabdaaf309742ab5c5d1aeb11af3134e70226
3+
size 335108
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:a55e16e1a8aca26fae9843f17bfbdf78a34eb08b9a99e5f89ebe2a24bae4e1d2
3+
size 227900
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:edc7507a65612445785d53030ca44fd20c1e9f5d3868ca418073486c49bb9d1e
3-
size 2360991
2+
oid sha256:8b791c47c7cc0be72b4be832085448682755097fd1e8733b5cc0f42882fe84ff
3+
size 2377660

Plugins/SequencePlugin/SequencePlugin.uplugin

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"EngineVersion":"5.4",
2+
"EngineVersion": "5.4",
33
"FileVersion": 3,
44
"Version": 3,
5-
"VersionName": "1.3",
5+
"VersionName": "1.4.1",
66
"FriendlyName": "SequencePlugin",
77
"Description": "",
88
"Category": "Sequence",
@@ -26,7 +26,7 @@
2626
"Name": "SequencePlugin",
2727
"Type": "Runtime",
2828
"LoadingPhase": "Default",
29-
"WhitelistPlatforms": [
29+
"PlatformAllowList": [
3030
"Mac",
3131
"Win64",
3232
"Android",

Plugins/SequencePlugin/Source/SequencePlugin/Private/ABI/ABI.cpp

Lines changed: 61 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
11
// Copyright 2024 Horizon Blockchain Games Inc. All rights reserved.
22

33
#include "ABI/ABI.h"
4-
#include "ABI/ABIEncodeable.h"
4+
#include "ABI/ABIElement.h"
55
#include "Eth/Crypto.h"
6+
#include "Internationalization/Regex.h"
67
#include "Types/BinaryData.h"
78

89
TFixedABIData ABI::UInt32(uint32 Input)
910
{
1011
TArray<uint8> Arr;
11-
ABIEncodeable::PushEmptyBlock(Arr);
12-
ABIEncodeable::CopyInUInt32(Arr, Input, 0);
12+
ABIElement::PushEmptyBlock(Arr);
13+
ABIElement::CopyInUInt32(Arr, Input, 0);
1314
return TFixedABIData(Arr);
1415
}
1516

1617
TFixedABIData ABI::Int32(int32 Input)
1718
{
1819
TArray<uint8> Arr;
19-
ABIEncodeable::PushEmptyBlock(Arr);
20-
ABIEncodeable::CopyInInt32(Arr, Input, 0);
20+
ABIElement::PushEmptyBlock(Arr);
21+
ABIElement::CopyInInt32(Arr, Input, 0);
2122
return TFixedABIData(Arr);
2223
}
2324

2425
TFixedABIData ABI::Bool(bool Input)
2526
{
2627
TArray<uint8> Arr;
27-
ABIEncodeable::PushEmptyBlock(Arr);
28-
if(Input)
29-
{
30-
Arr[GBlockByteLength - 1] = 0x00;
31-
}
28+
ABIElement::PushEmptyBlock(Arr);
29+
Arr[GBlockByteLength - 1] = Input ? 0x01 : 0x00;
3230
return TFixedABIData(Arr);
3331
}
3432

@@ -51,22 +49,70 @@ TDynamicABIData ABI::String(FString Input)
5149
return TDynamicABIData(Arr);
5250
}
5351

54-
FUnsizedData ABI::Encode(FString Signature, TArray<ABIEncodeable*> Arr)
52+
53+
// DEPRECATED
54+
FUnsizedData ABI::Encode(FString Signature, TArray<ABIElement*> Args)
55+
{
56+
TArray<TSharedPtr<ABIElement>> NewArgs;
57+
for(auto i = 0; i < Args.Num(); i++)
58+
{
59+
NewArgs.Push(Args[i]->Clone());
60+
}
61+
62+
TOptional<FUnsizedData> Encoded = Encode(Signature, NewArgs);
63+
64+
if(Encoded.IsSet())
65+
{
66+
return Encoded.GetValue();
67+
}
68+
else
69+
{
70+
return FUnsizedData { TArray<uint8>() };
71+
}
72+
}
73+
74+
TOptional<FUnsizedData> ABI::Encode(FString Signature, TArray<TSharedPtr<ABIElement>> Args)
5575
{
56-
TFixedABIArray FixedArr(Arr);
76+
if(!IsValidSignature(Signature))
77+
{
78+
UE_LOG(LogTemp, Display, TEXT("Invalid signature! Remember that ABI signatures should only contain argument types without spaces and NOT names."));
79+
return TOptional<FUnsizedData>();
80+
}
81+
82+
TFixedABIArray FixedArr(Args);
5783
FUnsizedData Data {
5884
FixedArr.Encode()
5985
};
6086
FUnsizedData SignatureData = StringToUTF8(Signature);
6187
FHash256 Hash = GetKeccakHash(SignatureData);
62-
Data.Arr->Insert(Hash.Ptr(), 4, 0);
88+
Data.Arr->Insert(Hash.Ptr(), GSignatureLength, 0);
6389
return Data;
6490
}
6591

66-
FString ABI::Display(FString Signature, TArray<ABIEncodeable*> Arr)
92+
void ABI::Decode(TArray<uint8> Data, TArray<TSharedPtr<ABIElement>> Args)
93+
{
94+
TFixedABIArray FixedArr(Args);
95+
FixedArr.Decode(Data, GSignatureLength, GSignatureLength);
96+
}
97+
98+
bool ABI::IsValidSignature(FString Signature)
99+
{
100+
const FRegexPattern FunctionABIRegex(TEXT("^[A-Z|a-z|,-|0-9]+(([A-Z|a-z|0-9]+(, [A-Z|a-z|0-9]+))?)$"));
101+
FRegexMatcher MyMatcher(FunctionABIRegex, Signature);
102+
return MyMatcher.FindNext();
103+
}
104+
105+
FString ABI::Display(FString Signature, TArray<TSharedPtr<ABIElement>> Args)
67106
{
68107
FString Str = "";
69-
FString Reference = Encode(Signature, Arr).ToHex();
108+
TOptional<FUnsizedData> Encoded = Encode(Signature, Args);
109+
110+
if(!Encoded.IsSet())
111+
{
112+
return "Signature not valid!";
113+
}
114+
115+
FString Reference = Encoded.GetValue().ToHex();
70116

71117
for(int i = 0; i < Reference.Len(); i++)
72118
{

0 commit comments

Comments
 (0)