4 Commits

Author SHA1 Message Date
Georgy Treshchev 1a8e141d65 minor basic changes 2021-03-04 08:32:21 +01:00
Georgy Treshchev e2db0d1f99 4.26.1 update 2021-02-23 16:42:49 +01:00
Georgy Treshchev 2d79563699 Change date 2021-02-19 10:11:38 +01:00
Respirant 4d3dbd0774 Fix content-length zero error 2021-01-08 21:13:57 +03:00
4 changed files with 9 additions and 27 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2020 Respirant Copyright (c) 2021 Respirant
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -31,7 +31,6 @@
"BlacklistPlatforms": [ "BlacklistPlatforms": [
"XboxOne", "XboxOne",
"PS4", "PS4",
"HTML5",
"TVOS", "TVOS",
"Switch" "Switch"
] ]
@@ -3,22 +3,6 @@
#include "RuntimeFilesDownloaderLibrary.h" #include "RuntimeFilesDownloaderLibrary.h"
#include "RuntimeFilesDownloader.h" #include "RuntimeFilesDownloader.h"
URuntimeFilesDownloaderLibrary::URuntimeFilesDownloaderLibrary(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
URuntimeFilesDownloaderLibrary::URuntimeFilesDownloaderLibrary() :
FileUrl(TEXT(""))
, FileSavePath(TEXT(""))
{
}
URuntimeFilesDownloaderLibrary::~URuntimeFilesDownloaderLibrary()
{
}
URuntimeFilesDownloaderLibrary* URuntimeFilesDownloaderLibrary::CreateDownloader() URuntimeFilesDownloaderLibrary* URuntimeFilesDownloaderLibrary::CreateDownloader()
{ {
URuntimeFilesDownloaderLibrary* Downloader = NewObject<URuntimeFilesDownloaderLibrary>(); URuntimeFilesDownloaderLibrary* Downloader = NewObject<URuntimeFilesDownloaderLibrary>();
@@ -46,8 +30,12 @@ URuntimeFilesDownloaderLibrary* URuntimeFilesDownloaderLibrary::DownloadFile(con
void URuntimeFilesDownloaderLibrary::OnProgress_Internal(FHttpRequestPtr Request, int32 BytesSent, int32 BytesReceived) void URuntimeFilesDownloaderLibrary::OnProgress_Internal(FHttpRequestPtr Request, int32 BytesSent, int32 BytesReceived)
{ {
int32 FullSize = Request->GetContentLength(); FHttpResponsePtr Response = Request->GetResponse();
OnProgress.Broadcast(BytesSent, BytesReceived, FullSize); if (Response.IsValid())
{
int32 FullSize = Response->GetContentLength();
OnProgress.Broadcast(BytesSent, BytesReceived, FullSize);
}
} }
void URuntimeFilesDownloaderLibrary::OnReady_Internal(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) void URuntimeFilesDownloaderLibrary::OnReady_Internal(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful)
@@ -5,6 +5,7 @@
#include "Http.h" #include "Http.h"
#include "Misc/Paths.h" #include "Misc/Paths.h"
#include "HAL/PlatformFilemanager.h" #include "HAL/PlatformFilemanager.h"
#include "GenericPlatform/GenericPlatformFile.h"
#include "RuntimeFilesDownloaderLibrary.generated.h" #include "RuntimeFilesDownloaderLibrary.generated.h"
/** /**
@@ -32,7 +33,7 @@ DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnResult, TEnumAsByte < DownloadRes
UCLASS(BlueprintType, Category = "RuntimeFilesDownloader") UCLASS(BlueprintType, Category = "RuntimeFilesDownloader")
class RUNTIMEFILESDOWNLOADER_API URuntimeFilesDownloaderLibrary : public UObject class RUNTIMEFILESDOWNLOADER_API URuntimeFilesDownloaderLibrary : public UObject
{ {
GENERATED_UCLASS_BODY() GENERATED_BODY()
public: public:
/** /**
@@ -59,12 +60,6 @@ public:
UPROPERTY(BlueprintReadOnly, Category = "RuntimeFilesDownloader") UPROPERTY(BlueprintReadOnly, Category = "RuntimeFilesDownloader")
FString FileSavePath; FString FileSavePath;
/**
* Basic class methods
*/
URuntimeFilesDownloaderLibrary();
~URuntimeFilesDownloaderLibrary();
/** /**
* Instantiates a FileDownloader object, starts downloading and saves it when done. * Instantiates a FileDownloader object, starts downloading and saves it when done.
* *