diff --git a/Scripts/BuildPlugin.ps1 b/Scripts/BuildPlugin.ps1 deleted file mode 100644 index 0e61d2c..0000000 --- a/Scripts/BuildPlugin.ps1 +++ /dev/null @@ -1,222 +0,0 @@ -# Powershell script - -param ( - [string]$Mode = 'build', - [string[]]$EngineVersion = 'All', - [string[]]$Platforms = @('Win64', 'Android', 'Linux', 'LinuxArm64'), - [string]$Destination = "$env:UserProfile\Downloads", - [string]$EnginePath, - [switch]$IncludeHost = $false, - [switch]$Reverse = $false -) - -class EngineInstall -{ - [string] $Version - [string] $Path - - EngineInstall([string]$Version, [string]$Path) - { - $this.Version = $Version - $this.Path = $Path - } -} - -class Config -{ - [EngineInstall[]] $EngineInstalls - - Config() - { - $this.EngineInstalls = @() - } - - [void] - AddEngineInstall([EngineInstall]$install) - { - $this.EngineInstalls += $install - } - - [bool] - HasVersion([string]$Version) - { - ForEach ($EngineInstall in $this.EngineInstalls) - { - if ( $EngineInstall.Version.StartsWith($Version)) - { - return $true - } - } - return $false - } - - [string] - GetVersionPath([string]$Version) - { - ForEach ($EngineInstall in $this.EngineInstalls) - { - if ( $EngineInstall.Version.StartsWith($Version)) - { - return $EngineInstall.Path - } - } - return "" - } - - [void] - AddVersion([string]$Version, [string]$Path) - { - if ( $this.hasVersion($Version)) - { - Write-Host $Version already saved for $Path - exit - } - $newEngineInstall = [EngineInstall]::new($Version, $Path) - $this.AddEngineInstall($newEngineInstall) - } - - [string[]] - GetAllVersions([bool]$Reverse) - { - $Installs = $this.EngineInstalls; - if ($Reverse) - { - [array]::Reverse($Installs) - } - $Result = @() - foreach ($Install in $Installs) - { - $Result.Add($Install.Version) - } - return $Result - } - [string[]] - GetAllVersions() - { - return $this.GetAllVersions($false) - } -} - -$ConfigFile = Join-Path -Path "$env:USERPROFILE" -ChildPath ".build-plugin.json" -$PluginDir = Split-Path -Path $PSScriptRoot -Parent -$UPlugin = Get-Content -Path (Join-Path -Path $PluginDir -ChildPath "Thirdweb.uplugin") | ConvertFrom-Json - -if (!(Test-Path -Path $ConfigFile)) -{ - Write-Host "Creating config file..." - $DefaultConfig = [Config]::new() - $DefaultData = $DefaultConfig | ConvertTo-Json - New-Item -Path $ConfigFile -ItemType "File" -Value $DefaultData -} - -# Deserialize the Config from JSON -$jsonContent = Get-Content -Path $ConfigFile | ConvertFrom-Json -$Config = [Config]::new() -$jsonContent.EngineInstalls | ForEach-Object { - $Config.AddEngineInstall([EngineInstall]::new($_.Version, $_.Path)) -} - -function SetUERoot -{ - param ([string]$NewRoot) - if (!($NewRoot)) - { - Write-Host "SetUERoot: Error: No path set" - exit - } - $CurrentRoot = ue4 root 2> $null - if ($NewRoot -ne $CurrentRoot) - { - ue4 setroot $NewRoot 2> $null - return - } - # Verbose - # Write-Host "UE Root already set. Skipping..." -} - -$ClangFolders = @{ - "5.5" = "v23_clang-18.1.0-rockylinux8" - "5.4" = "v22_clang-16.0.6-centos7" - "5.3" = "v22_clang-16.0.6-centos7" - "5.2" = "v21_clang-15.0.1-centos7" - "5.1" = "v20_clang-13.0.1-centos7" - "5.0" = "v19_clang-11.0.1-centos7" -} - -function SetClang -{ - param ([string]$Version) - - if ( $Platforms.Contains("Linux")) - { - $env:LINUX_MULTIARCH_ROOT = "C:\UnrealToolchains\" + $ClangFolders[$Version] + "\" - # Verbose - # Write-Host "LINUX_MULTIARCH_ROOT set to" $env:LINUX_MULTIARCH_ROOT - } -} - -switch ($Mode) -{ - 'build' { - $Versions = $EngineVersion - if ($EngineVersion -eq "All") - { - $Versions = $Config.GetAllVersions($Reverse) - } - foreach ($Version in $Versions) - { - Write-Host Building Plugin for UE_$Version - if (!($Config.hasVersion($Version))) - { - Write-Host "Error: No engine path saved for $Version" - continue - - } - SetUERoot($Config.getVersionPath($Version)) - SetClang($Version) - $FolderNameParts = @("ThirdwebSDK", $UPlugin.VersionName) - if ($IncludeHost) { - $FolderNameParts += "WithHost" - } - $FolderNameParts += $Version - $FullDestination = Join-Path -Path $Destination -ChildPath ($FolderNameParts -join "-") - $TargetPlatforms = $Platforms -join "+" - $Args = @( - "package", - "-TargetPlatforms=`"$TargetPlatforms`"", - "-Package=`"$FullDestination`"" - ) - if (!($IncludeHost)) { - $Args += "-NoHostPlatform" - } - Start-Process ue4 ` - -Wait ` - -NoNewWindow ` - -WorkingDirectory $PluginDir ` - -ArgumentList $Args - Compress-Archive -Path ($FullDestination + "\*") -DestinationPath ($FullDestination + ".zip") -Force - } - } - 'save' { - if ($EngineVersion[0] == "All") - { - Write-Host "Error: No engine version specified" - exit - } - $Config.AddVersion($EngineVersion, $EnginePath) - Write-Host "Saving $EngineVersion as $EnginePath" - $Config | ConvertTo-Json | Set-Content -Path $ConfigFile - } - 'list' { - Write-Host "Engine Versions:" - foreach ($Install in $Config.EngineInstalls) - { - Write-Host $Install.Version - $Install.Path - } - exit - } - default { - Write-Host "Invalid mode selected. Please choose either 'build' or 'save'." - exit - } -} diff --git a/Scripts/build-plugin.sh b/Scripts/build-plugin.sh deleted file mode 100755 index efaca4c..0000000 --- a/Scripts/build-plugin.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -ue4 package -NoHostPlatform -TargetPlatforms=IOS+Mac+TVOS+VisionOS \ No newline at end of file diff --git a/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebGetLinkedAccounts.cpp b/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebGetLinkedAccounts.cpp index 586ddcc..a142a72 100644 --- a/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebGetLinkedAccounts.cpp +++ b/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebGetLinkedAccounts.cpp @@ -3,7 +3,6 @@ #include "AsyncTasks/Wallets/InApp/AsyncTaskThirdwebGetLinkedAccounts.h" #include "Async/TaskGraphInterfaces.h" - #include "Components/SlateWrapperTypes.h" void UAsyncTaskThirdwebGetLinkedAccounts::Activate() diff --git a/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebInAppSignMessage.cpp b/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebInAppSignMessage.cpp index 3f1e517..871eccc 100644 --- a/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebInAppSignMessage.cpp +++ b/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebInAppSignMessage.cpp @@ -2,6 +2,7 @@ #include "AsyncTasks/Wallets/InApp/AsyncTaskThirdwebInAppSignMessage.h" +#include "Async/TaskGraphInterfaces.h" #include "Components/SlateWrapperTypes.h" void UAsyncTaskThirdwebInAppSignMessage::Activate() diff --git a/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebLink.cpp b/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebLink.cpp index 028d157..7b020bc 100644 --- a/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebLink.cpp +++ b/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebLink.cpp @@ -2,6 +2,7 @@ #include "AsyncTasks/Wallets/InApp/AsyncTaskThirdwebLink.h" +#include "Async/TaskGraphInterfaces.h" #include "Components/SlateWrapperTypes.h" UAsyncTaskThirdwebLink* UAsyncTaskThirdwebLink::Link(UObject* WorldContextObject, const FInAppWalletHandle& Wallet, const FInAppWalletHandle& NewWallet, const FString& Input, const FString& Signature) diff --git a/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebLoginWithOAuth.cpp b/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebLoginWithOAuth.cpp index ce2da6b..7dcafbc 100644 --- a/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebLoginWithOAuth.cpp +++ b/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebLoginWithOAuth.cpp @@ -4,15 +4,11 @@ #include "ThirdwebLog.h" #include "TimerManager.h" - +#include "Async/TaskGraphInterfaces.h" #include "Blueprint/UserWidget.h" - #include "Browser/ThirdwebOAuthBrowserUserWidget.h" - #include "Engine/World.h" - #include "Kismet/GameplayStatics.h" - #include "Misc/DateTime.h" void UAsyncTaskThirdwebLoginWithOAuth::Activate() diff --git a/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebSendOTP.cpp b/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebSendOTP.cpp index a9d5d35..df21f27 100644 --- a/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebSendOTP.cpp +++ b/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebSendOTP.cpp @@ -2,6 +2,7 @@ #include "AsyncTasks/Wallets/InApp/AsyncTaskThirdwebSendOTP.h" +#include "Async/TaskGraphInterfaces.h" #include "Components/SlateWrapperTypes.h" void UAsyncTaskThirdwebSendOTP::Activate() diff --git a/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebSignIn.cpp b/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebSignIn.cpp index 8b00fb6..aed1c98 100644 --- a/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebSignIn.cpp +++ b/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/AsyncTaskThirdwebSignIn.cpp @@ -2,6 +2,7 @@ #include "AsyncTasks/Wallets/InApp/AsyncTaskThirdwebSignIn.h" +#include "Async/TaskGraphInterfaces.h" #include "Components/SlateWrapperTypes.h" UAsyncTaskThirdwebSignIn* UAsyncTaskThirdwebSignIn::SignIn(UObject* WorldContextObject, const FInAppWalletHandle& Wallet, const FString& Input, const FString& Signature) diff --git a/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/Create/AsyncTaskThirdwebCreateSmartWallet.cpp b/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/Create/AsyncTaskThirdwebCreateSmartWallet.cpp index a472ff6..23d7558 100644 --- a/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/Create/AsyncTaskThirdwebCreateSmartWallet.cpp +++ b/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/Create/AsyncTaskThirdwebCreateSmartWallet.cpp @@ -2,6 +2,7 @@ #include "AsyncTasks/Wallets/InApp/Create/AsyncTaskThirdwebCreateSmartWallet.h" +#include "Async/TaskGraphInterfaces.h" #include "Components/SlateWrapperTypes.h" #include "Wallets/ThirdwebSmartWalletHandle.h" diff --git a/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/Create/AsyncTaskThirdwebInAppCreateWalletBase.cpp b/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/Create/AsyncTaskThirdwebInAppCreateWalletBase.cpp index fc5efb3..c7f17a8 100644 --- a/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/Create/AsyncTaskThirdwebInAppCreateWalletBase.cpp +++ b/Source/Thirdweb/Private/AsyncTasks/Wallets/InApp/Create/AsyncTaskThirdwebInAppCreateWalletBase.cpp @@ -2,6 +2,7 @@ #include "AsyncTasks/Wallets/InApp/Create/AsyncTaskThirdwebInAppCreateWalletBase.h" +#include "Async/TaskGraphInterfaces.h" #include "Wallets/ThirdwebInAppWalletHandle.h" void UAsyncTaskThirdwebInAppCreateWalletBase::HandleResponse(const FInAppWalletHandle& Wallet) diff --git a/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebAddAdmin.cpp b/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebAddAdmin.cpp index ecaa82b..95d3f67 100644 --- a/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebAddAdmin.cpp +++ b/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebAddAdmin.cpp @@ -2,6 +2,7 @@ #include "AsyncTasks/Wallets/Smart/AsyncTaskThirdwebAddAdmin.h" +#include "Async/TaskGraphInterfaces.h" #include "Components/SlateWrapperTypes.h" void UAsyncTaskThirdwebAddAdmin::Activate() diff --git a/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebGetActiveSigners.cpp b/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebGetActiveSigners.cpp index 9a9d474..9854858 100644 --- a/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebGetActiveSigners.cpp +++ b/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebGetActiveSigners.cpp @@ -2,6 +2,7 @@ #include "AsyncTasks/Wallets/Smart/AsyncTaskThirdwebGetActiveSigners.h" +#include "Async/TaskGraphInterfaces.h" #include "Components/SlateWrapperTypes.h" #include "Containers/ThirdwebSigner.h" diff --git a/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebGetAdmins.cpp b/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebGetAdmins.cpp index b58f559..79d72c4 100644 --- a/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebGetAdmins.cpp +++ b/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebGetAdmins.cpp @@ -2,6 +2,7 @@ #include "AsyncTasks/Wallets/Smart/AsyncTaskThirdwebGetAdmins.h" +#include "Async/TaskGraphInterfaces.h" #include "Components/SlateWrapperTypes.h" void UAsyncTaskThirdwebGetAdmins::Activate() diff --git a/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebIsActiveSigner.cpp b/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebIsActiveSigner.cpp index a51772e..50bd70b 100644 --- a/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebIsActiveSigner.cpp +++ b/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebIsActiveSigner.cpp @@ -2,9 +2,9 @@ #include "AsyncTasks/Wallets/Smart/AsyncTaskThirdwebIsActiveSigner.h" -#include "Containers/ThirdwebSigner.h" - +#include "Async/TaskGraphInterfaces.h" #include "Components/SlateWrapperTypes.h" +#include "Containers/ThirdwebSigner.h" void UAsyncTaskThirdwebIsActiveSigner::Activate() { diff --git a/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebIsDeployed.cpp b/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebIsDeployed.cpp index 531e4db..faa019e 100644 --- a/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebIsDeployed.cpp +++ b/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebIsDeployed.cpp @@ -2,6 +2,7 @@ #include "AsyncTasks/Wallets/Smart/AsyncTaskThirdwebIsDeployed.h" +#include "Async/TaskGraphInterfaces.h" #include "Components/SlateWrapperTypes.h" void UAsyncTaskThirdwebIsDeployed::Activate() diff --git a/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebRevokeSessionKey.cpp b/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebRevokeSessionKey.cpp index 1b9fd65..55b4995 100644 --- a/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebRevokeSessionKey.cpp +++ b/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebRevokeSessionKey.cpp @@ -2,6 +2,7 @@ #include "AsyncTasks/Wallets/Smart/AsyncTaskThirdwebRevokeSessionKey.h" +#include "Async/TaskGraphInterfaces.h" #include "Components/SlateWrapperTypes.h" void UAsyncTaskThirdwebRevokeSessionKey::Activate() diff --git a/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebSmartSignMessage.cpp b/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebSmartSignMessage.cpp index d3d7200..db42640 100644 --- a/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebSmartSignMessage.cpp +++ b/Source/Thirdweb/Private/AsyncTasks/Wallets/Smart/AsyncTaskThirdwebSmartSignMessage.cpp @@ -2,6 +2,7 @@ #include "AsyncTasks/Wallets/Smart/AsyncTaskThirdwebSmartSignMessage.h" +#include "Async/TaskGraphInterfaces.h" #include "Components/SlateWrapperTypes.h" void UAsyncTaskThirdwebSmartSignMessage::Activate() diff --git a/Source/Thirdweb/Private/Browser/ThirdwebOAuthBrowserWidget.cpp b/Source/Thirdweb/Private/Browser/ThirdwebOAuthBrowserWidget.cpp index 483bc1a..2111cc8 100644 --- a/Source/Thirdweb/Private/Browser/ThirdwebOAuthBrowserWidget.cpp +++ b/Source/Thirdweb/Private/Browser/ThirdwebOAuthBrowserWidget.cpp @@ -4,11 +4,9 @@ #include "ThirdwebLog.h" #include "ThirdwebRuntimeSettings.h" - #include "Async/Async.h" - +#include "Async/TaskGraphInterfaces.h" #include "GenericPlatform/GenericPlatformHttp.h" - #include "Widgets/Layout/SBox.h" #include "Widgets/Text/STextBlock.h" #if WITH_CEF diff --git a/Source/Thirdweb/Private/Internal/ThirdwebHeaders.cpp b/Source/Thirdweb/Private/Internal/ThirdwebHeaders.cpp index a4d4629..1ee1b79 100644 --- a/Source/Thirdweb/Private/Internal/ThirdwebHeaders.cpp +++ b/Source/Thirdweb/Private/Internal/ThirdwebHeaders.cpp @@ -16,6 +16,15 @@ void FThirdwebHeaders::Set(const FString& Name, const FString& Value, const bool } } +void FThirdwebHeaders::SetMany(TArray> Pairs) +{ + for (const auto& Pair : Pairs) + { + Set(Pair.Key, Pair.Value); + } +} + + bool FThirdwebHeaders::Remove(const FString& Name) { return Headers.Remove(Name) > 0; diff --git a/Source/Thirdweb/Private/ThirdwebUtils.cpp b/Source/Thirdweb/Private/ThirdwebUtils.cpp index 9b94136..f5d8f30 100644 --- a/Source/Thirdweb/Private/ThirdwebUtils.cpp +++ b/Source/Thirdweb/Private/ThirdwebUtils.cpp @@ -11,6 +11,7 @@ #include "Thirdweb.h" #include "ThirdwebLog.h" #include "ThirdwebRuntimeSettings.h" +#include "Async/TaskGraphInterfaces.h" #include "Containers/ThirdwebIPFSUploadResult.h" #include "Containers/ThirdwebMultipartFormData.h" #include "Dom/JsonObject.h" @@ -21,6 +22,7 @@ #include "Interfaces/IHttpRequest.h" #include "Interfaces/IHttpResponse.h" #include "Interfaces/IPluginManager.h" +#include "Internal/ThirdwebHeaders.h" #include "Kismet/GameplayStatics.h" #include "Kismet/KismetStringLibrary.h" #include "Misc/Base64.h" @@ -419,8 +421,7 @@ namespace ThirdwebUtils { if (!IsInGameThread()) { - // Retry on the GameThread. - const FWalletHandle WalletCopy; + const FWalletHandle WalletCopy = Wallet; FFunctionGraphTask::CreateAndDispatchWhenReady([WalletCopy]() { SendConnectEvent(WalletCopy); @@ -436,13 +437,17 @@ namespace ThirdwebUtils const TSharedRef Request = HttpModule.CreateRequest(); Request->SetVerb("POST"); Request->SetURL("https://c.thirdweb.com/event"); - Request->SetHeader("Content-Type", "application/json"); - Request->SetHeader("x-sdk-name", "UnrealEngineSDK"); - Request->SetHeader("x-sdk-os", UGameplayStatics::GetPlatformName()); - Request->SetHeader("x-sdk-platform", "unreal-engine"); - Request->SetHeader("x-sdk-version", GetPluginVersion()); - Request->SetHeader("x-client-id", Settings->GetClientId()); - Request->SetHeader("x-bundle-id", Settings->GetBundleId()); + FThirdwebHeaders Headers; + Headers.SetMany({ + {TEXT("Content-Type"), TEXT("application/json")}, + {TEXT("x-sdk-name"), TEXT("UnrealEngineSDK")}, + {TEXT("x-sdk-os"), UGameplayStatics::GetPlatformName()}, + {TEXT("x-sdk-platform"), TEXT("unreal-engine")}, + {TEXT("x-sdk-version"), GetPluginVersion()}, + {TEXT("x-client-id"), Settings->GetClientId()}, + {TEXT("x-bundle-id"), Settings->GetBundleId()}, + }); + Headers.UpdateRequest(Request); Request->SetTimeout(5.0f); // ReSharper disable once CppLocalVariableMayBeConst @@ -451,7 +456,7 @@ namespace ThirdwebUtils JsonObject->SetStringField(TEXT("action"), TEXT("connect")); JsonObject->SetStringField(TEXT("walletAddress"), Wallet.ToAddress()); JsonObject->SetStringField(TEXT("walletType"), Wallet.GetTypeString()); - Request->SetContentAsString(ThirdwebUtils::Json::ToString(JsonObject)); + Request->SetContentAsString(Json::ToString(JsonObject)); Request->ProcessRequest(); } diff --git a/Source/Thirdweb/Public/Internal/ThirdwebHeaders.h b/Source/Thirdweb/Public/Internal/ThirdwebHeaders.h index a928f1c..3fa0663 100644 --- a/Source/Thirdweb/Public/Internal/ThirdwebHeaders.h +++ b/Source/Thirdweb/Public/Internal/ThirdwebHeaders.h @@ -10,9 +10,12 @@ class FThirdwebHeaders // Constructor FThirdwebHeaders(); - // Adds a header + // Adds a header conditionally void Set(const FString& Name, const FString& Value, const bool bCondition = true); + // Adds headers + void SetMany(TArray> Pairs); + // Removes a header bool Remove(const FString& Name); diff --git a/Thirdweb.uplugin b/Thirdweb.uplugin index 33113de..642fd14 100644 --- a/Thirdweb.uplugin +++ b/Thirdweb.uplugin @@ -1,7 +1,7 @@ { "FileVersion": 3, - "Version": 182, - "VersionName": "1.8.2", + "Version": 183, + "VersionName": "1.8.3", "FriendlyName": "Thirdweb SDK", "Description": "ThirdwebSDK for Unreal Engine", "Category": "Thirdweb",