mirror of
https://github.com/storytold/RuntimeFilesDownloader.git
synced 2026-10-10 19:50:15 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1a8e141d65 | |||
| e2db0d1f99 | |||
| 2d79563699 | |||
| 4d3dbd0774 |
@@ -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"
|
||||||
]
|
]
|
||||||
|
|||||||
+6
-18
@@ -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)
|
||||||
|
|||||||
+2
-7
@@ -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.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user