From bf89b746853fc89852569fbb277ab8bebf614b58 Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Thu, 4 Aug 2016 23:01:49 +0300 Subject: [PATCH 1/5] Fix templates build error --- Source/VaRestPlugin/Classes/VaRestRequestJSON.h | 9 --------- Source/VaRestPlugin/Private/VaRestRequestJSON.cpp | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/VaRestPlugin/Classes/VaRestRequestJSON.h b/Source/VaRestPlugin/Classes/VaRestRequestJSON.h index f789f82d..035f96a3 100644 --- a/Source/VaRestPlugin/Classes/VaRestRequestJSON.h +++ b/Source/VaRestPlugin/Classes/VaRestRequestJSON.h @@ -65,15 +65,6 @@ template class FVaRestLatentAction : public FPendingLatentAction T &Result; }; -template void FVaRestLatentAction::Cancel() -{ - UObject *Obj = Request.Get(); - if (Obj != nullptr) - { - ((UVaRestRequestJSON*)Obj)->Cancel(); - } -} - /** Generate a delegates for callback events */ DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnRequestComplete, class UVaRestRequestJSON*, Request); diff --git a/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp b/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp index 9437c847..e91f458e 100644 --- a/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp +++ b/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp @@ -3,6 +3,15 @@ #include "VaRestPluginPrivatePCH.h" #include "CoreMisc.h" +template void FVaRestLatentAction::Cancel() +{ + UObject *Obj = Request.Get(); + if (Obj != nullptr) + { + ((UVaRestRequestJSON*)Obj)->Cancel(); + } +} + UVaRestRequestJSON::UVaRestRequestJSON(const class FObjectInitializer& PCIP) : Super(PCIP), BinaryContentType(TEXT("application/octet-stream")) From c846a3ff3489c6450e9f5eec3abc83852be51c33 Mon Sep 17 00:00:00 2001 From: "v.alyamkin" Date: Fri, 5 Aug 2016 11:38:32 +0300 Subject: [PATCH 2/5] Fix response crash --- Source/VaRestPlugin/Private/VaRestRequestJSON.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp b/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp index e91f458e..4e4867fe 100644 --- a/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp +++ b/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp @@ -359,11 +359,8 @@ void UVaRestRequestJSON::OnProcessRequestComplete(FHttpRequestPtr Request, FHttp // Be sure that we have no data from previous response ResetResponseData(); - // Save response code first as int32 - ResponseCode = Response->GetResponseCode(); - // Check we have result to process futher - if (!bWasSuccessful) + if (!bWasSuccessful || !Response.IsValid()) { UE_LOG(LogVaRest, Error, TEXT("Request failed (%d): %s"), ResponseCode, *Request->GetURL()); @@ -374,6 +371,9 @@ void UVaRestRequestJSON::OnProcessRequestComplete(FHttpRequestPtr Request, FHttp return; } + // Save response code first as int32 + ResponseCode = Response->GetResponseCode(); + // Save response data as a string ResponseContent = Response->GetContentAsString(); From 5c210edb96f1a915937eabdd224575e9a34b8ed7 Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Fri, 5 Aug 2016 23:06:04 +0300 Subject: [PATCH 3/5] Save response code only for valid response --- Source/VaRestPlugin/Private/VaRestRequestJSON.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp b/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp index 4e4867fe..6dac20d7 100644 --- a/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp +++ b/Source/VaRestPlugin/Private/VaRestRequestJSON.cpp @@ -359,6 +359,12 @@ void UVaRestRequestJSON::OnProcessRequestComplete(FHttpRequestPtr Request, FHttp // Be sure that we have no data from previous response ResetResponseData(); + // Check we have a response and save response code as int32 + if(Response.IsValid()) + { + ResponseCode = Response->GetResponseCode(); + } + // Check we have result to process futher if (!bWasSuccessful || !Response.IsValid()) { @@ -371,9 +377,6 @@ void UVaRestRequestJSON::OnProcessRequestComplete(FHttpRequestPtr Request, FHttp return; } - // Save response code first as int32 - ResponseCode = Response->GetResponseCode(); - // Save response data as a string ResponseContent = Response->GetContentAsString(); From cbc7bfbc277938974738109370cd684ba1150f89 Mon Sep 17 00:00:00 2001 From: Vladimir Alyamkin Date: Fri, 5 Aug 2016 23:31:00 +0300 Subject: [PATCH 4/5] Fix marketplace URL --- VaRestPlugin.uplugin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VaRestPlugin.uplugin b/VaRestPlugin.uplugin index a3e1b0f1..73bb010f 100644 --- a/VaRestPlugin.uplugin +++ b/VaRestPlugin.uplugin @@ -9,7 +9,7 @@ "EngineVersion" : "4.11.0", "Description" : "Plugin that makes REST (JSON) server communication easy to use", "Category" : "Network", - "MarketplaceURL" : "com.epicgames.launcher://ue/marketplace/offers/e47be161e7a24e928560290abd5dcc4f", + "MarketplaceURL" : "com.epicgames.launcher://ue/marketplace/content/e47be161e7a24e928560290abd5dcc4f", "Modules" : [ From f5d0b70981961d502091528426c55d72c0872ce9 Mon Sep 17 00:00:00 2001 From: "v.alyamkin" Date: Sun, 7 Aug 2016 14:31:09 +0300 Subject: [PATCH 5/5] Update version to release: 1.1 R 15 --- VaRestPlugin.uplugin | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VaRestPlugin.uplugin b/VaRestPlugin.uplugin index 73bb010f..b25a89c4 100644 --- a/VaRestPlugin.uplugin +++ b/VaRestPlugin.uplugin @@ -2,8 +2,8 @@ "FileVersion" : 3, "FriendlyName" : "VaRest", - "Version" : 14, - "VersionName" : "1.1-r14", + "Version" : 15, + "VersionName" : "1.1-r15", "CreatedBy" : "Vladimir Alyamkin", "CreatedByURL" : "http://alyamkin.com", "EngineVersion" : "4.11.0",