mirror of
https://github.com/storytold/RuntimeFilesDownloader.git
synced 2026-10-09 00:09:42 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1a8e141d65 | |||
| e2db0d1f99 | |||
| 2d79563699 | |||
| 4d3dbd0774 |
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 Respirant
|
||||
Copyright (c) 2021 Respirant
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
"BlacklistPlatforms": [
|
||||
"XboxOne",
|
||||
"PS4",
|
||||
"HTML5",
|
||||
"TVOS",
|
||||
"Switch"
|
||||
]
|
||||
|
||||
+6
-18
@@ -3,22 +3,6 @@
|
||||
#include "RuntimeFilesDownloaderLibrary.h"
|
||||
#include "RuntimeFilesDownloader.h"
|
||||
|
||||
URuntimeFilesDownloaderLibrary::URuntimeFilesDownloaderLibrary(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
URuntimeFilesDownloaderLibrary::URuntimeFilesDownloaderLibrary() :
|
||||
FileUrl(TEXT(""))
|
||||
, FileSavePath(TEXT(""))
|
||||
{
|
||||
}
|
||||
|
||||
URuntimeFilesDownloaderLibrary::~URuntimeFilesDownloaderLibrary()
|
||||
{
|
||||
}
|
||||
|
||||
URuntimeFilesDownloaderLibrary* URuntimeFilesDownloaderLibrary::CreateDownloader()
|
||||
{
|
||||
URuntimeFilesDownloaderLibrary* Downloader = NewObject<URuntimeFilesDownloaderLibrary>();
|
||||
@@ -46,8 +30,12 @@ URuntimeFilesDownloaderLibrary* URuntimeFilesDownloaderLibrary::DownloadFile(con
|
||||
|
||||
void URuntimeFilesDownloaderLibrary::OnProgress_Internal(FHttpRequestPtr Request, int32 BytesSent, int32 BytesReceived)
|
||||
{
|
||||
int32 FullSize = Request->GetContentLength();
|
||||
OnProgress.Broadcast(BytesSent, BytesReceived, FullSize);
|
||||
FHttpResponsePtr Response = Request->GetResponse();
|
||||
if (Response.IsValid())
|
||||
{
|
||||
int32 FullSize = Response->GetContentLength();
|
||||
OnProgress.Broadcast(BytesSent, BytesReceived, FullSize);
|
||||
}
|
||||
}
|
||||
|
||||
void URuntimeFilesDownloaderLibrary::OnReady_Internal(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful)
|
||||
|
||||
+2
-7
@@ -5,6 +5,7 @@
|
||||
#include "Http.h"
|
||||
#include "Misc/Paths.h"
|
||||
#include "HAL/PlatformFilemanager.h"
|
||||
#include "GenericPlatform/GenericPlatformFile.h"
|
||||
#include "RuntimeFilesDownloaderLibrary.generated.h"
|
||||
|
||||
/**
|
||||
@@ -32,7 +33,7 @@ DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnResult, TEnumAsByte < DownloadRes
|
||||
UCLASS(BlueprintType, Category = "RuntimeFilesDownloader")
|
||||
class RUNTIMEFILESDOWNLOADER_API URuntimeFilesDownloaderLibrary : public UObject
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
/**
|
||||
@@ -59,12 +60,6 @@ public:
|
||||
UPROPERTY(BlueprintReadOnly, Category = "RuntimeFilesDownloader")
|
||||
FString FileSavePath;
|
||||
|
||||
/**
|
||||
* Basic class methods
|
||||
*/
|
||||
URuntimeFilesDownloaderLibrary();
|
||||
~URuntimeFilesDownloaderLibrary();
|
||||
|
||||
/**
|
||||
* Instantiates a FileDownloader object, starts downloading and saves it when done.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user