PICO Unreal Platform SDK
Pico_AssetFile.h
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "UObject/NoExportTypes.h"
7#include "PPF_Platform.h"
8#include "OnlineSubsystemPicoNames.h"
9#include "OnlineSubsystemPico.h"
10#include "Pico_AssetFile.generated.h"
11
15DECLARE_LOG_CATEGORY_EXTERN(PicoAssetFile, Log, All);
16
17DECLARE_DYNAMIC_DELEGATE_ThreeParams(FAssetFileDeleteResult, bool, bIsError, const FString&, ErrorMessage, UPico_AssetFileDeleteResult*, DeleteResult);
18DECLARE_DYNAMIC_DELEGATE_ThreeParams(FAssetFileDownloadResult, bool, bIsError, const FString&, ErrorMessage, UPico_AssetFileDownloadResult*, DownloadResult);
19DECLARE_DYNAMIC_DELEGATE_ThreeParams(FAssetFileDownloadCancelResult, bool, bIsError, const FString&, ErrorMessage, UPico_AssetFileDownloadCancelResult*, DownloadCancelResult);
20DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetAssetFileStatus, bool, bIsError, const FString&, ErrorMessage, UPico_AssetStatus*, AssetFileStatus);
21DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetAssetFileList, bool, bIsError, const FString&, ErrorMessage, UPico_AssetDetailsArray*, AssetDetailsArray);
22
23DECLARE_MULTICAST_DELEGATE_OneParam(FAssetFileDownloadUpdateNotify, UPico_AssetFileDownloadUpdate* /*AssetFileDownloadUpdateObj*/);
24DECLARE_MULTICAST_DELEGATE_OneParam(FAssetFileDeleteForSafetyNotify, UPico_AssetFileDeleteForSafety* /*AssetFileDeleteForSafetyObj*/);
25
37class ONLINESUBSYSTEMPICO_API FPicoAssetFileInterface
38{
39private:
40
41 FOnlineSubsystemPico& PicoSubsystem;
42
43public:
44 FPicoAssetFileInterface(FOnlineSubsystemPico& InSubsystem);
46
47 FAssetFileDeleteResult DeleteByIDDelegate;
48 FAssetFileDeleteResult DeleteByNameDelegate;
49 FAssetFileDownloadResult DownloadByIdDelegate;
50 FAssetFileDownloadResult DownloadByNameDelegate;
51 FAssetFileDownloadCancelResult DownloadCancelByIdDelegate;
52 FAssetFileDownloadCancelResult DownloadCancelNameIdDelegate;
53 FGetAssetFileStatus GetAssetFileStatusByIdDelegate;
54 FGetAssetFileStatus GetAssetFileStatusByNameDelegate;
55 FGetAssetFileList GetAssetFileListDelegate;
56 FGetAssetFileList GetNextAssetDetailsArrayPageDelegate;
57
63 FAssetFileDownloadUpdateNotify AssetFileDownloadUpdateCallback;
64
69 FAssetFileDeleteForSafetyNotify AssetFileDeleteForSafetyCallback;
70
83 bool DeleteByID(FString AssetFileID, FAssetFileDeleteResult InDeleteByIDDelegate);
84
97 bool DeleteByName(FString AssetFileName, FAssetFileDeleteResult InDeleteByNameDelegate);
98
110 bool DownloadById(FString AssetFileID, FAssetFileDownloadResult InDownloadByIDDelegate);
111
123 bool DownloadByName(FString AssetFileName, FAssetFileDownloadResult InDownloadByNameDelegate);
124
136 bool DownloadCancelById(FString AssetFileID, FAssetFileDownloadCancelResult InDownloadCancelByIDDelegate);
137
149 bool DownloadCancelByName(FString AssetFileName, FAssetFileDownloadCancelResult InDownloadCancelByNameDelegate);
150
161 bool GetAssetFileList(FGetAssetFileList InGetAssetFileListDelegate);
162
174 bool GetNextAssetDetailsArrayPage(UPico_AssetDetailsArray* InAssetDetailsArray, FGetAssetFileList InGetNextAssetDetailsArrayPageDelegate);
175
187 bool GetAssetFileStatusById(FString AssetFileID, FGetAssetFileStatus InGetAssetFileStatusByIdDelegate);
188
200 bool GetAssetFileStatusByName(FString AssetFileName, FGetAssetFileStatus InGetAssetFileStatusByNameDelegate);
201
202 FDelegateHandle AssetFileDownloadUpdateHandle;
203 void OnAssetFileDownloadUpdate(ppfMessageHandle Message, bool bIsError);
204
205 FDelegateHandle AssetFileDeleteForSafetyHandle;
206 void OnAssetFileDeleteForSafety(ppfMessageHandle Message, bool bIsError);
207};
224UCLASS()
225class ONLINESUBSYSTEMPICO_API UOnlinePicoAssetFileFunction : public UBlueprintFunctionLibrary
226{
227 GENERATED_BODY()
228
229public:
230
231
245 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|AssetFile")
246 static bool DeleteByID(UObject* WorldContextObject, FString AssetFileID, FAssetFileDeleteResult InDeleteByIDDelegate);
247
261 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|AssetFile")
262 static bool DeleteByName(UObject* WorldContextObject, FString AssetFileName, FAssetFileDeleteResult InDeleteByNameDelegate);
263
276 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|AssetFile")
277 static bool DownloadById(UObject* WorldContextObject, FString AssetFileID, FAssetFileDownloadResult InDownloadByIDDelegate);
278
291 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|AssetFile")
292 static bool DownloadByName(UObject* WorldContextObject, FString AssetFileName, FAssetFileDownloadResult InDownloadByNameDelegate);
293
306 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|AssetFile")
307 static bool DownloadCancelById(UObject* WorldContextObject, FString AssetFileID, FAssetFileDownloadCancelResult InDownloadCancelByIDDelegate);
308
321 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|AssetFile")
322 static bool DownloadCancelByName(UObject* WorldContextObject, FString AssetFileName, FAssetFileDownloadCancelResult InDownloadCancelByNameDelegate);
323
335 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|AssetFile")
336 static bool GetAssetFileList(UObject* WorldContextObject, FGetAssetFileList InGetAssetFileListDelegate);
337
350 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|AssetFile")
351 static bool GetNextAssetDetailsArrayPage(UObject* WorldContextObject, UPico_AssetDetailsArray* InAssetDetailsArray, FGetAssetFileList InGetNextAssetDetailsArrayPageDelegate);
352
365 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|AssetFile")
366 static bool GetAssetFileStatusById(UObject* WorldContextObject, FString AssetFileID, FGetAssetFileStatus InGetAssetFileStatusByIdDelegate);
367
380 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|AssetFile")
381 static bool GetAssetFileStatusByName(UObject* WorldContextObject, FString AssetFileName, FGetAssetFileStatus InGetAssetFileStatusByNameDelegate);
382
383}; // end of BP_AssetFile // end of BlueprintFunction
386
387
388UCLASS(BlueprintType)
389class ONLINESUBSYSTEMPICO_API UPico_AssetFileDeleteResult : public UObject
390{
391
392 GENERATED_BODY()
393
394public:
395 void InitParams(ppfAssetFileDeleteResult* InppfAssetFileDeleteResultHandle);
396
397private:
398 FString AssetId = FString();
399 FString FilePath = FString();
400 bool bIsSuccessed = false;
401 ppfID ppfAssetId = 0;
402
403public:
404
405 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Delete Result")
406 FString GetAssetId();
407
408 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Delete Result")
409 FString GetFilePath();
410
411 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Delete Result")
412 bool GetSuccess();
413
414 ppfID GetppfAssetId();
415};
416
417
418UCLASS(BlueprintType)
419class ONLINESUBSYSTEMPICO_API UPico_AssetDetails : public UObject
420{
421
422 GENERATED_BODY()
423
424public:
425 void InitParams(ppfAssetDetails* InppfAssetDetailsHandle);
426
427private:
428 FString AssetId = FString();
429 FString AssetType = FString();
430 FString DownloadStatus = FString();
431 FString FilePath = FString();
432 FString IapStatus = FString();
433 FString Metadata = FString();
434 FString Filename = FString();
435 int32 Version = -1;
436 FString IapSku = FString();
437 FString IapName = FString();
438 FString IapPrice = FString();
439 FString IapCurrency = FString();
440 FString IapDescription = FString();
441 FString IapIconUrl = FString();
442 ppfID ppfAssetId = 0;
443public:
444
445 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Details")
446 FString GetAssetId();
447
448 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Details")
449 FString GetFilePath();
450
451 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Details")
452 FString GetAssetType();
453
454 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Details")
455 FString GetDownloadStatus();
456
457 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Details")
458 FString GetIapStatus();
459
460 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Details")
461 FString GetMetadata();
462
463 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Details")
464 FString GetFilename();
465
466 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Details")
467 int32 GetVersion();
468
469 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Details")
470 FString GetIapSku();
471
472 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Details")
473 FString GetIapName();
474
475 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Details")
476 FString GetIapPrice();
477
478 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Details")
479 FString GetIapCurrency();
480
481 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Details")
482 FString GetIapDescription();
483
484 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Details")
485 FString GetIapIconUrl();
486
487 ppfID GetppfAssetId();
488};
489
490UCLASS(BlueprintType)
491class ONLINESUBSYSTEMPICO_API UPico_AssetDetailsArray : public UObject
492{
493
494 GENERATED_BODY()
495
496public:
497 void InitParams(ppfAssetDetailsArray* InppfAssetDetailsArrayHandle);
498
499private:
500 UPROPERTY()
501 TArray<UPico_AssetDetails*> AssetDetailsArray;
502
503 int32 Size = 0;
504 bool bHasNextPage = false;
505 FString NextPageParam = FString();
506
507
508public:
509 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Details Array")
510 UPico_AssetDetails* GetElement(int32 Index);
511
512 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Details Array")
513 int32 GetSize();
514
515 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Details Array")
516 bool GetHasNextPage();
517
518 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Details Array")
519 FString GetNextPageParam();
520};
521
522UCLASS(BlueprintType)
523class ONLINESUBSYSTEMPICO_API UPico_AssetFileDownloadCancelResult : public UObject
524{
525
526 GENERATED_BODY()
527
528public:
529 void InitParams(ppfAssetFileDownloadCancelResult* InppfAssetFileDownloadCancelResultHandle);
530
531private:
532 FString AssetId = FString();
533 FString FilePath = FString();
534 bool bIsSuccessed = false;
535 ppfID ppfAssetId = 0;
536
537public:
538 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Download Cancel Result")
539 FString GetAssetId();
540
541 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Download Cancel Result")
542 FString GetFilePath();
543
544 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Download Cancel Result")
545 bool GetSuccess();
546
547 ppfID GetppfAssetId();
548};
549
550UCLASS(BlueprintType)
551class ONLINESUBSYSTEMPICO_API UPico_AssetFileDownloadUpdate : public UObject
552{
553
554 GENERATED_BODY()
555
556public:
557 void InitParams(ppfAssetFileDownloadUpdate* InppfAssetFileDownloadUpdateHandle);
558
559private:
560 FString AssetId = FString();
561 int64 BytesTotal = 0;
562 int64 BytesTransferred = 0;
563 EAssetFileDownloadCompleteStatus AssetFileDownloadCompleteStatus = EAssetFileDownloadCompleteStatus::Unkonw;
564 ppfID ppfAssetId = 0;
565
566public:
567
568 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Download Update")
569 FString GetAssetId();
570
571 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Download Update")
572 int64 GetBytesTotal();
573
574 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Download Update")
575 int64 GetBytesTransferred();
576
577 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Download Update")
578 EAssetFileDownloadCompleteStatus GetCompleteStatus();
579
580 ppfID GetppfAssetId();
581};
582
583UCLASS(BlueprintType)
584class ONLINESUBSYSTEMPICO_API UPico_AssetFileDownloadResult : public UObject
585{
586
587 GENERATED_BODY()
588
589public:
590 void InitParams(ppfAssetFileDownloadResult* InppfAssetFileDownloadResultHandle);
591
592private:
593 FString AssetId = FString();
594 FString FilePath = FString();
595 ppfID ppfAssetId = 0;
596
597public:
598
599 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Download Result")
600 FString GetAssetId();
601
602 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Download Result")
603 FString GetFilePath();
604
605 ppfID GetppfAssetId();
606};
607
608UCLASS(BlueprintType)
609class ONLINESUBSYSTEMPICO_API UPico_AssetStatus : public UObject
610{
611
612 GENERATED_BODY()
613
614public:
615 void InitParams(ppfAssetStatus* InppfAssetStatusHandle);
616
617private:
618 FString AssetId = FString();
619 FString FilePath = FString();
620 FString FileName = FString();
621 FString DownloadStatus = FString();
622 ppfID ppfAssetId = 0;
623
624public:
625
626 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Status")
627 FString GetAssetId();
628
629 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Status")
630 FString GetFilePath();
631
632 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Status")
633 FString GetFileName();
634
635 // One of 'installed', 'available', or 'in-progress'
636 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Asset Status")
637 FString GetDownloadStatus();
638
639 ppfID GetppfAssetId();
640};
641
642UCLASS(BlueprintType)
643class ONLINESUBSYSTEMPICO_API UPico_AssetFileDeleteForSafety : public UObject
644{
645
646 GENERATED_BODY()
647
648public:
649 void InitParams(ppfAssetFileDeleteForSafety* InppfAssetFileDeleteForSafetyHandle);
650
651private:
652 FString AssetId = FString();
653 FString Reason = FString();
654 ppfID ppfAssetId = 0;
655
656public:
657
658 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Delete For Safety")
659 FString GetAssetId();
660
661 UFUNCTION(BlueprintPure, Category = "Pico Platform|AssetFile|Delete For Safety")
662 FString GetReason();
663
664 ppfID GetppfAssetId();
665};
PicoAssetFileInterface class.
Definition: Pico_AssetFile.h:38
bool DownloadCancelByName(FString AssetFileName, FAssetFileDownloadCancelResult InDownloadCancelByNameDelegate)
Cancels the download of an asset file by asset file name.
bool DownloadCancelById(FString AssetFileID, FAssetFileDownloadCancelResult InDownloadCancelByIDDelegate)
Cancels the download of an asset file by asset file ID.
FAssetFileDeleteForSafetyNotify AssetFileDeleteForSafetyCallback
Sets the callback to automatically delete a downloaded asset file if it is different from the origina...
Definition: Pico_AssetFile.h:69
bool DownloadById(FString AssetFileID, FAssetFileDownloadResult InDownloadByIDDelegate)
Downloads an asset file by asset file ID.
bool DeleteByName(FString AssetFileName, FAssetFileDeleteResult InDeleteByNameDelegate)
Deletes an installed asset file by asset file name. The corresponding asset file will be removed from...
bool GetAssetFileStatusById(FString AssetFileID, FGetAssetFileStatus InGetAssetFileStatusByIdDelegate)
Gets the download status of an asset file by asset file ID.
bool DeleteByID(FString AssetFileID, FAssetFileDeleteResult InDeleteByIDDelegate)
Deletes an installed asset file by asset file ID. The corresponding asset file will be removed from t...
FAssetFileDownloadUpdateNotify AssetFileDownloadUpdateCallback
Sets the callback to track the download progress of asset file. The Transferred field indicates the n...
Definition: Pico_AssetFile.h:63
bool GetNextAssetDetailsArrayPage(UPico_AssetDetailsArray *InAssetDetailsArray, FGetAssetFileList InGetNextAssetDetailsArrayPageDelegate)
Gets the next page of the asset file list.
bool DownloadByName(FString AssetFileName, FAssetFileDownloadResult InDownloadByNameDelegate)
Downloads an asset file by asset file name.
bool GetAssetFileStatusByName(FString AssetFileName, FGetAssetFileStatus InGetAssetFileStatusByNameDelegate)
Gets the download status of an asset file by asset file name.
bool GetAssetFileList(FGetAssetFileList InGetAssetFileListDelegate)
Gets the asset file list.
OnlinePicoAssetFile Blueprint Function class.
Definition: Pico_AssetFile.h:226