From 4af6eeeb08a2230cef4f7dc542b9a59e1dc3b36b Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Thu, 3 Oct 2019 21:23:52 +0300 Subject: [PATCH 01/26] Update README.md Change documentation URL --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4d2a5534..bb24764b 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Key features: * Blueprintable FJsonValue wrapper - **full Json features made for blueprints!** * Both bindable events and **latent functions** are provided to control the asynchronous requests -Check the [Wiki](https://hiazma.atlassian.net/wiki/display/VAR) for plugin usage examples and installation notes. +Check the [Wiki](http://bit.ly/VaRest-Docs) for plugin usage examples and installation notes. Current version: **1.1 R 26** (UE 4.19-4.23) From 77b6fd556b53258f48e6f8431699d2353383d37c Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Sat, 5 Oct 2019 13:30:21 +0300 Subject: [PATCH 02/26] Update copyrights info --- Source/VaRestEditorPlugin/Classes/VaRest_BreakJson.h | 2 +- Source/VaRestEditorPlugin/Private/VaRestEditorPlugin.cpp | 2 +- Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp | 2 +- Source/VaRestEditorPlugin/Public/VaRestEditorPlugin.h | 2 +- Source/VaRestEditorPlugin/VaRestEditorPlugin.Build.cs | 2 +- Source/VaRestPlugin/Classes/VaRestJsonObject.h | 3 +-- Source/VaRestPlugin/Classes/VaRestJsonValue.h | 3 +-- Source/VaRestPlugin/Classes/VaRestLibrary.h | 2 +- Source/VaRestPlugin/Classes/VaRestRequestJSON.h | 2 +- Source/VaRestPlugin/Classes/VaRestSettings.h | 2 +- Source/VaRestPlugin/Classes/VaRestTypes.h | 2 +- Source/VaRestPlugin/Private/VaRestJsonObject.cpp | 2 +- Source/VaRestPlugin/Private/VaRestJsonValue.cpp | 2 +- Source/VaRestPlugin/Private/VaRestLibrary.cpp | 2 +- Source/VaRestPlugin/Private/VaRestPlugin.cpp | 2 +- Source/VaRestPlugin/Private/VaRestPluginPrivatePCH.h | 2 +- Source/VaRestPlugin/Private/VaRestRequestJSON.cpp | 2 +- Source/VaRestPlugin/Private/VaRestSettings.cpp | 2 +- Source/VaRestPlugin/Public/VaRestPlugin.h | 2 +- Source/VaRestPlugin/VaRestPlugin.Build.cs | 2 +- 20 files changed, 20 insertions(+), 22 deletions(-) diff --git a/Source/VaRestEditorPlugin/Classes/VaRest_BreakJson.h b/Source/VaRestEditorPlugin/Classes/VaRest_BreakJson.h index 8917b63f..7313fa71 100644 --- a/Source/VaRestEditorPlugin/Classes/VaRest_BreakJson.h +++ b/Source/VaRestEditorPlugin/Classes/VaRest_BreakJson.h @@ -1,4 +1,4 @@ -// Copyright 2015 Vladimir Alyamkin. All Rights Reserved. +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. // Original code by https://github.com/unktomi #pragma once diff --git a/Source/VaRestEditorPlugin/Private/VaRestEditorPlugin.cpp b/Source/VaRestEditorPlugin/Private/VaRestEditorPlugin.cpp index 19f843be..f751f58e 100644 --- a/Source/VaRestEditorPlugin/Private/VaRestEditorPlugin.cpp +++ b/Source/VaRestEditorPlugin/Private/VaRestEditorPlugin.cpp @@ -1,4 +1,4 @@ -// Copyright 2015 Vladimir Alyamkin. All Rights Reserved. +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. // Original code by https://github.com/unktomi #include "VaRestEditorPlugin.h" diff --git a/Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp b/Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp index 1a14290f..308b77cf 100644 --- a/Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp +++ b/Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp @@ -1,4 +1,4 @@ -// Copyright 2015 Vladimir Alyamkin. All Rights Reserved. +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. // Original code by https://github.com/unktomi #include "VaRest_BreakJson.h" diff --git a/Source/VaRestEditorPlugin/Public/VaRestEditorPlugin.h b/Source/VaRestEditorPlugin/Public/VaRestEditorPlugin.h index 6e1cb4a5..1d586a74 100644 --- a/Source/VaRestEditorPlugin/Public/VaRestEditorPlugin.h +++ b/Source/VaRestEditorPlugin/Public/VaRestEditorPlugin.h @@ -1,4 +1,4 @@ -// Copyright 2015 Vladimir Alyamkin. All Rights Reserved. +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. // Original code by https://github.com/unktomi #pragma once diff --git a/Source/VaRestEditorPlugin/VaRestEditorPlugin.Build.cs b/Source/VaRestEditorPlugin/VaRestEditorPlugin.Build.cs index e684e83e..40635d72 100644 --- a/Source/VaRestEditorPlugin/VaRestEditorPlugin.Build.cs +++ b/Source/VaRestEditorPlugin/VaRestEditorPlugin.Build.cs @@ -1,4 +1,4 @@ -// Copyright 2015 Vladimir Alyamkin. All Rights Reserved. +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. using UnrealBuildTool; diff --git a/Source/VaRestPlugin/Classes/VaRestJsonObject.h b/Source/VaRestPlugin/Classes/VaRestJsonObject.h index 32ece87d..272d5de2 100644 --- a/Source/VaRestPlugin/Classes/VaRestJsonObject.h +++ b/Source/VaRestPlugin/Classes/VaRestJsonObject.h @@ -1,5 +1,4 @@ -// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved. -// Copyright 2014 Vladimir Alyamkin. All Rights Reserved. +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. #pragma once diff --git a/Source/VaRestPlugin/Classes/VaRestJsonValue.h b/Source/VaRestPlugin/Classes/VaRestJsonValue.h index 9b5036b2..8fd2b727 100644 --- a/Source/VaRestPlugin/Classes/VaRestJsonValue.h +++ b/Source/VaRestPlugin/Classes/VaRestJsonValue.h @@ -1,5 +1,4 @@ -// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved. -// Copyright 2014 Vladimir Alyamkin. All Rights Reserved. +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. #pragma once diff --git a/Source/VaRestPlugin/Classes/VaRestLibrary.h b/Source/VaRestPlugin/Classes/VaRestLibrary.h index bfd5ea9d..1f9bbec5 100644 --- a/Source/VaRestPlugin/Classes/VaRestLibrary.h +++ b/Source/VaRestPlugin/Classes/VaRestLibrary.h @@ -1,4 +1,4 @@ -// Copyright 2016 Vladimir Alyamkin. All Rights Reserved. +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. #pragma once diff --git a/Source/VaRestPlugin/Classes/VaRestRequestJSON.h b/Source/VaRestPlugin/Classes/VaRestRequestJSON.h index a0497562..5145fe2a 100644 --- a/Source/VaRestPlugin/Classes/VaRestRequestJSON.h +++ b/Source/VaRestPlugin/Classes/VaRestRequestJSON.h @@ -1,4 +1,4 @@ -// Copyright 2014 Vladimir Alyamkin. All Rights Reserved. +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. #pragma once diff --git a/Source/VaRestPlugin/Classes/VaRestSettings.h b/Source/VaRestPlugin/Classes/VaRestSettings.h index 3de0258c..e39b6461 100644 --- a/Source/VaRestPlugin/Classes/VaRestSettings.h +++ b/Source/VaRestPlugin/Classes/VaRestSettings.h @@ -1,4 +1,4 @@ -// Copyright 2018 Vladimir Alyamkin. All Rights Reserved. +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. #pragma once diff --git a/Source/VaRestPlugin/Classes/VaRestTypes.h b/Source/VaRestPlugin/Classes/VaRestTypes.h index c1a61497..5088e60c 100644 --- a/Source/VaRestPlugin/Classes/VaRestTypes.h +++ b/Source/VaRestPlugin/Classes/VaRestTypes.h @@ -1,4 +1,4 @@ -// Copyright 2016 Vladimir Alyamkin. All Rights Reserved. +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. #pragma once diff --git a/Source/VaRestPlugin/Private/VaRestJsonObject.cpp b/Source/VaRestPlugin/Private/VaRestJsonObject.cpp index 3153c2cc..4167a018 100644 --- a/Source/VaRestPlugin/Private/VaRestJsonObject.cpp +++ b/Source/VaRestPlugin/Private/VaRestJsonObject.cpp @@ -1,4 +1,4 @@ -// Copyright 2014 Vladimir Alyamkin. All Rights Reserved. +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. #include "VaRestJsonObject.h" diff --git a/Source/VaRestPlugin/Private/VaRestJsonValue.cpp b/Source/VaRestPlugin/Private/VaRestJsonValue.cpp index dfe20434..cdd59b55 100644 --- a/Source/VaRestPlugin/Private/VaRestJsonValue.cpp +++ b/Source/VaRestPlugin/Private/VaRestJsonValue.cpp @@ -1,4 +1,4 @@ -// Copyright 2014 Vladimir Alyamkin. All Rights Reserved. +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. #include "VaRestJsonValue.h" #include "VaRestJsonObject.h" diff --git a/Source/VaRestPlugin/Private/VaRestLibrary.cpp b/Source/VaRestPlugin/Private/VaRestLibrary.cpp index 13893b64..d72f4496 100644 --- a/Source/VaRestPlugin/Private/VaRestLibrary.cpp +++ b/Source/VaRestPlugin/Private/VaRestLibrary.cpp @@ -1,4 +1,4 @@ -// Copyright 2016 Vladimir Alyamkin. All Rights Reserved. +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. #include "VaRestLibrary.h" #include "Misc/Base64.h" diff --git a/Source/VaRestPlugin/Private/VaRestPlugin.cpp b/Source/VaRestPlugin/Private/VaRestPlugin.cpp index 7bef598b..40e8a972 100644 --- a/Source/VaRestPlugin/Private/VaRestPlugin.cpp +++ b/Source/VaRestPlugin/Private/VaRestPlugin.cpp @@ -1,4 +1,4 @@ -// Copyright 2014 Vladimir Alyamkin. All Rights Reserved. +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. #include "VaRestPlugin.h" #include "VaRestJsonObject.h" diff --git a/Source/VaRestPlugin/Private/VaRestPluginPrivatePCH.h b/Source/VaRestPlugin/Private/VaRestPluginPrivatePCH.h index c9fd4f5a..4f551527 100644 --- a/Source/VaRestPlugin/Private/VaRestPluginPrivatePCH.h +++ b/Source/VaRestPlugin/Private/VaRestPluginPrivatePCH.h @@ -1,4 +1,4 @@ -// Copyright 2014 Vladimir Alyamkin. All Rights Reserved. +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. #pragma once diff --git a/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp b/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp index 7e66c018..9a1ac121 100644 --- a/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp +++ b/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp @@ -1,4 +1,4 @@ -// Copyright 2014 Vladimir Alyamkin. All Rights Reserved. +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. #include "VaRestRequestJSON.h" diff --git a/Source/VaRestPlugin/Private/VaRestSettings.cpp b/Source/VaRestPlugin/Private/VaRestSettings.cpp index e4d28ff2..79ba9c31 100644 --- a/Source/VaRestPlugin/Private/VaRestSettings.cpp +++ b/Source/VaRestPlugin/Private/VaRestSettings.cpp @@ -1,4 +1,4 @@ -// Copyright 2018 Vladimir Alyamkin. All Rights Reserved. +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. #include "VaRestSettings.h" diff --git a/Source/VaRestPlugin/Public/VaRestPlugin.h b/Source/VaRestPlugin/Public/VaRestPlugin.h index 52b1938a..756efe4b 100644 --- a/Source/VaRestPlugin/Public/VaRestPlugin.h +++ b/Source/VaRestPlugin/Public/VaRestPlugin.h @@ -1,4 +1,4 @@ -// Copyright 2014 Vladimir Alyamkin. All Rights Reserved. +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. #pragma once diff --git a/Source/VaRestPlugin/VaRestPlugin.Build.cs b/Source/VaRestPlugin/VaRestPlugin.Build.cs index d1ded261..fc7dad22 100644 --- a/Source/VaRestPlugin/VaRestPlugin.Build.cs +++ b/Source/VaRestPlugin/VaRestPlugin.Build.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2018 Vladimir Alyamkin. All Rights Reserved. +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. using System.IO; From ea9914f0f0496c99af98238c5659ab6e1fcc7e34 Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Sat, 5 Oct 2019 13:52:39 +0300 Subject: [PATCH 03/26] Fix defines and non-unity build --- Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp | 4 ++-- Source/VaRestPlugin/Classes/VaRestJsonValue.h | 2 ++ Source/VaRestPlugin/Private/VaRestJsonObject.cpp | 6 +++--- Source/VaRestPlugin/Private/VaRestJsonValue.cpp | 7 ++++--- Source/VaRestPlugin/Private/VaRestLibrary.cpp | 8 ++++++-- Source/VaRestPlugin/Private/VaRestPlugin.cpp | 6 ++---- .../{VaRestPluginPrivatePCH.h => VaRestPluginDefines.h} | 9 +++------ Source/VaRestPlugin/Private/VaRestRequestJSON.cpp | 3 ++- 8 files changed, 24 insertions(+), 21 deletions(-) rename Source/VaRestPlugin/Private/{VaRestPluginPrivatePCH.h => VaRestPluginDefines.h} (88%) diff --git a/Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp b/Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp index 308b77cf..dbd10be3 100644 --- a/Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp +++ b/Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp @@ -2,15 +2,15 @@ // Original code by https://github.com/unktomi #include "VaRest_BreakJson.h" + #include "BlueprintActionDatabaseRegistrar.h" #include "BlueprintNodeSpawner.h" #include "EdGraph/EdGraph.h" #include "EdGraph/EdGraphNodeUtils.h" // for FNodeTextCache #include "EdGraphSchema_K2.h" +#include "EdGraphUtilities.h" #include "EditorCategoryUtils.h" #include "KismetCompiler.h" - -#include "EdGraphUtilities.h" #include "Runtime/Launch/Resources/Version.h" #define LOCTEXT_NAMESPACE "VaRest_BreakJson" diff --git a/Source/VaRestPlugin/Classes/VaRestJsonValue.h b/Source/VaRestPlugin/Classes/VaRestJsonValue.h index 8fd2b727..eed5f7ed 100644 --- a/Source/VaRestPlugin/Classes/VaRestJsonValue.h +++ b/Source/VaRestPlugin/Classes/VaRestJsonValue.h @@ -2,6 +2,8 @@ #pragma once +#include "VaRestPluginDefines.h" + #include "VaRestJsonValue.generated.h" class UVaRestJsonObject; diff --git a/Source/VaRestPlugin/Private/VaRestJsonObject.cpp b/Source/VaRestPlugin/Private/VaRestJsonObject.cpp index 4167a018..24af3efe 100644 --- a/Source/VaRestPlugin/Private/VaRestJsonObject.cpp +++ b/Source/VaRestPlugin/Private/VaRestJsonObject.cpp @@ -4,15 +4,15 @@ #include "VaRestJsonParser.h" #include "VaRestJsonValue.h" -#include "VaRestPluginPrivatePCH.h" +#include "VaRestPluginDefines.h" #include "Runtime/Launch/Resources/Version.h" typedef TJsonWriterFactory> FCondensedJsonStringWriterFactory; typedef TJsonWriter> FCondensedJsonStringWriter; -UVaRestJsonObject::UVaRestJsonObject(const class FObjectInitializer& PCIP) - : Super(PCIP) +UVaRestJsonObject::UVaRestJsonObject(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) , JsonObj(MakeShared()) { } diff --git a/Source/VaRestPlugin/Private/VaRestJsonValue.cpp b/Source/VaRestPlugin/Private/VaRestJsonValue.cpp index cdd59b55..4487ad93 100644 --- a/Source/VaRestPlugin/Private/VaRestJsonValue.cpp +++ b/Source/VaRestPlugin/Private/VaRestJsonValue.cpp @@ -1,11 +1,12 @@ // Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. #include "VaRestJsonValue.h" + #include "VaRestJsonObject.h" -#include "VaRestPluginPrivatePCH.h" +#include "VaRestPluginDefines.h" -UVaRestJsonValue::UVaRestJsonValue(const class FObjectInitializer& PCIP) - : Super(PCIP) +UVaRestJsonValue::UVaRestJsonValue(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) { } diff --git a/Source/VaRestPlugin/Private/VaRestLibrary.cpp b/Source/VaRestPlugin/Private/VaRestLibrary.cpp index d72f4496..617ba9a5 100644 --- a/Source/VaRestPlugin/Private/VaRestLibrary.cpp +++ b/Source/VaRestPlugin/Private/VaRestLibrary.cpp @@ -1,11 +1,15 @@ // Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. #include "VaRestLibrary.h" -#include "Misc/Base64.h" + #include "VaRestJsonObject.h" -#include "VaRestPluginPrivatePCH.h" +#include "VaRestPluginDefines.h" #include "VaRestRequestJSON.h" +#include "Misc/Base64.h" +#include "Misc/FileHelper.h" +#include "Misc/Paths.h" + ////////////////////////////////////////////////////////////////////////// // Helpers diff --git a/Source/VaRestPlugin/Private/VaRestPlugin.cpp b/Source/VaRestPlugin/Private/VaRestPlugin.cpp index 40e8a972..19786cd3 100644 --- a/Source/VaRestPlugin/Private/VaRestPlugin.cpp +++ b/Source/VaRestPlugin/Private/VaRestPlugin.cpp @@ -1,15 +1,13 @@ // Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. #include "VaRestPlugin.h" + #include "VaRestJsonObject.h" #include "VaRestJsonValue.h" -#include "VaRestPluginPrivatePCH.h" +#include "VaRestPluginDefines.h" #include "VaRestRequestJSON.h" #include "VaRestSettings.h" -//#include "UObject/Package.h" -//#include "Misc/ConfigCacheIni.h" - #include "Developer/Settings/Public/ISettingsModule.h" #define LOCTEXT_NAMESPACE "VaRest" diff --git a/Source/VaRestPlugin/Private/VaRestPluginPrivatePCH.h b/Source/VaRestPlugin/Private/VaRestPluginDefines.h similarity index 88% rename from Source/VaRestPlugin/Private/VaRestPluginPrivatePCH.h rename to Source/VaRestPlugin/Private/VaRestPluginDefines.h index 4f551527..6c805dc3 100644 --- a/Source/VaRestPlugin/Private/VaRestPluginPrivatePCH.h +++ b/Source/VaRestPlugin/Private/VaRestPluginDefines.h @@ -15,12 +15,9 @@ #include "Engine.h" #endif -#include "Containers/Map.h" -#include "Http.h" -#include "Json.h" - -#include "LatentActions.h" -#include "Templates/SharedPointer.h" +#include "Logging/LogCategory.h" +#include "Logging/LogMacros.h" +#include "Logging/LogVerbosity.h" // You should place include statements to your module's private header files here. You only need to // add includes for headers that are used in most of your module's source files though. diff --git a/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp b/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp index 9a1ac121..d1bf9de4 100644 --- a/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp +++ b/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp @@ -4,9 +4,10 @@ #include "VaRestJsonObject.h" #include "VaRestLibrary.h" -#include "VaRestPluginPrivatePCH.h" +#include "VaRestPluginDefines.h" #include "VaRestSettings.h" +#include "Json.h" #include "Misc/CoreMisc.h" #include "Runtime/Launch/Resources/Version.h" From 0f85fe596e7ec486bee0109c3af2b4e6d6322aca Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Sat, 5 Oct 2019 14:05:21 +0300 Subject: [PATCH 04/26] Fix V547 Expression 'bIsDirty' is always true #204 #205 --- .../Private/VaRest_BreakJson.cpp | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp b/Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp index dbd10be3..7a531b12 100644 --- a/Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp +++ b/Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp @@ -213,15 +213,11 @@ FLinearColor UVaRest_BreakJson::GetNodeTitleColor() const void UVaRest_BreakJson::PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) { - bool bIsDirty = false; - FName PropertyName = (PropertyChangedEvent.Property != NULL) ? PropertyChangedEvent.Property->GetFName() : NAME_None; - if (true || PropertyName == TEXT("Outputs")) - { - bIsDirty = true; - } - - if (bIsDirty) + if (PropertyName == GET_MEMBER_NAME_STRING_CHECKED(UVaRest_BreakJson, Outputs) || + PropertyName == GET_MEMBER_NAME_STRING_CHECKED(FVaRest_NamedType, Name) || + PropertyName == GET_MEMBER_NAME_STRING_CHECKED(FVaRest_NamedType, Type) || + PropertyName == GET_MEMBER_NAME_STRING_CHECKED(FVaRest_NamedType, bIsArray)) { ReconstructNode(); GetGraph()->NotifyGraphChanged(); @@ -508,15 +504,11 @@ FLinearColor UVaRest_MakeJson::GetNodeTitleColor() const void UVaRest_MakeJson::PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) { - bool bIsDirty = false; - FName PropertyName = (PropertyChangedEvent.Property != NULL) ? PropertyChangedEvent.Property->GetFName() : NAME_None; - if (true || PropertyName == TEXT("Inputs")) - { - bIsDirty = true; - } - - if (bIsDirty) + if (PropertyName == GET_MEMBER_NAME_STRING_CHECKED(UVaRest_MakeJson, Inputs) || + PropertyName == GET_MEMBER_NAME_STRING_CHECKED(FVaRest_NamedType, Name) || + PropertyName == GET_MEMBER_NAME_STRING_CHECKED(FVaRest_NamedType, Type) || + PropertyName == GET_MEMBER_NAME_STRING_CHECKED(FVaRest_NamedType, bIsArray)) { ReconstructNode(); GetGraph()->NotifyGraphChanged(); From e9e56a75f111e0fbc9355bb3b3be8b8868de0826 Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Sat, 5 Oct 2019 14:12:06 +0300 Subject: [PATCH 05/26] Make construction functions not Pure. Close #225 --- Source/VaRestPlugin/Classes/VaRestJsonObject.h | 2 +- Source/VaRestPlugin/Classes/VaRestRequestJSON.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/VaRestPlugin/Classes/VaRestJsonObject.h b/Source/VaRestPlugin/Classes/VaRestJsonObject.h index 272d5de2..451452ef 100644 --- a/Source/VaRestPlugin/Classes/VaRestJsonObject.h +++ b/Source/VaRestPlugin/Classes/VaRestJsonObject.h @@ -17,7 +17,7 @@ class VARESTPLUGIN_API UVaRestJsonObject : public UObject GENERATED_UCLASS_BODY() /** Create new Json object */ - UFUNCTION(BlueprintPure, meta = (DisplayName = "Construct Json Object", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "VaRest|Json") + UFUNCTION(BlueprintCallable, meta = (DisplayName = "Construct Json Object", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "VaRest|Json") static UVaRestJsonObject* ConstructJsonObject(UObject* WorldContextObject); /** Reset all internal data */ diff --git a/Source/VaRestPlugin/Classes/VaRestRequestJSON.h b/Source/VaRestPlugin/Classes/VaRestRequestJSON.h index 5145fe2a..09a9430c 100644 --- a/Source/VaRestPlugin/Classes/VaRestRequestJSON.h +++ b/Source/VaRestPlugin/Classes/VaRestRequestJSON.h @@ -86,11 +86,11 @@ class VARESTPLUGIN_API UVaRestRequestJSON : public UObject // Construction /** Creates new request (totally empty) */ - UFUNCTION(BlueprintPure, meta = (DisplayName = "Construct Json Request (Empty)", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "VaRest|Request") + UFUNCTION(BlueprintCallable, meta = (DisplayName = "Construct Json Request (Empty)", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "VaRest|Request") static UVaRestRequestJSON* ConstructRequest(UObject* WorldContextObject); /** Creates new request with defined verb and content type */ - UFUNCTION(BlueprintPure, meta = (DisplayName = "Construct Json Request", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "VaRest|Request") + UFUNCTION(BlueprintCallable, meta = (DisplayName = "Construct Json Request", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "VaRest|Request") static UVaRestRequestJSON* ConstructRequestExt(UObject* WorldContextObject, ERequestVerb Verb, ERequestContentType ContentType); /** Set verb to the request */ From 09c62ad2dd93c1723236fdb714db58338b8eb344 Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Sat, 5 Oct 2019 14:34:21 +0300 Subject: [PATCH 06/26] Add delegates header --- Source/VaRestPlugin/Classes/VaRestLibrary.h | 1 + Source/VaRestPlugin/Private/VaRestPluginDefines.h | 1 + 2 files changed, 2 insertions(+) diff --git a/Source/VaRestPlugin/Classes/VaRestLibrary.h b/Source/VaRestPlugin/Classes/VaRestLibrary.h index 1f9bbec5..3f877861 100644 --- a/Source/VaRestPlugin/Classes/VaRestLibrary.h +++ b/Source/VaRestPlugin/Classes/VaRestLibrary.h @@ -4,6 +4,7 @@ #include "Kismet/BlueprintFunctionLibrary.h" +#include "VaRestPluginDefines.h" #include "VaRestTypes.h" #include "VaRestLibrary.generated.h" diff --git a/Source/VaRestPlugin/Private/VaRestPluginDefines.h b/Source/VaRestPlugin/Private/VaRestPluginDefines.h index 6c805dc3..17b35010 100644 --- a/Source/VaRestPlugin/Private/VaRestPluginDefines.h +++ b/Source/VaRestPlugin/Private/VaRestPluginDefines.h @@ -15,6 +15,7 @@ #include "Engine.h" #endif +#include "Delegates/DelegateCombinations.h" #include "Logging/LogCategory.h" #include "Logging/LogMacros.h" #include "Logging/LogVerbosity.h" From 9434ec766b8ff28e87932b866081008e516a5e6c Mon Sep 17 00:00:00 2001 From: FreezerNick Date: Sat, 19 Oct 2019 17:05:28 +0200 Subject: [PATCH 07/26] Converted FVaRest_NamedType::Name to FText For #187 --- Source/VaRestEditorPlugin/Classes/VaRest_BreakJson.h | 2 +- Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/VaRestEditorPlugin/Classes/VaRest_BreakJson.h b/Source/VaRestEditorPlugin/Classes/VaRest_BreakJson.h index 7313fa71..07d5c813 100644 --- a/Source/VaRestEditorPlugin/Classes/VaRest_BreakJson.h +++ b/Source/VaRestEditorPlugin/Classes/VaRest_BreakJson.h @@ -30,7 +30,7 @@ struct FVaRest_NamedType GENERATED_USTRUCT_BODY(); UPROPERTY(EditAnywhere, Category = NamedType) - FString Name; + FText Name; UPROPERTY(EditAnywhere, Category = NamedType) EVaRest_JsonType Type; diff --git a/Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp b/Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp index 7a531b12..d489a2a2 100644 --- a/Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp +++ b/Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp @@ -273,7 +273,7 @@ void UVaRest_BreakJson::CreateProjectionPins(UEdGraphPin* Source) #endif UObject* Subtype = nullptr; - FString FieldName = (*it).Name; + FString FieldName = (*it).Name.ToString(); switch ((*it).Type) { @@ -297,7 +297,7 @@ void UVaRest_BreakJson::CreateProjectionPins(UEdGraphPin* Source) UEdGraphNode::FCreatePinParams OutputPinParams; OutputPinParams.ContainerType = (*it).bIsArray ? EPinContainerType::Array : EPinContainerType::None; - UEdGraphPin* OutputPin = CreatePin(EGPD_Output, Type, TEXT(""), Subtype, FName(*(*it).Name), OutputPinParams); + UEdGraphPin* OutputPin = CreatePin(EGPD_Output, Type, TEXT(""), Subtype, FName((*(*it).Name.ToString())), OutputPinParams); } } @@ -559,7 +559,7 @@ void UVaRest_MakeJson::CreateProjectionPins(UEdGraphPin* Source) { FName Type; UObject* Subtype = nullptr; - FString FieldName = (*it).Name; + FString FieldName = (*it).Name.ToString(); switch ((*it).Type) { @@ -583,7 +583,7 @@ void UVaRest_MakeJson::CreateProjectionPins(UEdGraphPin* Source) UEdGraphNode::FCreatePinParams InputPinParams; InputPinParams.ContainerType = (*it).bIsArray ? EPinContainerType::Array : EPinContainerType::None; - UEdGraphPin* InputPin = CreatePin(EGPD_Input, Type, TEXT(""), Subtype, FName(*(*it).Name), InputPinParams); + UEdGraphPin* InputPin = CreatePin(EGPD_Input, Type, TEXT(""), Subtype, FName((*(*it).Name.ToString())), InputPinParams); #if ENGINE_MINOR_VERSION >= 20 InputPin->SetSavePinIfOrphaned(false); From 2af8179e2ffde167325520abaf6a7c4ab15d0935 Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Fri, 1 Nov 2019 13:22:43 +0300 Subject: [PATCH 08/26] Remove CallURL #123 --- Source/VaRestPlugin/Classes/VaRestLibrary.h | 14 ----- Source/VaRestPlugin/Private/VaRestLibrary.cpp | 59 ------------------- 2 files changed, 73 deletions(-) diff --git a/Source/VaRestPlugin/Classes/VaRestLibrary.h b/Source/VaRestPlugin/Classes/VaRestLibrary.h index 3f877861..aa1fa0b7 100644 --- a/Source/VaRestPlugin/Classes/VaRestLibrary.h +++ b/Source/VaRestPlugin/Classes/VaRestLibrary.h @@ -102,18 +102,4 @@ class VARESTPLUGIN_API UVaRestLibrary : public UBlueprintFunctionLibrary */ UFUNCTION(BlueprintCallable, Category = "VaRest|Utility", meta = (WorldContext = "WorldContextObject")) static class UVaRestJsonObject* LoadJsonFromFile(UObject* WorldContextObject, const FString& Path, const bool bIsRelativeToContentDir = true); - - ////////////////////////////////////////////////////////////////////////// - // Easy URL processing - -public: - /** Easy way to process http requests */ - UFUNCTION(BlueprintCallable, Category = "VaRest|Utility", meta = (WorldContext = "WorldContextObject")) - static void CallURL(UObject* WorldContextObject, const FString& URL, ERequestVerb Verb, ERequestContentType ContentType, UVaRestJsonObject* VaRestJson, const FVaRestCallDelegate& Callback); - - /** Called when URL is processed (one for both success/unsuccess events)*/ - static void OnCallComplete(UVaRestRequestJSON* Request); - -private: - static TMap RequestMap; }; diff --git a/Source/VaRestPlugin/Private/VaRestLibrary.cpp b/Source/VaRestPlugin/Private/VaRestLibrary.cpp index 617ba9a5..2b540b72 100644 --- a/Source/VaRestPlugin/Private/VaRestLibrary.cpp +++ b/Source/VaRestPlugin/Private/VaRestLibrary.cpp @@ -70,62 +70,3 @@ class UVaRestJsonObject* UVaRestLibrary::LoadJsonFromFile(UObject* WorldContextO return nullptr; } - -////////////////////////////////////////////////////////////////////////// -// Easy URL processing - -TMap UVaRestLibrary::RequestMap; - -void UVaRestLibrary::CallURL(UObject* WorldContextObject, const FString& URL, ERequestVerb Verb, ERequestContentType ContentType, UVaRestJsonObject* VaRestJson, const FVaRestCallDelegate& Callback) -{ - UWorld* World = GEngine->GetWorldFromContextObjectChecked(WorldContextObject); - if (World == nullptr) - { - UE_LOG(LogVaRest, Error, TEXT("UVaRestLibrary: Wrong world context")) - return; - } - - // Check we have valid data json - if (VaRestJson == nullptr) - { - VaRestJson = UVaRestJsonObject::ConstructJsonObject(WorldContextObject); - } - - UVaRestRequestJSON* Request = NewObject(); - - Request->SetVerb(Verb); - Request->SetContentType(ContentType); - Request->SetRequestObject(VaRestJson); - - FVaRestCallResponse Response; - Response.Request = Request; - Response.WorldContextObject = WorldContextObject; - Response.Callback = Callback; - - Response.CompleteDelegateHandle = Request->OnStaticRequestComplete.AddStatic(&UVaRestLibrary::OnCallComplete); - Response.FailDelegateHandle = Request->OnStaticRequestFail.AddStatic(&UVaRestLibrary::OnCallComplete); - - RequestMap.Add(Request, Response); - - Request->ResetResponseData(); - Request->ProcessURL(URL); -} - -void UVaRestLibrary::OnCallComplete(UVaRestRequestJSON* Request) -{ - if (!RequestMap.Contains(Request)) - { - return; - } - - FVaRestCallResponse* Response = RequestMap.Find(Request); - - Request->OnStaticRequestComplete.Remove(Response->CompleteDelegateHandle); - Request->OnStaticRequestFail.Remove(Response->FailDelegateHandle); - - Response->Callback.ExecuteIfBound(Request); - - Response->WorldContextObject = nullptr; - Response->Request = nullptr; - RequestMap.Remove(Request); -} From a66139a090ff7e9f4cae7f8c34cb19e75bc1ae83 Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Fri, 1 Nov 2019 13:22:54 +0300 Subject: [PATCH 09/26] Add request controller #123 --- .../Classes/VaRestRequestController.h | 18 ++++++ Source/VaRestPlugin/Private/VaRestPlugin.cpp | 58 ++++++++++++++++++- .../Private/VaRestRequestController.cpp | 14 +++++ Source/VaRestPlugin/Public/VaRestPlugin.h | 16 +++++ 4 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 Source/VaRestPlugin/Classes/VaRestRequestController.h create mode 100644 Source/VaRestPlugin/Private/VaRestRequestController.cpp diff --git a/Source/VaRestPlugin/Classes/VaRestRequestController.h b/Source/VaRestPlugin/Classes/VaRestRequestController.h new file mode 100644 index 00000000..220b786d --- /dev/null +++ b/Source/VaRestPlugin/Classes/VaRestRequestController.h @@ -0,0 +1,18 @@ +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. + +#pragma once + +#include "VaRestPluginDefines.h" + +#include "VaRestRequestController.generated.h" + +UCLASS() +class VARESTPLUGIN_API UVaRestRequestController : public UObject +{ + GENERATED_UCLASS_BODY() + +public: + /** */ + UFUNCTION(BlueprintCallable, Category = "VaRest|Controller") + void Initialize(); +}; diff --git a/Source/VaRestPlugin/Private/VaRestPlugin.cpp b/Source/VaRestPlugin/Private/VaRestPlugin.cpp index 19786cd3..5112eb76 100644 --- a/Source/VaRestPlugin/Private/VaRestPlugin.cpp +++ b/Source/VaRestPlugin/Private/VaRestPlugin.cpp @@ -5,6 +5,7 @@ #include "VaRestJsonObject.h" #include "VaRestJsonValue.h" #include "VaRestPluginDefines.h" +#include "VaRestRequestController.h" #include "VaRestRequestJSON.h" #include "VaRestSettings.h" @@ -22,14 +23,37 @@ class FVaRestPlugin : public IVaRestPlugin UVaRestJsonValue::StaticClass(); UVaRestRequestJSON::StaticClass(); + VaRestSettings = NewObject(GetTransientPackage(), "VaRestSettings", RF_Standalone); + VaRestSettings->AddToRoot(); + // Register settings if (ISettingsModule* SettingsModule = FModuleManager::GetModulePtr("Settings")) { SettingsModule->RegisterSettings("Project", "Plugins", "VaRest", - LOCTEXT("RuntimeSettingsName", "VaRest Kit"), - LOCTEXT("RuntimeSettingsDescription", "Configure API keys for VaRest"), - GetMutableDefault()); + LOCTEXT("RuntimeSettingsName", "VaRest"), + LOCTEXT("RuntimeSettingsDescription", "Configure VaRest plugin settings"), + VaRestSettings); } + + FWorldDelegates::OnWorldCleanup.AddLambda([this](UWorld* World, bool bSessionEnded, bool bCleanupResources) { + RequestControllers.Remove(World); + + UE_LOG(LogVaRest, Log, TEXT("%s: Request Controller is removed for: %s"), *VA_FUNC_LINE, *World->GetName()); + }); + + FWorldDelegates::OnPostWorldInitialization.AddLambda([this](UWorld* World, const UWorld::InitializationValues IVS) { + auto Controller = NewObject(GetTransientPackage()); + Controller->SetFlags(RF_Standalone); + Controller->AddToRoot(); + + Controller->Initialize(); + + RequestControllers.Add(World, Controller); + + UE_LOG(LogVaRest, Log, TEXT("%s: Request Controller is created for: %s"), *VA_FUNC_LINE, *World->GetName()); + }); + + UE_LOG(LogVaRest, Log, TEXT("%s: VaRest module started"), *VA_FUNC_LINE); } virtual void ShutdownModule() override @@ -38,9 +62,37 @@ class FVaRestPlugin : public IVaRestPlugin { SettingsModule->UnregisterSettings("Project", "Plugins", "VaRest"); } + + if (!GExitPurge) + { + VaRestSettings->RemoveFromRoot(); + + // If we're in exit purge, this object has already been destroyed + for (auto Controller : RequestControllers) + { + Controller.Value->RemoveFromRoot(); + } + } + else + { + VaRestSettings = nullptr; + } + + RequestControllers.Empty(); } }; +UVaRestSettings* IVaRestPlugin::GetSettings() const +{ + check(VaRestSettings); + return VaRestSettings; +} + +UVaRestRequestController* IVaRestPlugin::GetRequestController(UWorld* World) const +{ + return RequestControllers.FindChecked(World); +} + IMPLEMENT_MODULE(FVaRestPlugin, VaRestPlugin) DEFINE_LOG_CATEGORY(LogVaRest); diff --git a/Source/VaRestPlugin/Private/VaRestRequestController.cpp b/Source/VaRestPlugin/Private/VaRestRequestController.cpp new file mode 100644 index 00000000..dc75f600 --- /dev/null +++ b/Source/VaRestPlugin/Private/VaRestRequestController.cpp @@ -0,0 +1,14 @@ +// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. + +#include "VaRestRequestController.h" + +#include "VaRestPluginDefines.h" + +UVaRestRequestController::UVaRestRequestController(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UVaRestRequestController::Initialize() +{ +} diff --git a/Source/VaRestPlugin/Public/VaRestPlugin.h b/Source/VaRestPlugin/Public/VaRestPlugin.h index 756efe4b..92e446e1 100644 --- a/Source/VaRestPlugin/Public/VaRestPlugin.h +++ b/Source/VaRestPlugin/Public/VaRestPlugin.h @@ -4,6 +4,9 @@ #include "Modules/ModuleManager.h" +class UVaRestRequestController; +class UVaRestSettings; + /** * The public interface to this module. In most cases, this interface is only public to sibling modules * within this plugin. @@ -32,4 +35,17 @@ class IVaRestPlugin : public IModuleInterface { return FModuleManager::Get().IsModuleLoaded("VaRestPlugin"); } + + /** Getter for internal settings object to support runtime configuration changes */ + UVaRestSettings* GetSettings() const; + + /** Get global request controller */ + UVaRestRequestController* GetRequestController(UWorld* World) const; + +protected: + /** Module settings */ + UVaRestSettings* VaRestSettings; + + /** Request controllers (one for each World we have) */ + TMap RequestControllers; }; From 47b0d384fe6ea943bb6b8d28c0a0e67f6cef9f51 Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Fri, 1 Nov 2019 13:25:25 +0300 Subject: [PATCH 10/26] Remove Classes folder #244 --- Source/VaRestEditorPlugin/{Classes => Public}/VaRest_BreakJson.h | 0 Source/VaRestPlugin/{Classes => Public}/VaRestJsonObject.h | 0 Source/VaRestPlugin/{Classes => Public}/VaRestJsonValue.h | 0 Source/VaRestPlugin/{Classes => Public}/VaRestLibrary.h | 0 Source/VaRestPlugin/{Classes => Public}/VaRestRequestController.h | 0 Source/VaRestPlugin/{Classes => Public}/VaRestRequestJSON.h | 0 Source/VaRestPlugin/{Classes => Public}/VaRestSettings.h | 0 Source/VaRestPlugin/{Classes => Public}/VaRestTypes.h | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename Source/VaRestEditorPlugin/{Classes => Public}/VaRest_BreakJson.h (100%) rename Source/VaRestPlugin/{Classes => Public}/VaRestJsonObject.h (100%) rename Source/VaRestPlugin/{Classes => Public}/VaRestJsonValue.h (100%) rename Source/VaRestPlugin/{Classes => Public}/VaRestLibrary.h (100%) rename Source/VaRestPlugin/{Classes => Public}/VaRestRequestController.h (100%) rename Source/VaRestPlugin/{Classes => Public}/VaRestRequestJSON.h (100%) rename Source/VaRestPlugin/{Classes => Public}/VaRestSettings.h (100%) rename Source/VaRestPlugin/{Classes => Public}/VaRestTypes.h (100%) diff --git a/Source/VaRestEditorPlugin/Classes/VaRest_BreakJson.h b/Source/VaRestEditorPlugin/Public/VaRest_BreakJson.h similarity index 100% rename from Source/VaRestEditorPlugin/Classes/VaRest_BreakJson.h rename to Source/VaRestEditorPlugin/Public/VaRest_BreakJson.h diff --git a/Source/VaRestPlugin/Classes/VaRestJsonObject.h b/Source/VaRestPlugin/Public/VaRestJsonObject.h similarity index 100% rename from Source/VaRestPlugin/Classes/VaRestJsonObject.h rename to Source/VaRestPlugin/Public/VaRestJsonObject.h diff --git a/Source/VaRestPlugin/Classes/VaRestJsonValue.h b/Source/VaRestPlugin/Public/VaRestJsonValue.h similarity index 100% rename from Source/VaRestPlugin/Classes/VaRestJsonValue.h rename to Source/VaRestPlugin/Public/VaRestJsonValue.h diff --git a/Source/VaRestPlugin/Classes/VaRestLibrary.h b/Source/VaRestPlugin/Public/VaRestLibrary.h similarity index 100% rename from Source/VaRestPlugin/Classes/VaRestLibrary.h rename to Source/VaRestPlugin/Public/VaRestLibrary.h diff --git a/Source/VaRestPlugin/Classes/VaRestRequestController.h b/Source/VaRestPlugin/Public/VaRestRequestController.h similarity index 100% rename from Source/VaRestPlugin/Classes/VaRestRequestController.h rename to Source/VaRestPlugin/Public/VaRestRequestController.h diff --git a/Source/VaRestPlugin/Classes/VaRestRequestJSON.h b/Source/VaRestPlugin/Public/VaRestRequestJSON.h similarity index 100% rename from Source/VaRestPlugin/Classes/VaRestRequestJSON.h rename to Source/VaRestPlugin/Public/VaRestRequestJSON.h diff --git a/Source/VaRestPlugin/Classes/VaRestSettings.h b/Source/VaRestPlugin/Public/VaRestSettings.h similarity index 100% rename from Source/VaRestPlugin/Classes/VaRestSettings.h rename to Source/VaRestPlugin/Public/VaRestSettings.h diff --git a/Source/VaRestPlugin/Classes/VaRestTypes.h b/Source/VaRestPlugin/Public/VaRestTypes.h similarity index 100% rename from Source/VaRestPlugin/Classes/VaRestTypes.h rename to Source/VaRestPlugin/Public/VaRestTypes.h From 9c621f8103929622b6ff510bcb5cadd879f556da Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Fri, 1 Nov 2019 13:32:56 +0300 Subject: [PATCH 11/26] Remove 'Plugin' word from naming #244 --- .../VaRestPlugin.cpp => VaRest/Private/VaRest.cpp} | 12 ++++++------ .../Private/VaRestDefines.h} | 0 .../Private/VaRestJsonObject.cpp | 2 +- .../Private/VaRestJsonParser.cpp | 0 .../Private/VaRestJsonParser.h | 0 .../Private/VaRestJsonValue.cpp | 2 +- .../Private/VaRestLibrary.cpp | 2 +- .../Private/VaRestRequestController.cpp | 2 +- .../Private/VaRestRequestJSON.cpp | 2 +- .../Private/VaRestSettings.cpp | 0 .../Public/VaRestPlugin.h => VaRest/Public/VaRest.h} | 8 ++++---- .../Public/VaRestJsonObject.h | 2 +- .../Public/VaRestJsonValue.h | 4 ++-- .../{VaRestPlugin => VaRest}/Public/VaRestLibrary.h | 4 ++-- .../Public/VaRestRequestController.h | 4 ++-- .../Public/VaRestRequestJSON.h | 2 +- .../{VaRestPlugin => VaRest}/Public/VaRestSettings.h | 2 +- Source/{VaRestPlugin => VaRest}/Public/VaRestTypes.h | 0 .../VaRestPlugin.Build.cs => VaRest/VaRest.Build.cs} | 6 +++--- .../Private/VaRestEditor.cpp} | 11 +++++------ .../Private/VaRest_BreakJson.cpp | 12 ++++++------ .../Public/VaRestEditor.h} | 3 +-- .../Public/VaRest_BreakJson.h | 4 ++-- .../VaRestEditor.Build.cs} | 8 ++++---- VaRestPlugin.uplugin => VaRest.uplugin | 10 +++++----- 25 files changed, 50 insertions(+), 52 deletions(-) rename Source/{VaRestPlugin/Private/VaRestPlugin.cpp => VaRest/Private/VaRest.cpp} (90%) rename Source/{VaRestPlugin/Private/VaRestPluginDefines.h => VaRest/Private/VaRestDefines.h} (100%) rename Source/{VaRestPlugin => VaRest}/Private/VaRestJsonObject.cpp (99%) rename Source/{VaRestPlugin => VaRest}/Private/VaRestJsonParser.cpp (100%) rename Source/{VaRestPlugin => VaRest}/Private/VaRestJsonParser.h (100%) rename Source/{VaRestPlugin => VaRest}/Private/VaRestJsonValue.cpp (99%) rename Source/{VaRestPlugin => VaRest}/Private/VaRestLibrary.cpp (98%) rename Source/{VaRestPlugin => VaRest}/Private/VaRestRequestController.cpp (89%) rename Source/{VaRestPlugin => VaRest}/Private/VaRestRequestJSON.cpp (99%) rename Source/{VaRestPlugin => VaRest}/Private/VaRestSettings.cpp (100%) rename Source/{VaRestPlugin/Public/VaRestPlugin.h => VaRest/Public/VaRest.h} (85%) rename Source/{VaRestPlugin => VaRest}/Public/VaRestJsonObject.h (99%) rename Source/{VaRestPlugin => VaRest}/Public/VaRestJsonValue.h (97%) rename Source/{VaRestPlugin => VaRest}/Public/VaRestLibrary.h (96%) rename Source/{VaRestPlugin => VaRest}/Public/VaRestRequestController.h (73%) rename Source/{VaRestPlugin => VaRest}/Public/VaRestRequestJSON.h (99%) rename Source/{VaRestPlugin => VaRest}/Public/VaRestSettings.h (86%) rename Source/{VaRestPlugin => VaRest}/Public/VaRestTypes.h (100%) rename Source/{VaRestPlugin/VaRestPlugin.Build.cs => VaRest/VaRest.Build.cs} (79%) rename Source/{VaRestEditorPlugin/Private/VaRestEditorPlugin.cpp => VaRestEditor/Private/VaRestEditor.cpp} (57%) rename Source/{VaRestEditorPlugin => VaRestEditor}/Private/VaRest_BreakJson.cpp (98%) rename Source/{VaRestEditorPlugin/Public/VaRestEditorPlugin.h => VaRestEditor/Public/VaRestEditor.h} (70%) rename Source/{VaRestEditorPlugin => VaRestEditor}/Public/VaRest_BreakJson.h (95%) rename Source/{VaRestEditorPlugin/VaRestEditorPlugin.Build.cs => VaRestEditor/VaRestEditor.Build.cs} (87%) rename VaRestPlugin.uplugin => VaRest.uplugin (75%) diff --git a/Source/VaRestPlugin/Private/VaRestPlugin.cpp b/Source/VaRest/Private/VaRest.cpp similarity index 90% rename from Source/VaRestPlugin/Private/VaRestPlugin.cpp rename to Source/VaRest/Private/VaRest.cpp index 5112eb76..50dd8310 100644 --- a/Source/VaRestPlugin/Private/VaRestPlugin.cpp +++ b/Source/VaRest/Private/VaRest.cpp @@ -1,10 +1,10 @@ // Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. -#include "VaRestPlugin.h" +#include "VaRest.h" #include "VaRestJsonObject.h" #include "VaRestJsonValue.h" -#include "VaRestPluginDefines.h" +#include "VaRestDefines.h" #include "VaRestRequestController.h" #include "VaRestRequestJSON.h" #include "VaRestSettings.h" @@ -13,7 +13,7 @@ #define LOCTEXT_NAMESPACE "VaRest" -class FVaRestPlugin : public IVaRestPlugin +class FVaRest : public IVaRest { /** IModuleInterface implementation */ virtual void StartupModule() override @@ -82,18 +82,18 @@ class FVaRestPlugin : public IVaRestPlugin } }; -UVaRestSettings* IVaRestPlugin::GetSettings() const +UVaRestSettings* IVaRest::GetSettings() const { check(VaRestSettings); return VaRestSettings; } -UVaRestRequestController* IVaRestPlugin::GetRequestController(UWorld* World) const +UVaRestRequestController* IVaRest::GetRequestController(UWorld* World) const { return RequestControllers.FindChecked(World); } -IMPLEMENT_MODULE(FVaRestPlugin, VaRestPlugin) +IMPLEMENT_MODULE(FVaRest, VaRest) DEFINE_LOG_CATEGORY(LogVaRest); diff --git a/Source/VaRestPlugin/Private/VaRestPluginDefines.h b/Source/VaRest/Private/VaRestDefines.h similarity index 100% rename from Source/VaRestPlugin/Private/VaRestPluginDefines.h rename to Source/VaRest/Private/VaRestDefines.h diff --git a/Source/VaRestPlugin/Private/VaRestJsonObject.cpp b/Source/VaRest/Private/VaRestJsonObject.cpp similarity index 99% rename from Source/VaRestPlugin/Private/VaRestJsonObject.cpp rename to Source/VaRest/Private/VaRestJsonObject.cpp index 24af3efe..849bd7e5 100644 --- a/Source/VaRestPlugin/Private/VaRestJsonObject.cpp +++ b/Source/VaRest/Private/VaRestJsonObject.cpp @@ -4,7 +4,7 @@ #include "VaRestJsonParser.h" #include "VaRestJsonValue.h" -#include "VaRestPluginDefines.h" +#include "VaRestDefines.h" #include "Runtime/Launch/Resources/Version.h" diff --git a/Source/VaRestPlugin/Private/VaRestJsonParser.cpp b/Source/VaRest/Private/VaRestJsonParser.cpp similarity index 100% rename from Source/VaRestPlugin/Private/VaRestJsonParser.cpp rename to Source/VaRest/Private/VaRestJsonParser.cpp diff --git a/Source/VaRestPlugin/Private/VaRestJsonParser.h b/Source/VaRest/Private/VaRestJsonParser.h similarity index 100% rename from Source/VaRestPlugin/Private/VaRestJsonParser.h rename to Source/VaRest/Private/VaRestJsonParser.h diff --git a/Source/VaRestPlugin/Private/VaRestJsonValue.cpp b/Source/VaRest/Private/VaRestJsonValue.cpp similarity index 99% rename from Source/VaRestPlugin/Private/VaRestJsonValue.cpp rename to Source/VaRest/Private/VaRestJsonValue.cpp index 4487ad93..d9bd1ba8 100644 --- a/Source/VaRestPlugin/Private/VaRestJsonValue.cpp +++ b/Source/VaRest/Private/VaRestJsonValue.cpp @@ -3,7 +3,7 @@ #include "VaRestJsonValue.h" #include "VaRestJsonObject.h" -#include "VaRestPluginDefines.h" +#include "VaRestDefines.h" UVaRestJsonValue::UVaRestJsonValue(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) diff --git a/Source/VaRestPlugin/Private/VaRestLibrary.cpp b/Source/VaRest/Private/VaRestLibrary.cpp similarity index 98% rename from Source/VaRestPlugin/Private/VaRestLibrary.cpp rename to Source/VaRest/Private/VaRestLibrary.cpp index 2b540b72..9f39b662 100644 --- a/Source/VaRestPlugin/Private/VaRestLibrary.cpp +++ b/Source/VaRest/Private/VaRestLibrary.cpp @@ -3,7 +3,7 @@ #include "VaRestLibrary.h" #include "VaRestJsonObject.h" -#include "VaRestPluginDefines.h" +#include "VaRestDefines.h" #include "VaRestRequestJSON.h" #include "Misc/Base64.h" diff --git a/Source/VaRestPlugin/Private/VaRestRequestController.cpp b/Source/VaRest/Private/VaRestRequestController.cpp similarity index 89% rename from Source/VaRestPlugin/Private/VaRestRequestController.cpp rename to Source/VaRest/Private/VaRestRequestController.cpp index dc75f600..a38682a7 100644 --- a/Source/VaRestPlugin/Private/VaRestRequestController.cpp +++ b/Source/VaRest/Private/VaRestRequestController.cpp @@ -2,7 +2,7 @@ #include "VaRestRequestController.h" -#include "VaRestPluginDefines.h" +#include "VaRestDefines.h" UVaRestRequestController::UVaRestRequestController(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) diff --git a/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp b/Source/VaRest/Private/VaRestRequestJSON.cpp similarity index 99% rename from Source/VaRestPlugin/Private/VaRestRequestJSON.cpp rename to Source/VaRest/Private/VaRestRequestJSON.cpp index d1bf9de4..8459712f 100644 --- a/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp +++ b/Source/VaRest/Private/VaRestRequestJSON.cpp @@ -4,7 +4,7 @@ #include "VaRestJsonObject.h" #include "VaRestLibrary.h" -#include "VaRestPluginDefines.h" +#include "VaRestDefines.h" #include "VaRestSettings.h" #include "Json.h" diff --git a/Source/VaRestPlugin/Private/VaRestSettings.cpp b/Source/VaRest/Private/VaRestSettings.cpp similarity index 100% rename from Source/VaRestPlugin/Private/VaRestSettings.cpp rename to Source/VaRest/Private/VaRestSettings.cpp diff --git a/Source/VaRestPlugin/Public/VaRestPlugin.h b/Source/VaRest/Public/VaRest.h similarity index 85% rename from Source/VaRestPlugin/Public/VaRestPlugin.h rename to Source/VaRest/Public/VaRest.h index 92e446e1..cdad0357 100644 --- a/Source/VaRestPlugin/Public/VaRestPlugin.h +++ b/Source/VaRest/Public/VaRest.h @@ -11,7 +11,7 @@ class UVaRestSettings; * The public interface to this module. In most cases, this interface is only public to sibling modules * within this plugin. */ -class IVaRestPlugin : public IModuleInterface +class IVaRest : public IModuleInterface { public: @@ -21,9 +21,9 @@ class IVaRestPlugin : public IModuleInterface * * @return Returns singleton instance, loading the module on demand if needed */ - static inline IVaRestPlugin& Get() + static inline IVaRest& Get() { - return FModuleManager::LoadModuleChecked("VaRestPlugin"); + return FModuleManager::LoadModuleChecked("VaRest"); } /** @@ -33,7 +33,7 @@ class IVaRestPlugin : public IModuleInterface */ static inline bool IsAvailable() { - return FModuleManager::Get().IsModuleLoaded("VaRestPlugin"); + return FModuleManager::Get().IsModuleLoaded("VaRest"); } /** Getter for internal settings object to support runtime configuration changes */ diff --git a/Source/VaRestPlugin/Public/VaRestJsonObject.h b/Source/VaRest/Public/VaRestJsonObject.h similarity index 99% rename from Source/VaRestPlugin/Public/VaRestJsonObject.h rename to Source/VaRest/Public/VaRestJsonObject.h index 451452ef..1bfff3d8 100644 --- a/Source/VaRestPlugin/Public/VaRestJsonObject.h +++ b/Source/VaRest/Public/VaRestJsonObject.h @@ -12,7 +12,7 @@ class UVaRestJsonValue; * Blueprintable FJsonObject wrapper */ UCLASS(BlueprintType, Blueprintable) -class VARESTPLUGIN_API UVaRestJsonObject : public UObject +class VAREST_API UVaRestJsonObject : public UObject { GENERATED_UCLASS_BODY() diff --git a/Source/VaRestPlugin/Public/VaRestJsonValue.h b/Source/VaRest/Public/VaRestJsonValue.h similarity index 97% rename from Source/VaRestPlugin/Public/VaRestJsonValue.h rename to Source/VaRest/Public/VaRestJsonValue.h index eed5f7ed..1d9ad0f3 100644 --- a/Source/VaRestPlugin/Public/VaRestJsonValue.h +++ b/Source/VaRest/Public/VaRestJsonValue.h @@ -2,7 +2,7 @@ #pragma once -#include "VaRestPluginDefines.h" +#include "VaRestDefines.h" #include "VaRestJsonValue.generated.h" @@ -28,7 +28,7 @@ enum class EVaJson : uint8 * Blueprintable FJsonValue wrapper */ UCLASS(BlueprintType, Blueprintable) -class VARESTPLUGIN_API UVaRestJsonValue : public UObject +class VAREST_API UVaRestJsonValue : public UObject { GENERATED_UCLASS_BODY() diff --git a/Source/VaRestPlugin/Public/VaRestLibrary.h b/Source/VaRest/Public/VaRestLibrary.h similarity index 96% rename from Source/VaRestPlugin/Public/VaRestLibrary.h rename to Source/VaRest/Public/VaRestLibrary.h index aa1fa0b7..30a95732 100644 --- a/Source/VaRestPlugin/Public/VaRestLibrary.h +++ b/Source/VaRest/Public/VaRestLibrary.h @@ -4,7 +4,7 @@ #include "Kismet/BlueprintFunctionLibrary.h" -#include "VaRestPluginDefines.h" +#include "VaRestDefines.h" #include "VaRestTypes.h" #include "VaRestLibrary.generated.h" @@ -42,7 +42,7 @@ struct FVaRestCallResponse * Useful tools for REST communications */ UCLASS() -class VARESTPLUGIN_API UVaRestLibrary : public UBlueprintFunctionLibrary +class VAREST_API UVaRestLibrary : public UBlueprintFunctionLibrary { GENERATED_BODY() diff --git a/Source/VaRestPlugin/Public/VaRestRequestController.h b/Source/VaRest/Public/VaRestRequestController.h similarity index 73% rename from Source/VaRestPlugin/Public/VaRestRequestController.h rename to Source/VaRest/Public/VaRestRequestController.h index 220b786d..04772c71 100644 --- a/Source/VaRestPlugin/Public/VaRestRequestController.h +++ b/Source/VaRest/Public/VaRestRequestController.h @@ -2,12 +2,12 @@ #pragma once -#include "VaRestPluginDefines.h" +#include "VaRestDefines.h" #include "VaRestRequestController.generated.h" UCLASS() -class VARESTPLUGIN_API UVaRestRequestController : public UObject +class VAREST_API UVaRestRequestController : public UObject { GENERATED_UCLASS_BODY() diff --git a/Source/VaRestPlugin/Public/VaRestRequestJSON.h b/Source/VaRest/Public/VaRestRequestJSON.h similarity index 99% rename from Source/VaRestPlugin/Public/VaRestRequestJSON.h rename to Source/VaRest/Public/VaRestRequestJSON.h index 09a9430c..24059f02 100644 --- a/Source/VaRestPlugin/Public/VaRestRequestJSON.h +++ b/Source/VaRest/Public/VaRestRequestJSON.h @@ -77,7 +77,7 @@ DECLARE_MULTICAST_DELEGATE_OneParam(FOnStaticRequestFail, class UVaRestRequestJS * General helper class http requests via blueprints */ UCLASS(BlueprintType, Blueprintable) -class VARESTPLUGIN_API UVaRestRequestJSON : public UObject +class VAREST_API UVaRestRequestJSON : public UObject { GENERATED_UCLASS_BODY() diff --git a/Source/VaRestPlugin/Public/VaRestSettings.h b/Source/VaRest/Public/VaRestSettings.h similarity index 86% rename from Source/VaRestPlugin/Public/VaRestSettings.h rename to Source/VaRest/Public/VaRestSettings.h index e39b6461..d246671b 100644 --- a/Source/VaRestPlugin/Public/VaRestSettings.h +++ b/Source/VaRest/Public/VaRestSettings.h @@ -5,7 +5,7 @@ #include "VaRestSettings.generated.h" UCLASS(config = Engine, defaultconfig) -class VARESTPLUGIN_API UVaRestSettings : public UObject +class VAREST_API UVaRestSettings : public UObject { GENERATED_UCLASS_BODY() diff --git a/Source/VaRestPlugin/Public/VaRestTypes.h b/Source/VaRest/Public/VaRestTypes.h similarity index 100% rename from Source/VaRestPlugin/Public/VaRestTypes.h rename to Source/VaRest/Public/VaRestTypes.h diff --git a/Source/VaRestPlugin/VaRestPlugin.Build.cs b/Source/VaRest/VaRest.Build.cs similarity index 79% rename from Source/VaRestPlugin/VaRestPlugin.Build.cs rename to Source/VaRest/VaRest.Build.cs index fc7dad22..30d13a99 100644 --- a/Source/VaRestPlugin/VaRestPlugin.Build.cs +++ b/Source/VaRest/VaRest.Build.cs @@ -4,15 +4,15 @@ namespace UnrealBuildTool.Rules { - public class VaRestPlugin : ModuleRules + public class VaRest : ModuleRules { - public VaRestPlugin(ReadOnlyTargetRules Target) : base(Target) + public VaRest(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; PrivateIncludePaths.AddRange( new string[] { - "VaRestPlugin/Private", + "VaRest/Private", // ... add other private include paths required here ... }); diff --git a/Source/VaRestEditorPlugin/Private/VaRestEditorPlugin.cpp b/Source/VaRestEditor/Private/VaRestEditor.cpp similarity index 57% rename from Source/VaRestEditorPlugin/Private/VaRestEditorPlugin.cpp rename to Source/VaRestEditor/Private/VaRestEditor.cpp index f751f58e..82d0973e 100644 --- a/Source/VaRestEditorPlugin/Private/VaRestEditorPlugin.cpp +++ b/Source/VaRestEditor/Private/VaRestEditor.cpp @@ -1,16 +1,15 @@ // Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. -// Original code by https://github.com/unktomi -#include "VaRestEditorPlugin.h" +#include "VaRestEditor.h" -#define LOCTEXT_NAMESPACE "FVaRestEditorPluginModule" +#define LOCTEXT_NAMESPACE "FVaRestEditorModule" -void FVaRestEditorPluginModule::StartupModule() +void FVaRestEditorModule::StartupModule() { // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module } -void FVaRestEditorPluginModule::ShutdownModule() +void FVaRestEditorModule::ShutdownModule() { // This function may be called during shutdown to clean up your module. For modules that support dynamic reloading, // we call this function before unloading the module. @@ -18,4 +17,4 @@ void FVaRestEditorPluginModule::ShutdownModule() #undef LOCTEXT_NAMESPACE -IMPLEMENT_MODULE(FVaRestEditorPluginModule, VaRestEditorPlugin) +IMPLEMENT_MODULE(FVaRestEditorModule, VaRestEditor) diff --git a/Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp b/Source/VaRestEditor/Private/VaRest_BreakJson.cpp similarity index 98% rename from Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp rename to Source/VaRestEditor/Private/VaRest_BreakJson.cpp index d489a2a2..f0d569d1 100644 --- a/Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp +++ b/Source/VaRestEditor/Private/VaRest_BreakJson.cpp @@ -39,7 +39,7 @@ class FKCHandler_BreakJson : public FNodeHandlingFunctor } UEdGraphPin* InNet = FEdGraphUtilities::GetNetFromPin(InputPin); - UClass* Class = Cast(StaticLoadObject(UClass::StaticClass(), NULL, TEXT("class'VaRestPlugin.VaRestJsonObject'"))); + UClass* Class = Cast(StaticLoadObject(UClass::StaticClass(), NULL, TEXT("class'VaRest.VaRestJsonObject'"))); FBPTerminal** SourceTerm = Context.NetMap.Find(InNet); if (SourceTerm == nullptr) @@ -194,7 +194,7 @@ void UVaRest_BreakJson::AllocateDefaultPins() { const UEdGraphSchema_K2* K2Schema = GetDefault(); - UClass* Class = Cast(StaticLoadObject(UClass::StaticClass(), NULL, TEXT("class'VaRestPlugin.VaRestJsonObject'"))); + UClass* Class = Cast(StaticLoadObject(UClass::StaticClass(), NULL, TEXT("class'VaRest.VaRestJsonObject'"))); UEdGraphPin* Pin = CreatePin(EGPD_Input, K2Schema->PC_Object, TEXT(""), Class, TEXT("Target")); #if ENGINE_MINOR_VERSION >= 17 @@ -262,7 +262,7 @@ FText UVaRest_BreakJson::GetMenuCategory() const void UVaRest_BreakJson::CreateProjectionPins(UEdGraphPin* Source) { const UEdGraphSchema_K2* K2Schema = GetDefault(); - UClass* Class = Cast(StaticLoadObject(UClass::StaticClass(), NULL, TEXT("class'VaRestPlugin.VaRestJsonObject'"))); + UClass* Class = Cast(StaticLoadObject(UClass::StaticClass(), NULL, TEXT("class'VaRest.VaRestJsonObject'"))); for (TArray::TIterator it(Outputs); it; ++it) { @@ -329,7 +329,7 @@ class FKCHandler_MakeJson : public FNodeHandlingFunctor } } - UClass* Class = Cast(StaticLoadObject(UClass::StaticClass(), NULL, TEXT("class'VaRestPlugin.VaRestJsonObject'"))); + UClass* Class = Cast(StaticLoadObject(UClass::StaticClass(), NULL, TEXT("class'VaRest.VaRestJsonObject'"))); FBPTerminal** TargetTerm = Context.NetMap.Find(OutputPin); if (TargetTerm == nullptr) @@ -485,7 +485,7 @@ void UVaRest_MakeJson::AllocateDefaultPins() { const UEdGraphSchema_K2* K2Schema = GetDefault(); - UClass* Class = Cast(StaticLoadObject(UClass::StaticClass(), NULL, TEXT("class'VaRestPlugin.VaRestJsonObject'"))); + UClass* Class = Cast(StaticLoadObject(UClass::StaticClass(), NULL, TEXT("class'VaRest.VaRestJsonObject'"))); UEdGraphPin* Pin = CreatePin(EGPD_Output, K2Schema->PC_Object, TEXT(""), Class, TEXT("Target")); #if ENGINE_MINOR_VERSION >= 17 @@ -553,7 +553,7 @@ FText UVaRest_MakeJson::GetMenuCategory() const void UVaRest_MakeJson::CreateProjectionPins(UEdGraphPin* Source) { const UEdGraphSchema_K2* K2Schema = GetDefault(); - UClass* Class = Cast(StaticLoadObject(UClass::StaticClass(), NULL, TEXT("class'VaRestPlugin.VaRestJsonObject'"))); + UClass* Class = Cast(StaticLoadObject(UClass::StaticClass(), NULL, TEXT("class'VaRest.VaRestJsonObject'"))); for (TArray::TIterator it(Inputs); it; ++it) { diff --git a/Source/VaRestEditorPlugin/Public/VaRestEditorPlugin.h b/Source/VaRestEditor/Public/VaRestEditor.h similarity index 70% rename from Source/VaRestEditorPlugin/Public/VaRestEditorPlugin.h rename to Source/VaRestEditor/Public/VaRestEditor.h index 1d586a74..a51c92c9 100644 --- a/Source/VaRestEditorPlugin/Public/VaRestEditorPlugin.h +++ b/Source/VaRestEditor/Public/VaRestEditor.h @@ -1,11 +1,10 @@ // Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved. -// Original code by https://github.com/unktomi #pragma once #include "Modules/ModuleManager.h" -class FVaRestEditorPluginModule : public IModuleInterface +class FVaRestEditorModule : public IModuleInterface { public: diff --git a/Source/VaRestEditorPlugin/Public/VaRest_BreakJson.h b/Source/VaRestEditor/Public/VaRest_BreakJson.h similarity index 95% rename from Source/VaRestEditorPlugin/Public/VaRest_BreakJson.h rename to Source/VaRestEditor/Public/VaRest_BreakJson.h index 07d5c813..dcdf51b5 100644 --- a/Source/VaRestEditorPlugin/Public/VaRest_BreakJson.h +++ b/Source/VaRestEditor/Public/VaRest_BreakJson.h @@ -40,7 +40,7 @@ struct FVaRest_NamedType }; UCLASS(BlueprintType, Blueprintable) -class VARESTEDITORPLUGIN_API UVaRest_MakeJson : public UK2Node +class VARESTEDITOR_API UVaRest_MakeJson : public UK2Node { GENERATED_UCLASS_BODY() @@ -69,7 +69,7 @@ class VARESTEDITORPLUGIN_API UVaRest_MakeJson : public UK2Node }; UCLASS(BlueprintType, Blueprintable) -class VARESTEDITORPLUGIN_API UVaRest_BreakJson : public UK2Node +class VARESTEDITOR_API UVaRest_BreakJson : public UK2Node { GENERATED_UCLASS_BODY() diff --git a/Source/VaRestEditorPlugin/VaRestEditorPlugin.Build.cs b/Source/VaRestEditor/VaRestEditor.Build.cs similarity index 87% rename from Source/VaRestEditorPlugin/VaRestEditorPlugin.Build.cs rename to Source/VaRestEditor/VaRestEditor.Build.cs index 40635d72..a12c78e7 100644 --- a/Source/VaRestEditorPlugin/VaRestEditorPlugin.Build.cs +++ b/Source/VaRestEditor/VaRestEditor.Build.cs @@ -2,15 +2,15 @@ using UnrealBuildTool; -public class VaRestEditorPlugin : ModuleRules +public class VaRestEditor : ModuleRules { - public VaRestEditorPlugin(ReadOnlyTargetRules Target) : base(Target) + public VaRestEditor(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; PrivateIncludePaths.AddRange( new string[] { - "VaRestEditorPlugin/Private", + "VaRestEditor/Private", // ... add other private include paths required here ... }); @@ -20,7 +20,7 @@ public VaRestEditorPlugin(ReadOnlyTargetRules Target) : base(Target) new string[] { "Core", - "VaRestPlugin" + "VaRest" // ... add other public dependencies that you statically link with here ... }); diff --git a/VaRestPlugin.uplugin b/VaRest.uplugin similarity index 75% rename from VaRestPlugin.uplugin rename to VaRest.uplugin index be5ac78b..30fcffff 100644 --- a/VaRestPlugin.uplugin +++ b/VaRest.uplugin @@ -2,10 +2,10 @@ "FileVersion" : 3, "FriendlyName" : "VaRest", - "Version" : 26, - "VersionName" : "1.1-r26", + "Version" : 27, + "VersionName" : "1.1-r27", "CreatedBy" : "Vladimir Alyamkin", - "CreatedByURL" : "http://alyamkin.com", + "CreatedByURL" : "https://alyamkin.com", "EngineVersion" : "4.23.0", "Description" : "Plugin that makes REST (JSON) server communication easy to use", "Category" : "Network", @@ -14,12 +14,12 @@ "Modules" : [ { - "Name" : "VaRestPlugin", + "Name" : "VaRest", "Type" : "Runtime", "LoadingPhase": "PreDefault" }, { - "Name": "VaRestEditorPlugin", + "Name": "VaRestEditor", "Type": "Developer" } ] From 40ccbad70458eef8f00e15654f1aa681c3d4e1c8 Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Fri, 1 Nov 2019 13:35:31 +0300 Subject: [PATCH 12/26] Fix clang-format #244 --- Source/VaRest/Private/VaRest.cpp | 2 +- Source/VaRest/Private/VaRestJsonObject.cpp | 2 +- Source/VaRest/Private/VaRestJsonValue.cpp | 2 +- Source/VaRest/Private/VaRestLibrary.cpp | 2 +- Source/VaRest/Private/VaRestRequestJSON.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/VaRest/Private/VaRest.cpp b/Source/VaRest/Private/VaRest.cpp index 50dd8310..4979b964 100644 --- a/Source/VaRest/Private/VaRest.cpp +++ b/Source/VaRest/Private/VaRest.cpp @@ -2,9 +2,9 @@ #include "VaRest.h" +#include "VaRestDefines.h" #include "VaRestJsonObject.h" #include "VaRestJsonValue.h" -#include "VaRestDefines.h" #include "VaRestRequestController.h" #include "VaRestRequestJSON.h" #include "VaRestSettings.h" diff --git a/Source/VaRest/Private/VaRestJsonObject.cpp b/Source/VaRest/Private/VaRestJsonObject.cpp index 849bd7e5..283f9b6d 100644 --- a/Source/VaRest/Private/VaRestJsonObject.cpp +++ b/Source/VaRest/Private/VaRestJsonObject.cpp @@ -2,9 +2,9 @@ #include "VaRestJsonObject.h" +#include "VaRestDefines.h" #include "VaRestJsonParser.h" #include "VaRestJsonValue.h" -#include "VaRestDefines.h" #include "Runtime/Launch/Resources/Version.h" diff --git a/Source/VaRest/Private/VaRestJsonValue.cpp b/Source/VaRest/Private/VaRestJsonValue.cpp index d9bd1ba8..3895ae09 100644 --- a/Source/VaRest/Private/VaRestJsonValue.cpp +++ b/Source/VaRest/Private/VaRestJsonValue.cpp @@ -2,8 +2,8 @@ #include "VaRestJsonValue.h" -#include "VaRestJsonObject.h" #include "VaRestDefines.h" +#include "VaRestJsonObject.h" UVaRestJsonValue::UVaRestJsonValue(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) diff --git a/Source/VaRest/Private/VaRestLibrary.cpp b/Source/VaRest/Private/VaRestLibrary.cpp index 9f39b662..8256892e 100644 --- a/Source/VaRest/Private/VaRestLibrary.cpp +++ b/Source/VaRest/Private/VaRestLibrary.cpp @@ -2,8 +2,8 @@ #include "VaRestLibrary.h" -#include "VaRestJsonObject.h" #include "VaRestDefines.h" +#include "VaRestJsonObject.h" #include "VaRestRequestJSON.h" #include "Misc/Base64.h" diff --git a/Source/VaRest/Private/VaRestRequestJSON.cpp b/Source/VaRest/Private/VaRestRequestJSON.cpp index 8459712f..922ef202 100644 --- a/Source/VaRest/Private/VaRestRequestJSON.cpp +++ b/Source/VaRest/Private/VaRestRequestJSON.cpp @@ -2,9 +2,9 @@ #include "VaRestRequestJSON.h" +#include "VaRestDefines.h" #include "VaRestJsonObject.h" #include "VaRestLibrary.h" -#include "VaRestDefines.h" #include "VaRestSettings.h" #include "Json.h" From f5ad2646f7ca46033189c9a2a26ec313eab7230c Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Fri, 1 Nov 2019 13:48:00 +0300 Subject: [PATCH 13/26] Update README.md Add Teamcity build status badge --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bb24764b..31879a01 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ -Overview -======== +# VaRest + + + + VaRest is the plugin for [Unreal Engine 4](https://www.unrealengine.com/) that makes REST server communications easier to use. From 032b068b21017570f07dfd923ea1871bbc6b0805 Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Fri, 1 Nov 2019 13:51:53 +0300 Subject: [PATCH 14/26] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 31879a01..d96da741 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # VaRest - - - +[![statusIcon](https://teamcity.ufna.dev/app/rest/builds/buildType:(id:UfnaDev_VaRest_ClangFormatCheck)/statusIcon.svg)](https://teamcity.ufna.dev/viewType.html?buildTypeId=UfnaDev_VaRest_ClangFormatCheck&guest=1) VaRest is the plugin for [Unreal Engine 4](https://www.unrealengine.com/) that makes REST server communications easier to use. From bae5cc6aa1ebd04e08b458f9fb5e04a9c66a8c97 Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Fri, 1 Nov 2019 14:02:48 +0300 Subject: [PATCH 15/26] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d96da741..2e6d2c74 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # VaRest -[![statusIcon](https://teamcity.ufna.dev/app/rest/builds/buildType:(id:UfnaDev_VaRest_ClangFormatCheck)/statusIcon.svg)](https://teamcity.ufna.dev/viewType.html?buildTypeId=UfnaDev_VaRest_ClangFormatCheck&guest=1) +[![statusIcon](https://teamcity.ufna.dev/app/rest/builds/buildType:(id:Pushkin_PsAndroidGamesSignIn_ClangFormatCheck)/statusIcon.svg)](https://teamcity.ufna.dev/viewType.html?buildTypeId=Pushkin_PsAndroidGamesSignIn_ClangFormatCheck&guest=1) VaRest is the plugin for [Unreal Engine 4](https://www.unrealengine.com/) that makes REST server communications easier to use. From 993a85d6cf0fbb9c427f76bbe5a7430ef2bd7283 Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Fri, 1 Nov 2019 14:03:11 +0300 Subject: [PATCH 16/26] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e6d2c74..d96da741 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # VaRest -[![statusIcon](https://teamcity.ufna.dev/app/rest/builds/buildType:(id:Pushkin_PsAndroidGamesSignIn_ClangFormatCheck)/statusIcon.svg)](https://teamcity.ufna.dev/viewType.html?buildTypeId=Pushkin_PsAndroidGamesSignIn_ClangFormatCheck&guest=1) +[![statusIcon](https://teamcity.ufna.dev/app/rest/builds/buildType:(id:UfnaDev_VaRest_ClangFormatCheck)/statusIcon.svg)](https://teamcity.ufna.dev/viewType.html?buildTypeId=UfnaDev_VaRest_ClangFormatCheck&guest=1) VaRest is the plugin for [Unreal Engine 4](https://www.unrealengine.com/) that makes REST server communications easier to use. From 73e9013268f44727119a0eb23e8703c45d1f26fd Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Fri, 1 Nov 2019 14:12:20 +0300 Subject: [PATCH 17/26] Refactor module class #244 --- Source/VaRest/Private/VaRest.cpp | 106 +++++++++++++++---------------- Source/VaRest/Public/VaRest.h | 15 ++--- 2 files changed, 58 insertions(+), 63 deletions(-) diff --git a/Source/VaRest/Private/VaRest.cpp b/Source/VaRest/Private/VaRest.cpp index 4979b964..283e9fb8 100644 --- a/Source/VaRest/Private/VaRest.cpp +++ b/Source/VaRest/Private/VaRest.cpp @@ -11,89 +11,85 @@ #include "Developer/Settings/Public/ISettingsModule.h" -#define LOCTEXT_NAMESPACE "VaRest" +#define LOCTEXT_NAMESPACE "FVaRestModule" -class FVaRest : public IVaRest +void FVaRestModule::StartupModule() { - /** IModuleInterface implementation */ - virtual void StartupModule() override - { - // @HACK Force classes to be compiled on shipping build - UVaRestJsonObject::StaticClass(); - UVaRestJsonValue::StaticClass(); - UVaRestRequestJSON::StaticClass(); + // @HACK Force classes to be compiled on shipping build + UVaRestJsonObject::StaticClass(); + UVaRestJsonValue::StaticClass(); + UVaRestRequestJSON::StaticClass(); - VaRestSettings = NewObject(GetTransientPackage(), "VaRestSettings", RF_Standalone); - VaRestSettings->AddToRoot(); + VaRestSettings = NewObject(GetTransientPackage(), "VaRestSettings", RF_Standalone); + VaRestSettings->AddToRoot(); - // Register settings - if (ISettingsModule* SettingsModule = FModuleManager::GetModulePtr("Settings")) - { - SettingsModule->RegisterSettings("Project", "Plugins", "VaRest", - LOCTEXT("RuntimeSettingsName", "VaRest"), - LOCTEXT("RuntimeSettingsDescription", "Configure VaRest plugin settings"), - VaRestSettings); - } + // Register settings + if (ISettingsModule* SettingsModule = FModuleManager::GetModulePtr("Settings")) + { + SettingsModule->RegisterSettings("Project", "Plugins", "VaRest", + LOCTEXT("RuntimeSettingsName", "VaRest"), + LOCTEXT("RuntimeSettingsDescription", "Configure VaRest plugin settings"), + VaRestSettings); + } - FWorldDelegates::OnWorldCleanup.AddLambda([this](UWorld* World, bool bSessionEnded, bool bCleanupResources) { - RequestControllers.Remove(World); + FWorldDelegates::OnWorldCleanup.AddLambda([this](UWorld* World, bool bSessionEnded, bool bCleanupResources) { + RequestControllers.Remove(World); - UE_LOG(LogVaRest, Log, TEXT("%s: Request Controller is removed for: %s"), *VA_FUNC_LINE, *World->GetName()); - }); + UE_LOG(LogVaRest, Log, TEXT("%s: Request Controller is removed for: %s"), *VA_FUNC_LINE, *World->GetName()); + }); - FWorldDelegates::OnPostWorldInitialization.AddLambda([this](UWorld* World, const UWorld::InitializationValues IVS) { - auto Controller = NewObject(GetTransientPackage()); - Controller->SetFlags(RF_Standalone); - Controller->AddToRoot(); + FWorldDelegates::OnPostWorldInitialization.AddLambda([this](UWorld* World, const UWorld::InitializationValues IVS) { + auto Controller = NewObject(GetTransientPackage()); + Controller->SetFlags(RF_Standalone); + Controller->AddToRoot(); - Controller->Initialize(); + Controller->Initialize(); - RequestControllers.Add(World, Controller); + RequestControllers.Add(World, Controller); - UE_LOG(LogVaRest, Log, TEXT("%s: Request Controller is created for: %s"), *VA_FUNC_LINE, *World->GetName()); - }); + UE_LOG(LogVaRest, Log, TEXT("%s: Request Controller is created for: %s"), *VA_FUNC_LINE, *World->GetName()); + }); - UE_LOG(LogVaRest, Log, TEXT("%s: VaRest module started"), *VA_FUNC_LINE); - } + UE_LOG(LogVaRest, Log, TEXT("%s: VaRest module started"), *VA_FUNC_LINE); +} - virtual void ShutdownModule() override +void FVaRestModule::ShutdownModule() +{ + if (ISettingsModule* SettingsModule = FModuleManager::GetModulePtr("Settings")) { - if (ISettingsModule* SettingsModule = FModuleManager::GetModulePtr("Settings")) - { - SettingsModule->UnregisterSettings("Project", "Plugins", "VaRest"); - } + SettingsModule->UnregisterSettings("Project", "Plugins", "VaRest"); + } - if (!GExitPurge) - { - VaRestSettings->RemoveFromRoot(); + if (!GExitPurge) + { + VaRestSettings->RemoveFromRoot(); - // If we're in exit purge, this object has already been destroyed - for (auto Controller : RequestControllers) - { - Controller.Value->RemoveFromRoot(); - } - } - else + // If we're in exit purge, this object has already been destroyed + for (auto Controller : RequestControllers) { - VaRestSettings = nullptr; + Controller.Value->RemoveFromRoot(); } - - RequestControllers.Empty(); } -}; + else + { + VaRestSettings = nullptr; + } + + RequestControllers.Empty(); +} -UVaRestSettings* IVaRest::GetSettings() const +UVaRestSettings* FVaRestModule::GetSettings() const { check(VaRestSettings); return VaRestSettings; } -UVaRestRequestController* IVaRest::GetRequestController(UWorld* World) const +UVaRestRequestController* FVaRestModule::GetRequestController(UWorld* World) const { return RequestControllers.FindChecked(World); } -IMPLEMENT_MODULE(FVaRest, VaRest) +IMPLEMENT_MODULE(FVaRestModule, VaRest) DEFINE_LOG_CATEGORY(LogVaRest); diff --git a/Source/VaRest/Public/VaRest.h b/Source/VaRest/Public/VaRest.h index cdad0357..9efb2ca2 100644 --- a/Source/VaRest/Public/VaRest.h +++ b/Source/VaRest/Public/VaRest.h @@ -7,23 +7,22 @@ class UVaRestRequestController; class UVaRestSettings; -/** - * The public interface to this module. In most cases, this interface is only public to sibling modules - * within this plugin. - */ -class IVaRest : public IModuleInterface +class FVaRestModule : public IModuleInterface { - public: + /** IModuleInterface implementation */ + virtual void StartupModule() override; + virtual void ShutdownModule() override; + /** * Singleton-like access to this module's interface. This is just for convenience! * Beware of calling this during the shutdown phase, though. Your module might have been unloaded already. * * @return Returns singleton instance, loading the module on demand if needed */ - static inline IVaRest& Get() + static inline FVaRestModule& Get() { - return FModuleManager::LoadModuleChecked("VaRest"); + return FModuleManager::LoadModuleChecked("VaRest"); } /** From afc73dfabb6a363f5d1d767746e8f3a8ec61ef07 Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Fri, 8 Nov 2019 08:53:25 +0300 Subject: [PATCH 18/26] Support UE 4.24 compilation and package #246 --- Source/VaRest/Private/VaRestJsonParser.cpp | 2 +- VaRest.uplugin | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/VaRest/Private/VaRestJsonParser.cpp b/Source/VaRest/Private/VaRestJsonParser.cpp index a3fe4b6c..b156ec5d 100644 --- a/Source/VaRest/Private/VaRestJsonParser.cpp +++ b/Source/VaRest/Private/VaRestJsonParser.cpp @@ -83,7 +83,7 @@ uint32 FUtf8Helper::CodepointFromUtf8(const ANSICHAR*& SourceString, const uint3 Codepoint = (((Octet << 12)) | ((Octet2 - 128) << 6) | ((Octet3 - 128))); // UTF-8 characters cannot be in the UTF-16 surrogates range - if (UE4StringConv_Private::IsHighSurrogate(Codepoint) || UE4StringConv_Private::IsLowSurrogate(Codepoint)) + if (StringConv::IsHighSurrogate(Codepoint) || StringConv::IsLowSurrogate(Codepoint)) { ++SourceString; // Sequence was not valid UTF-8. Skip the first byte and continue. return UNICODE_BOGUS_CHAR_CODEPOINT; diff --git a/VaRest.uplugin b/VaRest.uplugin index 30fcffff..f50fdb4a 100644 --- a/VaRest.uplugin +++ b/VaRest.uplugin @@ -20,7 +20,7 @@ }, { "Name": "VaRestEditor", - "Type": "Developer" + "Type": "UncookedOnly" } ] } \ No newline at end of file From 86ce8fd12d1f6c55b529e77c51f61dd8c534a535 Mon Sep 17 00:00:00 2001 From: Anton Grigorovich Date: Fri, 8 Nov 2019 23:15:04 +0700 Subject: [PATCH 19/26] Update VaRest.uplugin Additional small change for non-cpp project. Without that fix non-cpp project never would opened as compiled plugin - need to be recompiled manually (in cpp project, with xcode etc.) PS: tested on iOS as packaged 'development', 'shipping' from non-cpp project. --- VaRest.uplugin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VaRest.uplugin b/VaRest.uplugin index f50fdb4a..4ad50f91 100644 --- a/VaRest.uplugin +++ b/VaRest.uplugin @@ -6,7 +6,7 @@ "VersionName" : "1.1-r27", "CreatedBy" : "Vladimir Alyamkin", "CreatedByURL" : "https://alyamkin.com", - "EngineVersion" : "4.23.0", + "EngineVersion" : "4.24.0", "Description" : "Plugin that makes REST (JSON) server communication easy to use", "Category" : "Network", "MarketplaceURL" : "com.epicgames.launcher://ue/marketplace/content/e47be161e7a24e928560290abd5dcc4f", From 9033185d5c7e9a80d3089ff740c4a834999be01f Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Wed, 11 Dec 2019 13:17:48 +0300 Subject: [PATCH 20/26] Place defines to right category --- Source/VaRest/{Private => Public}/VaRestDefines.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Source/VaRest/{Private => Public}/VaRestDefines.h (100%) diff --git a/Source/VaRest/Private/VaRestDefines.h b/Source/VaRest/Public/VaRestDefines.h similarity index 100% rename from Source/VaRest/Private/VaRestDefines.h rename to Source/VaRest/Public/VaRestDefines.h From feac88c21dbf0cef2a1945ed9a78a763f25187b8 Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Thu, 12 Dec 2019 08:30:16 +0300 Subject: [PATCH 21/26] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d96da741..b13aa22d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ -# VaRest - [![statusIcon](https://teamcity.ufna.dev/app/rest/builds/buildType:(id:UfnaDev_VaRest_ClangFormatCheck)/statusIcon.svg)](https://teamcity.ufna.dev/viewType.html?buildTypeId=UfnaDev_VaRest_ClangFormatCheck&guest=1) +![GitHub](https://img.shields.io/github/license/ufna/VaRest) +![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/ufna/VaRest?include_prereleases) + +# VaRest VaRest is the plugin for [Unreal Engine 4](https://www.unrealengine.com/) that makes REST server communications easier to use. From 42d981343374f40fc899f11ac217323df2e73c3b Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Fri, 13 Dec 2019 15:08:28 +0300 Subject: [PATCH 22/26] Add class redirectors #249 --- Config/BaseVaRest.ini | 11 +++++++++++ Config/DefaultVaRest.ini | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 Config/BaseVaRest.ini create mode 100644 Config/DefaultVaRest.ini diff --git a/Config/BaseVaRest.ini b/Config/BaseVaRest.ini new file mode 100644 index 00000000..0e0f8fde --- /dev/null +++ b/Config/BaseVaRest.ini @@ -0,0 +1,11 @@ +[CoreRedirects] ++PackageRedirects=(OldName="/VaRestPlugin/", NewName="/VaRest/", MatchSubstring=true) ++ClassRedirects=(OldName="/Script/VaRestPlugin.VaRestJsonObject",NewName="/Script/VaRest.VaRestJsonObject") ++ClassRedirects=(OldName="/Script/VaRestPlugin.VaRestJsonValue",NewName="/Script/VaRest.VaRestJsonValue") ++ClassRedirects=(OldName="/Script/VaRestPlugin.VaRestLibrary",NewName="/Script/VaRest.VaRestLibrary") ++ClassRedirects=(OldName="/Script/VaRestPlugin.VaRestRequestJSON",NewName="/Script/VaRest.VaRestRequestJSON") ++StructRedirects=(OldName="/Script/VaRestPlugin.VaRestCallResponse",NewName="/Script/VaRest.VaRestCallResponse") ++EnumRedirects=(OldName="/Script/VaRestPlugin.EVaJson",NewName="/Script/VaRest.EVaJson") ++EnumRedirects=(OldName="/Script/VaRestPlugin.ERequestVerb",NewName="/Script/VaRest.ERequestVerb") ++EnumRedirects=(OldName="/Script/VaRestPlugin.ERequestContentType",NewName="/Script/VaRest.ERequestContentType") ++EnumRedirects=(OldName="/Script/VaRestPlugin.ERequestStatus",NewName="/Script/VaRest.ERequestStatus") diff --git a/Config/DefaultVaRest.ini b/Config/DefaultVaRest.ini new file mode 100644 index 00000000..0e0f8fde --- /dev/null +++ b/Config/DefaultVaRest.ini @@ -0,0 +1,11 @@ +[CoreRedirects] ++PackageRedirects=(OldName="/VaRestPlugin/", NewName="/VaRest/", MatchSubstring=true) ++ClassRedirects=(OldName="/Script/VaRestPlugin.VaRestJsonObject",NewName="/Script/VaRest.VaRestJsonObject") ++ClassRedirects=(OldName="/Script/VaRestPlugin.VaRestJsonValue",NewName="/Script/VaRest.VaRestJsonValue") ++ClassRedirects=(OldName="/Script/VaRestPlugin.VaRestLibrary",NewName="/Script/VaRest.VaRestLibrary") ++ClassRedirects=(OldName="/Script/VaRestPlugin.VaRestRequestJSON",NewName="/Script/VaRest.VaRestRequestJSON") ++StructRedirects=(OldName="/Script/VaRestPlugin.VaRestCallResponse",NewName="/Script/VaRest.VaRestCallResponse") ++EnumRedirects=(OldName="/Script/VaRestPlugin.EVaJson",NewName="/Script/VaRest.EVaJson") ++EnumRedirects=(OldName="/Script/VaRestPlugin.ERequestVerb",NewName="/Script/VaRest.ERequestVerb") ++EnumRedirects=(OldName="/Script/VaRestPlugin.ERequestContentType",NewName="/Script/VaRest.ERequestContentType") ++EnumRedirects=(OldName="/Script/VaRestPlugin.ERequestStatus",NewName="/Script/VaRest.ERequestStatus") From b8f6f6df898b19d13909d6d44d566c6dd9daa93c Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Fri, 13 Dec 2019 20:06:45 +0300 Subject: [PATCH 23/26] Make Getters pure for BPs #229 --- Source/VaRest/Private/VaRestRequestJSON.cpp | 14 +++++++------- Source/VaRest/Public/VaRestRequestJSON.h | 16 ++++++++-------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Source/VaRest/Private/VaRestRequestJSON.cpp b/Source/VaRest/Private/VaRestRequestJSON.cpp index 922ef202..c6876211 100644 --- a/Source/VaRest/Private/VaRestRequestJSON.cpp +++ b/Source/VaRest/Private/VaRestRequestJSON.cpp @@ -146,7 +146,7 @@ void UVaRestRequestJSON::Cancel() ////////////////////////////////////////////////////////////////////////// // JSON data accessors -UVaRestJsonObject* UVaRestRequestJSON::GetRequestObject() +UVaRestJsonObject* UVaRestRequestJSON::GetRequestObject() const { return RequestJsonObj; } @@ -156,7 +156,7 @@ void UVaRestRequestJSON::SetRequestObject(UVaRestJsonObject* JsonObject) RequestJsonObj = JsonObject; } -UVaRestJsonObject* UVaRestRequestJSON::GetResponseObject() +UVaRestJsonObject* UVaRestRequestJSON::GetResponseObject() const { return ResponseJsonObj; } @@ -169,22 +169,22 @@ void UVaRestRequestJSON::SetResponseObject(UVaRestJsonObject* JsonObject) /////////////////////////////////////////////////////////////////////////// // Response data access -FString UVaRestRequestJSON::GetURL() +FString UVaRestRequestJSON::GetURL() const { return HttpRequest->GetURL(); } -ERequestStatus UVaRestRequestJSON::GetStatus() +ERequestStatus UVaRestRequestJSON::GetStatus() const { return ERequestStatus((uint8)HttpRequest->GetStatus()); } -int32 UVaRestRequestJSON::GetResponseCode() +int32 UVaRestRequestJSON::GetResponseCode() const { return ResponseCode; } -FString UVaRestRequestJSON::GetResponseHeader(const FString HeaderName) +FString UVaRestRequestJSON::GetResponseHeader(const FString& HeaderName) { FString Result; @@ -197,7 +197,7 @@ FString UVaRestRequestJSON::GetResponseHeader(const FString HeaderName) return Result; } -TArray UVaRestRequestJSON::GetAllResponseHeaders() +TArray UVaRestRequestJSON::GetAllResponseHeaders() const { TArray Result; for (TMap::TConstIterator It(ResponseHeaders); It; ++It) diff --git a/Source/VaRest/Public/VaRestRequestJSON.h b/Source/VaRest/Public/VaRestRequestJSON.h index 24059f02..ff7a0b42 100644 --- a/Source/VaRest/Public/VaRestRequestJSON.h +++ b/Source/VaRest/Public/VaRestRequestJSON.h @@ -146,7 +146,7 @@ class VAREST_API UVaRestRequestJSON : public UObject /** Get the Request Json object */ UFUNCTION(BlueprintCallable, Category = "VaRest|Request") - UVaRestJsonObject* GetRequestObject(); + UVaRestJsonObject* GetRequestObject() const; /** Set the Request Json object */ UFUNCTION(BlueprintCallable, Category = "VaRest|Request") @@ -154,7 +154,7 @@ class VAREST_API UVaRestRequestJSON : public UObject /** Get the Response Json object */ UFUNCTION(BlueprintCallable, Category = "VaRest|Response") - UVaRestJsonObject* GetResponseObject(); + UVaRestJsonObject* GetResponseObject() const; /** Set the Response Json object */ UFUNCTION(BlueprintCallable, Category = "VaRest|Response") @@ -165,23 +165,23 @@ class VAREST_API UVaRestRequestJSON : public UObject /** Get url of http request */ UFUNCTION(BlueprintCallable, Category = "VaRest|Request") - FString GetURL(); + FString GetURL() const; /** Get status of http request */ UFUNCTION(BlueprintCallable, Category = "VaRest|Request") - ERequestStatus GetStatus(); + ERequestStatus GetStatus() const; /** Get the response code of the last query */ UFUNCTION(BlueprintCallable, Category = "VaRest|Response") - int32 GetResponseCode(); + int32 GetResponseCode() const; /** Get value of desired response header */ - UFUNCTION(BlueprintCallable, Category = "VaRest|Response") - FString GetResponseHeader(const FString HeaderName); + UFUNCTION(BlueprintPure, Category = "VaRest|Response") + FString GetResponseHeader(const FString& HeaderName); /** Get list of all response headers */ UFUNCTION(BlueprintCallable, Category = "VaRest|Response") - TArray GetAllResponseHeaders(); + TArray GetAllResponseHeaders() const; ////////////////////////////////////////////////////////////////////////// // URL processing From fd6feb5bec56a7677df7c236853702a4265734ee Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Fri, 13 Dec 2019 20:16:57 +0300 Subject: [PATCH 24/26] Multiple defination of "ConstructJsonValue". Close #248. Close #231 --- Config/BaseVaRest.ini | 3 +++ Config/DefaultVaRest.ini | 3 +++ Source/VaRest/Private/VaRestJsonObject.cpp | 2 +- Source/VaRest/Private/VaRestLibrary.cpp | 2 +- Source/VaRest/Private/VaRestRequestJSON.cpp | 6 +++--- Source/VaRest/Public/VaRestJsonObject.h | 2 +- Source/VaRest/Public/VaRestRequestJSON.h | 4 ++-- 7 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Config/BaseVaRest.ini b/Config/BaseVaRest.ini index 0e0f8fde..22766973 100644 --- a/Config/BaseVaRest.ini +++ b/Config/BaseVaRest.ini @@ -9,3 +9,6 @@ +EnumRedirects=(OldName="/Script/VaRestPlugin.ERequestVerb",NewName="/Script/VaRest.ERequestVerb") +EnumRedirects=(OldName="/Script/VaRestPlugin.ERequestContentType",NewName="/Script/VaRest.ERequestContentType") +EnumRedirects=(OldName="/Script/VaRestPlugin.ERequestStatus",NewName="/Script/VaRest.ERequestStatus") ++FunctionRedirects=(OldName="VaRestRequestJSON.ConstructRequest",NewName="VaRestRequestJSON.ConstructVaRestRequest") ++FunctionRedirects=(OldName="VaRestRequestJSON.ConstructRequestExt",NewName="VaRestRequestJSON.ConstructVaRestRequestExt") ++FunctionRedirects=(OldName="VaRestJsonObject.ConstructJsonObject",NewName="VaRestJsonObject.ConstructVaRestJsonObject") diff --git a/Config/DefaultVaRest.ini b/Config/DefaultVaRest.ini index 0e0f8fde..22766973 100644 --- a/Config/DefaultVaRest.ini +++ b/Config/DefaultVaRest.ini @@ -9,3 +9,6 @@ +EnumRedirects=(OldName="/Script/VaRestPlugin.ERequestVerb",NewName="/Script/VaRest.ERequestVerb") +EnumRedirects=(OldName="/Script/VaRestPlugin.ERequestContentType",NewName="/Script/VaRest.ERequestContentType") +EnumRedirects=(OldName="/Script/VaRestPlugin.ERequestStatus",NewName="/Script/VaRest.ERequestStatus") ++FunctionRedirects=(OldName="VaRestRequestJSON.ConstructRequest",NewName="VaRestRequestJSON.ConstructVaRestRequest") ++FunctionRedirects=(OldName="VaRestRequestJSON.ConstructRequestExt",NewName="VaRestRequestJSON.ConstructVaRestRequestExt") ++FunctionRedirects=(OldName="VaRestJsonObject.ConstructJsonObject",NewName="VaRestJsonObject.ConstructVaRestJsonObject") diff --git a/Source/VaRest/Private/VaRestJsonObject.cpp b/Source/VaRest/Private/VaRestJsonObject.cpp index 283f9b6d..495592b2 100644 --- a/Source/VaRest/Private/VaRestJsonObject.cpp +++ b/Source/VaRest/Private/VaRestJsonObject.cpp @@ -17,7 +17,7 @@ UVaRestJsonObject::UVaRestJsonObject(const FObjectInitializer& ObjectInitializer { } -UVaRestJsonObject* UVaRestJsonObject::ConstructJsonObject(UObject* WorldContextObject) +UVaRestJsonObject* UVaRestJsonObject::ConstructVaRestJsonObject(UObject* WorldContextObject) { return NewObject(); } diff --git a/Source/VaRest/Private/VaRestLibrary.cpp b/Source/VaRest/Private/VaRestLibrary.cpp index 8256892e..6dd20605 100644 --- a/Source/VaRest/Private/VaRestLibrary.cpp +++ b/Source/VaRest/Private/VaRestLibrary.cpp @@ -49,7 +49,7 @@ bool UVaRestLibrary::Base64DecodeData(const FString& Source, TArray& Dest class UVaRestJsonObject* UVaRestLibrary::LoadJsonFromFile(UObject* WorldContextObject, const FString& Path, const bool bIsRelativeToContentDir) { - UVaRestJsonObject* Json = UVaRestJsonObject::ConstructJsonObject(WorldContextObject); + UVaRestJsonObject* Json = UVaRestJsonObject::ConstructVaRestJsonObject(WorldContextObject); FString JSONString; if (FFileHelper::LoadFileToString(JSONString, *(bIsRelativeToContentDir ? FPaths::ProjectContentDir() / Path : Path))) diff --git a/Source/VaRest/Private/VaRestRequestJSON.cpp b/Source/VaRest/Private/VaRestRequestJSON.cpp index c6876211..80b646b4 100644 --- a/Source/VaRest/Private/VaRestRequestJSON.cpp +++ b/Source/VaRest/Private/VaRestRequestJSON.cpp @@ -35,17 +35,17 @@ UVaRestRequestJSON::UVaRestRequestJSON(const class FObjectInitializer& PCIP) ResetData(); } -UVaRestRequestJSON* UVaRestRequestJSON::ConstructRequest(UObject* WorldContextObject) +UVaRestRequestJSON* UVaRestRequestJSON::ConstructVaRestRequest(UObject* WorldContextObject) { return NewObject(); } -UVaRestRequestJSON* UVaRestRequestJSON::ConstructRequestExt( +UVaRestRequestJSON* UVaRestRequestJSON::ConstructVaRestRequestExt( UObject* WorldContextObject, ERequestVerb Verb, ERequestContentType ContentType) { - UVaRestRequestJSON* Request = ConstructRequest(WorldContextObject); + UVaRestRequestJSON* Request = ConstructVaRestRequest(WorldContextObject); Request->SetVerb(Verb); Request->SetContentType(ContentType); diff --git a/Source/VaRest/Public/VaRestJsonObject.h b/Source/VaRest/Public/VaRestJsonObject.h index 1bfff3d8..f1b78817 100644 --- a/Source/VaRest/Public/VaRestJsonObject.h +++ b/Source/VaRest/Public/VaRestJsonObject.h @@ -18,7 +18,7 @@ class VAREST_API UVaRestJsonObject : public UObject /** Create new Json object */ UFUNCTION(BlueprintCallable, meta = (DisplayName = "Construct Json Object", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "VaRest|Json") - static UVaRestJsonObject* ConstructJsonObject(UObject* WorldContextObject); + static UVaRestJsonObject* ConstructVaRestJsonObject(UObject* WorldContextObject); /** Reset all internal data */ UFUNCTION(BlueprintCallable, Category = "VaRest|Json") diff --git a/Source/VaRest/Public/VaRestRequestJSON.h b/Source/VaRest/Public/VaRestRequestJSON.h index ff7a0b42..2f2eb2f0 100644 --- a/Source/VaRest/Public/VaRestRequestJSON.h +++ b/Source/VaRest/Public/VaRestRequestJSON.h @@ -87,11 +87,11 @@ class VAREST_API UVaRestRequestJSON : public UObject /** Creates new request (totally empty) */ UFUNCTION(BlueprintCallable, meta = (DisplayName = "Construct Json Request (Empty)", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "VaRest|Request") - static UVaRestRequestJSON* ConstructRequest(UObject* WorldContextObject); + static UVaRestRequestJSON* ConstructVaRestRequest(UObject* WorldContextObject); /** Creates new request with defined verb and content type */ UFUNCTION(BlueprintCallable, meta = (DisplayName = "Construct Json Request", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "VaRest|Request") - static UVaRestRequestJSON* ConstructRequestExt(UObject* WorldContextObject, ERequestVerb Verb, ERequestContentType ContentType); + static UVaRestRequestJSON* ConstructVaRestRequestExt(UObject* WorldContextObject, ERequestVerb Verb, ERequestContentType ContentType); /** Set verb to the request */ UFUNCTION(BlueprintCallable, Category = "VaRest|Request") From 73f5953acb4e35d56635899fe5ca1910ad644f5c Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Sat, 14 Dec 2019 14:03:04 +0300 Subject: [PATCH 25/26] Fix make Json node #249 --- Source/VaRestEditor/Private/VaRest_BreakJson.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/VaRestEditor/Private/VaRest_BreakJson.cpp b/Source/VaRestEditor/Private/VaRest_BreakJson.cpp index f0d569d1..b61f76af 100644 --- a/Source/VaRestEditor/Private/VaRest_BreakJson.cpp +++ b/Source/VaRestEditor/Private/VaRest_BreakJson.cpp @@ -337,7 +337,7 @@ class FKCHandler_MakeJson : public FNodeHandlingFunctor return; } { - FName FunctionName = TEXT("ConstructJsonObject"); + FName FunctionName = TEXT("ConstructVaRestJsonObject"); UFunction* FunctionPtr = Class->FindFunctionByName(FunctionName); FBlueprintCompiledStatement& Statement = Context.AppendStatementForNode(Node); Statement.Type = KCST_CallFunction; From 8b469fb18e319497b86377192d36bcab38d53337 Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Thu, 9 Jan 2020 22:59:49 +0300 Subject: [PATCH 26/26] Add empty FilterPlugin.ini for marketplace distribution --- Config/FilterPlugin.ini | 1 + 1 file changed, 1 insertion(+) create mode 100644 Config/FilterPlugin.ini diff --git a/Config/FilterPlugin.ini b/Config/FilterPlugin.ini new file mode 100644 index 00000000..bb30259b --- /dev/null +++ b/Config/FilterPlugin.ini @@ -0,0 +1 @@ +[FilterPlugin]