Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
Finish v1.1-r15
Browse files Browse the repository at this point in the history
  • Loading branch information
ufna committed Aug 7, 2016
2 parents 17b1ca9 + f5d0b70 commit ad9ae47
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
9 changes: 0 additions & 9 deletions Source/VaRestPlugin/Classes/VaRestRequestJSON.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,6 @@ template <class T> class FVaRestLatentAction : public FPendingLatentAction
T &Result;
};

template <class T> void FVaRestLatentAction<T>::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);
Expand Down
18 changes: 15 additions & 3 deletions Source/VaRestPlugin/Private/VaRestRequestJSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
#include "VaRestPluginPrivatePCH.h"
#include "CoreMisc.h"

template <class T> void FVaRestLatentAction<T>::Cancel()
{
UObject *Obj = Request.Get();
if (Obj != nullptr)
{
((UVaRestRequestJSON*)Obj)->Cancel();
}
}

UVaRestRequestJSON::UVaRestRequestJSON(const class FObjectInitializer& PCIP)
: Super(PCIP),
BinaryContentType(TEXT("application/octet-stream"))
Expand Down Expand Up @@ -350,11 +359,14 @@ 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 a response and save response code as int32
if(Response.IsValid())
{
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());

Expand Down
6 changes: 3 additions & 3 deletions VaRestPlugin.uplugin
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"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",
"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" :
[
Expand Down

0 comments on commit ad9ae47

Please sign in to comment.