Pico Unreal Platform SDK
OnlinePicoSettings.h
1// Copyright 2022 Pico Technology Co., Ltd.All rights reserved.
2// This plugin incorporates portions of the Unreal® Engine. Unreal® is a trademark or registered trademark of Epic Games, Inc.In the United States of America and elsewhere.
3// Unreal® Engine, Copyright 1998 – 2022, Epic Games, Inc.All rights reserved.
4
5#pragma once
6#include "OnlinePicoSettings.generated.h"
7
8DECLARE_LOG_CATEGORY_EXTERN(PicoSettings, Log, All);
9
10UENUM(BlueprintType)
11enum class ERegionType :uint8
12{
13 China,
14 NonChina,
15 Both
16};
17
18UCLASS(config = Engine, defaultconfig)
19class ONLINESUBSYSTEMPICO_API UOnlinePicoSettings : public UObject
20{
21 GENERATED_UCLASS_BODY()
22public:
23
24 // Platform
25 UPROPERTY(Config)
26 bool bIsForeign;
27
28 UPROPERTY(Config)
29 bool bIsGlobal;
30
31 FString DefaultPlatformService;
32
33 FString AndroidPlatformService;
34
35 UPROPERTY(Config, EditAnywhere, Category = Platform, Meta = (DisplayName = "bEnabled"))
36 bool bEnabled = true;
37
38 UPROPERTY(Config, EditAnywhere, Category = Platform, Meta = (DisplayName = "Region"))
39 ERegionType RegionType;
40
41 UPROPERTY(Config, EditAnywhere, Category = Platform, Meta = (DisplayName = "AppID"))
42 FString AppID;
43
44 UPROPERTY(Config, EditAnywhere, Category = Platform, Meta = (DisplayName = "AppKey"))
45 FString AppKey;
46
47 UPROPERTY(Config, EditAnywhere, Category = Platform, Meta = (DisplayName = "Scope"))
48 FString Scope;
49
50 //EntitlementCheck
51 UPROPERTY(Config, EditAnywhere, Category = Platform, Meta = (DisplayName = "User Entitlement Check", ToolTip = "If selected, you will need to enter the APPID that is obtained from Pico Developer Platform after uploading the app for an entitlement check upon the app launch."))
52 bool bStartTimeEntitlementCheck;
53
54 UPROPERTY(Config, EditAnywhere, Category = Platform, Meta = (EditCondition = "bStartTimeEntitlementCheck", DisplayName = "EntitlementCheckAppID"))
55 FString EntitlementCheckAppID;
56
57 UPROPERTY(Config, EditAnywhere, Category = Platform, Meta = (DisplayName = "Entitlement Check Simulation", ToolTip = "If true, Development devices will simulate Entitlement Check, you should enter a valid device SN codes list. The SN code can be obtain in Settings-General-Device serial number or input 'adb devices ' in cmd"))
58 bool bEntitlementCheckSimulation;
59
60 UPROPERTY(Config, EditAnywhere, Category = Platform, Meta = (EditCondition = "bEntitlementCheckSimulation", DisplayName = "Device SN Code List"))
61 TArray<FString> DeviceSN;
62
63 virtual void PostInitProperties() override;
64
65 // Gets the config file settings in-game.
66 UFUNCTION(BlueprintPure, Category = "OVRPlatformBP|OnlineSubsystemOculus")
67 static void GetOnlinePicoSettings(bool& OutbIsEnable, ERegionType& OutRegionType, FString& OutAppID, FString& OutAppKey, FString& OutScope, bool& OutbStartTimeEntitlementCheck, FString& OutEntitlementCheckAppID, bool& OutbEntitlementCheckSimulation, TArray<FString>& OutDeviceSN);
68
69 void LoadSettings();
70
71#if WITH_EDITOR
72 void SaveSettings();
73 bool ValidateSettings();
74
75 // Called when any property is changed externally.
76 virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
77#endif //WITH_EDITOR
78};