Загрузка PICO Unity OpenXR Integration SDK

This commit is contained in:
2024-12-21 10:28:02 +03:00
parent b2ecc77b2a
commit a2c2504d48
628 changed files with 68895 additions and 2 deletions

View File

@ -0,0 +1,182 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
using System.Runtime.InteropServices;
namespace Pico.Platform.Models
{
/// <summary>Achievement update info.</summary>
public class AchievementUpdate
{
/// Whether the achievement is unlocked in this time.
public readonly bool JustUnlocked;
/// Achievement name.
public readonly string Name;
public AchievementUpdate(IntPtr o)
{
JustUnlocked = CLIB.ppf_AchievementUpdate_GetJustUnlocked(o);
Name = CLIB.ppf_AchievementUpdate_GetName(o);
}
}
/// <summary>Achievement info.</summary>
public class AchievementDefinition
{
/// Achievement type.
public readonly AchievementType Type;
/// Achievement name.
public readonly string Name;
/// The target to reach for unlocking a bitfield achievement.
public readonly uint BitfieldLength;
/// The target to reach for unlocking a count achievement.
public readonly long Target;
/// Achievement description.
public readonly string Description;
/// Achievement title.
public readonly string Title;
/// Whether the achievement is archieved.
public readonly bool IsArchived;
/// Whether the achievement is a secret achievement. If so, it can be visible after being unlocked only.
public readonly bool IsSecret;
/// Achievement ID.
public readonly ulong ID;
/// The description shown to users when unlocking the achievement.
public readonly string UnlockedDescription;
/// The write policy of the achievement.
public readonly AchievementWritePolicy WritePolicy;
/// The URL of the image displayed when the achievement is still locked.
public readonly string LockedImageURL;
/// The URL of the image displayed when the achievement is unlocked.
public readonly string UnlockedImageURL;
public AchievementDefinition(IntPtr o)
{
Type = CLIB.ppf_AchievementDefinition_GetType(o);
Name = CLIB.ppf_AchievementDefinition_GetName(o);
BitfieldLength = CLIB.ppf_AchievementDefinition_GetBitfieldLength(o);
Target = CLIB.ppf_AchievementDefinition_GetTarget(o);
Description = CLIB.ppf_AchievementDefinition_GetDescription(o);
Title = CLIB.ppf_AchievementDefinition_GetTitle(o);
IsArchived = CLIB.ppf_AchievementDefinition_IsArchived(o);
IsSecret = CLIB.ppf_AchievementDefinition_IsSecret(o);
ID = CLIB.ppf_AchievementDefinition_GetID(o);
UnlockedDescription = CLIB.ppf_AchievementDefinition_GetUnlockedDescription(o);
WritePolicy = CLIB.ppf_AchievementDefinition_GetWritePolicy(o);
LockedImageURL = CLIB.ppf_AchievementDefinition_GetLockedImageURL(o);
UnlockedImageURL = CLIB.ppf_AchievementDefinition_GetUnlockedImageURL(o);
}
}
/// <summary>Achievement definition list.
/// Each element is \ref AchievementDefinition.
/// </summary>
public class AchievementDefinitionList : MessageArray<AchievementDefinition>
{
/// The total number of `AchievementDefinition`.
public readonly ulong TotalSize;
public AchievementDefinitionList(IntPtr a)
{
TotalSize = (ulong) CLIB.ppf_AchievementDefinitionArray_GetTotalSize(a);
var count = (int) CLIB.ppf_AchievementDefinitionArray_GetSize(a);
this.Capacity = count;
for (uint i = 0; i < count; i++)
{
this.Add(new AchievementDefinition(CLIB.ppf_AchievementDefinitionArray_GetElement(a, (UIntPtr) i)));
}
NextPageParam = CLIB.ppf_AchievementDefinitionArray_HasNextPage(a) ? "true" : string.Empty;
}
}
/// <summary>Achievement progress info. </summary>
public class AchievementProgress
{
/// Achievement ID.
public readonly ulong ID;
/// The progress of a bitfield achievement. `1` represents a completed bit.
public readonly string Bitfield;
/// The progress of a count achievement.
public readonly long Count;
/// Whether the achievement is unlocked
public readonly bool IsUnlocked;
/// Achievement name.
public readonly string Name;
/// The time when the achievement is unlocked.
public readonly DateTime UnlockTime;
/// Additional info, no more than 2KB.
public readonly byte[] ExtraData;
public AchievementProgress(IntPtr o)
{
ID = CLIB.ppf_AchievementProgress_GetID(o);
Bitfield = CLIB.ppf_AchievementProgress_GetBitfield(o);
Count = CLIB.ppf_AchievementProgress_GetCount(o);
IsUnlocked = CLIB.ppf_AchievementProgress_GetIsUnlocked(o);
Name = CLIB.ppf_AchievementProgress_GetName(o);
uint size = CLIB.ppf_AchievementProgress_GetExtraDataLength(o);
ExtraData = new byte[size];
Marshal.Copy(CLIB.ppf_AchievementProgress_GetExtraData(o), ExtraData, 0, (int) size);
var unlockTime = CLIB.ppf_AchievementProgress_GetUnlockTime(o);
if (unlockTime != 0)
{
UnlockTime = TimeUtil.SecondsToDateTime((long) unlockTime);
}
}
}
/// <summary>The list of achievements with their progress info.
/// Each element is \ref AchievementProgress.
/// </summary>
public class AchievementProgressList : MessageArray<AchievementProgress>
{
/// The total number of achievements with progress info.
public readonly ulong TotalSize;
public AchievementProgressList(IntPtr a)
{
TotalSize = (ulong) CLIB.ppf_AchievementProgressArray_GetTotalSize(a);
var count = (int) CLIB.ppf_AchievementProgressArray_GetSize(a);
this.Capacity = count;
for (uint i = 0; i < count; i++)
{
this.Add(new AchievementProgress(CLIB.ppf_AchievementProgressArray_GetElement(a, (UIntPtr) i)));
}
NextPageParam = CLIB.ppf_AchievementProgressArray_HasNextPage(a) ? "true" : string.Empty;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d92845d996c24a5e858d06fe078a5997
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,133 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform.Models
{
/// <summary>App launch details.</summary>
public class LaunchDetails
{
/// How the app was launched:
/// * `Normal`: launched by clicking the app's icon
/// * `RoomInvite`: launched by clicking the room invitation message card
/// * `Deeplink`: launched by clicking the presence invitation message card or calling \ref ApplicationService.LaunchApp
/// * `ChallengeInvite`: launched by clicking the challenge invitation message card
///
public readonly LaunchType LaunchType;
/// Deeplink message. You can pass a deeplink when you call \ref ApplicationService.LaunchApp,
/// and the other app will receive the deeplink.This field will have a value only when `LaunchType` is `LaunchApp`.
public readonly string DeeplinkMessage;
/// Destination API name configured on the PICO Developer Platform.For a presence invitation, the inviters'
/// presence data will contain this field which will be passed when the invitee clicks on the message card.
public readonly string DestinationApiName;
/// The lobby session ID that identifies a group or team.
/// For a presence invitation, the inviters' presence data will contain this field which will be passed
/// when the invitee clicks on the message card.
public readonly string LobbySessionID;
/// The match session ID that identifies a competition.
/// For a presence invitation, the inviters' presence data will contain this field which will be passed when the invitee clicks on the message card.
public readonly string MatchSessionID;
/** The customized extra presence info.
* For a presence invitation, the inviters' presence data will contain this field which will be passed when the invitee clicks on the message card.
* You can use this field to add self-defined presence data. The data size cannot exceed 2MB.
*/
public readonly string Extra;
/// Room ID.For a room invitation, after calling \ref RoomService.InviteUser, this field will be passed when the invitee clicks on the message card.
public readonly UInt64 RoomID;
/// For a challenge invitation, after calling \ref ChallengesService.Invite, this field will be passed when the invitee clicks on the message card.
public readonly UInt64 ChallengeID;
/// Tracking ID.
public readonly string TrackingID;
public LaunchDetails(IntPtr o)
{
DeeplinkMessage = CLIB.ppf_LaunchDetails_GetDeeplinkMessage(o);
DestinationApiName = CLIB.ppf_LaunchDetails_GetDestinationApiName(o);
LobbySessionID = CLIB.ppf_LaunchDetails_GetLobbySessionID(o);
MatchSessionID = CLIB.ppf_LaunchDetails_GetMatchSessionID(o);
Extra = CLIB.ppf_LaunchDetails_GetExtra(o);
RoomID = CLIB.ppf_LaunchDetails_GetRoomID(o);
ChallengeID = CLIB.ppf_LaunchDetails_GetChallengeID(o);
TrackingID = CLIB.ppf_LaunchDetails_GetTrackingID(o);
LaunchType = CLIB.ppf_LaunchDetails_GetLaunchType(o);
}
}
/// <summary>
/// The system information of the device.
/// </summary>
public class SystemInfo
{
/** The current ROM version (i.e., system version) of the device, such as "5.5.0" and "5.6.0".*/
public readonly string ROMVersion;
/** The locale of the device. Locale is combined with language and country code. Such as "zh-CN" and "en-US".*/
public readonly string Locale;
/** The product name of the device, such as "PICO 4".*/
public readonly string ProductName;
/** Whether the device's ROM is CN version. PICO provides different ROM versions in different countries/regions.*/
public readonly bool IsCnDevice;
/** The Matrix's version name. Matrix is a system app which provides system functions for platform services.*/
public readonly string MatrixVersionName;
/** The Matrix's version code. */
public readonly long MatrixVersionCode;
public SystemInfo(IntPtr o)
{
ROMVersion = CLIB.ppf_SystemInfo_GetROMVersion(o);
Locale = CLIB.ppf_SystemInfo_GetLocale(o);
ProductName = CLIB.ppf_SystemInfo_GetProductName(o);
IsCnDevice = CLIB.ppf_SystemInfo_GetIsCnDevice(o);
MatrixVersionName = CLIB.ppf_SystemInfo_GetMatrixVersionName(o);
MatrixVersionCode = CLIB.ppf_SystemInfo_GetMatrixVersionCode(o);
}
}
/// <summary>
/// App's version info.
/// </summary>
public class ApplicationVersion
{
/// The current version code of the installed app.
public readonly long CurrentCode;
/// The current version name of the installed app.
public readonly string CurrentName;
/// The latest version code of the app in the PICO Store.
public readonly long LatestCode;
/// The latest version name of the app in the PICO Store.
public readonly string LatestName;
public ApplicationVersion(IntPtr o)
{
CurrentCode = CLIB.ppf_ApplicationVersion_GetCurrentCode(o);
CurrentName = CLIB.ppf_ApplicationVersion_GetCurrentName(o);
LatestCode = CLIB.ppf_ApplicationVersion_GetLatestCode(o);
LatestName = CLIB.ppf_ApplicationVersion_GetLatestName(o);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 821a71a2140642259ab07bb49f9ae2c0
timeCreated: 1665579240

View File

@ -0,0 +1,258 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform.Models
{
public static class DownloadStatus
{
public const string Downloaded = "downloaded";
public const string Available = "available";
public const string InProgress = "in-progress";
}
/// <summary>
/// Constants indicates whether the user purchased the in-app product.
/// </summary>
public static class IapStatus
{
/// Purchased
public const string Entitled = "entitled";
/// Not purchased.
public const string NotEntitled = "not-entitled";
}
/// <summary> Indicates where the DLC file is displayed.</summary>
public static class AssetType
{
/// The DLC file is displayed in the PICO Store and the app.
public const string Store = "store";
/// The DLC file is displayed in the app only.
public const string Default = "default";
}
public class AssetDetails
{
/// The unique identifier of DLC file.
public ulong AssetId;
/** Some DLC files can be displayed in the PICO Store. Now it has two values: `default` or `store`.
* You can refer to \ref AssetType for details.
*/
public string AssetType;
/// One of `downloaded`, `available`, and `in-progress`. You can refer to \ref DownloadStatus for details.
public string DownloadStatus;
/// The path to the downloaded DLC file. For a non-downloaded DLC file, this field will be empty.
public string Filepath;
/// The meta info of the DLC file.
public string Metadata;
/// The name of the DLC file.
public string Filename;
/// The version of the DLC file.
public int Version;
/// One of `entitled`, `not-entitled`. You can refer to \ref IapStatus for details.
public string IapStatus;
/// The SKU of the in-app product that the DLC file associated with.
public string IapSku;
/// The name of the in-app product that the DLC fiel associated with.
public string IapName;
/// The price of this DLC file.
public string IapPrice;
/// The currency required for purchasing the DLC file.
public string IapCurrency;
/// The description of the in-app product that the DLC file associated with.
public string IapDescription;
/// The icon of the in-app product that the DLC file associated with.
public string IapIcon;
public AssetDetails(IntPtr o)
{
AssetId = CLIB.ppf_AssetDetails_GetAssetId(o);
AssetType = CLIB.ppf_AssetDetails_GetAssetType(o);
DownloadStatus = CLIB.ppf_AssetDetails_GetDownloadStatus(o);
IapStatus = CLIB.ppf_AssetDetails_GetIapStatus(o);
Filepath = CLIB.ppf_AssetDetails_GetFilepath(o);
Metadata = CLIB.ppf_AssetDetails_GetMetadata(o);
Filename = CLIB.ppf_AssetDetails_GetFilename(o);
Version = CLIB.ppf_AssetDetails_GetVersion(o);
IapSku = CLIB.ppf_AssetDetails_GetIapSku(o);
IapName = CLIB.ppf_AssetDetails_GetIapName(o);
IapPrice = CLIB.ppf_AssetDetails_GetIapPrice(o);
IapCurrency = CLIB.ppf_AssetDetails_GetIapCurrency(o);
IapDescription = CLIB.ppf_AssetDetails_GetIapDescription(o);
IapIcon = CLIB.ppf_AssetDetails_GetIapIcon(o);
}
}
/// <summary>
/// Each element is \ref AssetDetails
/// </summary>
public class AssetDetailsList : MessageArray<AssetDetails>
{
public AssetDetailsList(IntPtr a)
{
var count = (int) CLIB.ppf_AssetDetailsArray_GetSize(a);
this.Capacity = count;
for (int i = 0; i < count; i++)
{
this.Add(new AssetDetails(CLIB.ppf_AssetDetailsArray_GetElement(a, (UIntPtr) i)));
}
NextPageParam = CLIB.ppf_AssetDetailsArray_GetNextPageParam(a);
}
}
/// <summary>
/// If the downloaded DLC file is different from the original one,
/// the DLC file will be automatically removed, and the app will receive a notification.
/// </summary>
public class AssetFileDeleteForSafety
{
/// The ID of the DLC file.
public readonly ulong AssetId;
/// The description for why this asset file is deleted.
public readonly string Reason;
public AssetFileDeleteForSafety(IntPtr o)
{
AssetId = CLIB.ppf_AssetFileDeleteForSafety_GetAssetId(o);
Reason = CLIB.ppf_AssetFileDeleteForSafety_GetReason(o);
}
}
/// <summary>
/// The callback for \ref AssetFileService.DeleteById and \ref AssetFileService.DeleteByName.
/// </summary>
public class AssetFileDeleteResult
{
/// The path to the DLC file.
public readonly string Filepath;
/// Whether the DLC file is deleted successfully.
public readonly bool Success;
/// The ID of the DLC file.
public readonly ulong AssetId;
public AssetFileDeleteResult(IntPtr o)
{
Filepath = CLIB.ppf_AssetFileDeleteResult_GetFilepath(o);
Success = CLIB.ppf_AssetFileDeleteResult_GetSuccess(o);
AssetId = CLIB.ppf_AssetFileDeleteResult_GetAssetId(o);
}
}
/// <summary>Indicates whether the download of the DLC file is successfully canceled.</summary>
public class AssetFileDownloadCancelResult
{
/// The path to the DLC file.
public readonly string Filepath;
/// Whether the download is successfully canceled.
public readonly bool Success;
/// The ID of the DLC file.
public readonly ulong AssetId;
public AssetFileDownloadCancelResult(IntPtr o)
{
Filepath = CLIB.ppf_AssetFileDownloadCancelResult_GetFilepath(o);
Success = CLIB.ppf_AssetFileDownloadCancelResult_GetSuccess(o);
AssetId = CLIB.ppf_AssetFileDownloadCancelResult_GetAssetId(o);
}
}
/// <summary>The result returned after calling \ref AssetFileService.DownloadById or \ref AssetFileService.DownloadByName.</summary>
public class AssetFileDownloadResult
{
/// The ID of the DLC file.
public readonly ulong AssetId;
/// The path to the DLC file.
public readonly string Filepath;
public AssetFileDownloadResult(IntPtr o)
{
AssetId = CLIB.ppf_AssetFileDownloadResult_GetAssetId(o);
Filepath = CLIB.ppf_AssetFileDownloadResult_GetFilepath(o);
}
}
/// <summary>
/// You will receive this message periodically once you call \ref AssetFileService.DownloadById
/// or \ref AssetFileService.DownloadByName.
/// </summary>
public class AssetFileDownloadUpdate
{
/// The ID of the DLC file.
public readonly ulong AssetId;
/// The total bytes of the DLC file.
public readonly ulong BytesTotal;
/// The transferred bytes of the DLC file.
public readonly long BytesTransferred;
/// The download status of the DLC file.
public readonly AssetFileDownloadCompleteStatus CompleteStatus;
public AssetFileDownloadUpdate(IntPtr o)
{
AssetId = CLIB.ppf_AssetFileDownloadUpdate_GetAssetId(o);
BytesTotal = CLIB.ppf_AssetFileDownloadUpdate_GetBytesTotal(o);
BytesTransferred = CLIB.ppf_AssetFileDownloadUpdate_GetBytesTransferred(o);
CompleteStatus = CLIB.ppf_AssetFileDownloadUpdate_GetCompleteStatus(o);
}
}
/// <summary>
/// The callback for \ref AssetFileService.StatusById or \ref AssetFileService.StatusByName.
/// </summary>
public class AssetStatus
{
/// The ID of the DLC file.
public readonly ulong AssetId;
/// The name of the DLC file.
public readonly string Filename;
/// The path to the DLC file.
public readonly string Filepath;
/// The download status of the DLC file. You can refer to \ref DownloadStatus for details.
public readonly string DownloadStatus;
public AssetStatus(IntPtr o)
{
AssetId = CLIB.ppf_AssetStatus_GetAssetId(o);
Filename = CLIB.ppf_AssetStatus_GetFilename(o);
Filepath = CLIB.ppf_AssetStatus_GetFilepath(o);
DownloadStatus = CLIB.ppf_AssetStatus_GetDownloadStatus(o);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: fa00ebe2dc4b4ccab93a18d008dece77
timeCreated: 1661769967

View File

@ -0,0 +1,268 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
using UnityEngine;
namespace Pico.Platform.Models
{
/// <summary>Challenge setting options.</summary>
public class ChallengeOptions
{
/// For creating challenge options
public ChallengeOptions()
{
Handle = CLIB.ppf_ChallengeOptions_Create();
}
/// Set the end date. Currently, not used.
public void SetEndDate(DateTime value)
{
CLIB.ppf_ChallengeOptions_SetEndDate(Handle, Convert.ToUInt64(TimeUtil.DateTimeToSeconds(value)));
}
/// Set whether to get active challenges.
public void SetIncludeActiveChallenges(bool value)
{
CLIB.ppf_ChallengeOptions_SetIncludeActiveChallenges(Handle, value);
}
/// Set whether to get future challenges whose start dates are latter than the current time.
public void SetIncludeFutureChallenges(bool value)
{
CLIB.ppf_ChallengeOptions_SetIncludeFutureChallenges(Handle, value);
}
/// Set whether to get past challenges whose end dates are earlier than the current time.
public void SetIncludePastChallenges(bool value)
{
CLIB.ppf_ChallengeOptions_SetIncludePastChallenges(Handle, value);
}
/// (Optional) Set the name of the leaderboard that the challenges associated with.
public void SetLeaderboardName(string value)
{
CLIB.ppf_ChallengeOptions_SetLeaderboardName(Handle, value);
}
/// Set the start date. Currently, not used.
public void SetStartDate(DateTime value)
{
CLIB.ppf_ChallengeOptions_SetStartDate(Handle, Convert.ToUInt64(TimeUtil.DateTimeToSeconds(value)));
}
/// Set the challenge title. Currently, not used.
public void SetTitle(string value)
{
CLIB.ppf_ChallengeOptions_SetTitle(Handle, value);
}
/// Set the filter for quering specified challenges.
public void SetViewerFilter(ChallengeViewerFilter value)
{
CLIB.ppf_ChallengeOptions_SetViewerFilter(Handle, value);
}
/// Set to get the challenges of a specific visibility type.
public void SetVisibility(ChallengeVisibility value)
{
CLIB.ppf_ChallengeOptions_SetVisibility(Handle, value);
}
public static explicit operator IntPtr(ChallengeOptions options)
{
return options != null ? options.Handle : IntPtr.Zero;
}
~ChallengeOptions()
{
CLIB.ppf_ChallengeOptions_Destroy(Handle);
}
IntPtr Handle;
public IntPtr GetHandle()
{
return Handle;
}
}
/// <summary>Challenge info.</summary>
public class Challenge
{
/// The creator of the challenge.
public readonly ChallengeCreationType CreationType;
/// Challenge ID
public readonly UInt64 ID;
/// Challenge's start date.
public readonly DateTime StartDate;
/// Challenge's end date.
public readonly DateTime EndDate;
/// Participants of the challenge, which might be null. Should check if it is null before use.
public readonly UserList ParticipantsOptional;
/// Users invited to the challenge, which might be null. Should check if it is null before use.
public readonly UserList InvitedUsersOptional;
/// The info about the leaderboard that the challenge associated with.
public readonly Leaderboard Leaderboard;
/// Challenge's title.
public readonly string Title;
/// Challenge's visibility.
public readonly ChallengeVisibility Visibility;
public Challenge(IntPtr o)
{
CreationType = CLIB.ppf_Challenge_GetCreationType(o);
try
{
EndDate = TimeUtil.SecondsToDateTime((long) CLIB.ppf_Challenge_GetEndDate(o));
}
catch (Exception e)
{
Debug.LogWarning($"Challenge Set EndDate: ppf_Challenge_GetEndDate(o) = {CLIB.ppf_Challenge_GetEndDate(o)}, Exception: {e}");
}
ID = CLIB.ppf_Challenge_GetID(o);
{
var pointer = CLIB.ppf_Challenge_GetInvitedUsers(o);
if (pointer == IntPtr.Zero)
{
InvitedUsersOptional = null;
}
else
{
InvitedUsersOptional = new UserList(pointer);
}
}
Leaderboard = new Leaderboard(CLIB.ppf_Challenge_GetLeaderboard(o));
{
var pointer = CLIB.ppf_Challenge_GetParticipants(o);
if (pointer == IntPtr.Zero)
{
ParticipantsOptional = null;
}
else
{
ParticipantsOptional = new UserList(pointer);
}
}
try
{
StartDate = TimeUtil.SecondsToDateTime((long) CLIB.ppf_Challenge_GetStartDate(o));
}
catch (Exception e)
{
Debug.LogWarning($"Challenge Set StartDate: ppf_Challenge_GetStartDate(o) = {CLIB.ppf_Challenge_GetStartDate(o)}, Exception: {e}");
}
Title = CLIB.ppf_Challenge_GetTitle(o);
Visibility = CLIB.ppf_Challenge_GetVisibility(o);
}
}
/// <summary>Challenge list. Each Element is \ref Challenge.</summary>
public class ChallengeList : MessageArray<Challenge>
{
public ChallengeList(IntPtr a)
{
TotalCount = CLIB.ppf_ChallengeArray_GetTotalCount(a);
NextPageParam = CLIB.ppf_ChallengeArray_HasNextPage(a) ? "true" : string.Empty;
PreviousPageParam = CLIB.ppf_ChallengeArray_HasPreviousPage(a) ? "true" : String.Empty;
int count = (int) CLIB.ppf_ChallengeArray_GetSize(a);
this.Capacity = count;
for (uint i = 0; i < count; i++)
{
this.Add(new Challenge(CLIB.ppf_ChallengeArray_GetElement(a, (UIntPtr) i)));
}
}
/// The total number of challenges in the list.
public readonly ulong TotalCount;
}
/// <summary>Challenge entry info.</summary>
public class ChallengeEntry
{
/// The entry's display score.
public readonly string DisplayScore;
/// The entry's additional info, no more than 2KB.
public readonly byte[] ExtraData;
/// The ID of the challenge that the entry belongs to.
public readonly UInt64 ID;
/// The rank of the entry.
public readonly int Rank;
/// The score of the entry.
public readonly long Score;
/// The time when the entry was written.
public readonly DateTime Timestamp;
/// The user the entry belongs to.
public readonly User User;
public ChallengeEntry(IntPtr o)
{
DisplayScore = CLIB.ppf_ChallengeEntry_GetDisplayScore(o);
var extraDataPtr = CLIB.ppf_ChallengeEntry_GetExtraData(o);
var extraDataSize = CLIB.ppf_ChallengeEntry_GetExtraDataLength(o);
ExtraData = MarshalUtil.ByteArrayFromNative(extraDataPtr, extraDataSize);
ID = CLIB.ppf_ChallengeEntry_GetID(o);
Rank = CLIB.ppf_ChallengeEntry_GetRank(o);
Score = CLIB.ppf_ChallengeEntry_GetScore(o);
try
{
Timestamp = TimeUtil.SecondsToDateTime((long) CLIB.ppf_ChallengeEntry_GetTimestamp(o));
}
catch (Exception e)
{
Debug.LogWarning($"ChallengeEntry Set Timestamp: ppf_ChallengeEntry_GetTimestamp(o) = {CLIB.ppf_ChallengeEntry_GetTimestamp(o)}, Exception: {e}");
}
User = new User(CLIB.ppf_ChallengeEntry_GetUser(o));
}
}
/// <summary>Challenge entry list. Each element is \ref ChallengeEntry.</summary>
public class ChallengeEntryList : MessageArray<ChallengeEntry>
{
public ChallengeEntryList(IntPtr a)
{
TotalCount = CLIB.ppf_ChallengeEntryArray_GetTotalCount(a);
NextPageParam = CLIB.ppf_ChallengeEntryArray_HasNextPage(a) ? "true" : string.Empty;
PreviousPageParam = CLIB.ppf_ChallengeEntryArray_HasPreviousPage(a) ? "true" : string.Empty;
int count = (int) CLIB.ppf_ChallengeEntryArray_GetSize(a);
this.Capacity = count;
for (uint i = 0; i < count; i++)
{
this.Add(new ChallengeEntry(CLIB.ppf_ChallengeEntryArray_GetElement(a, (UIntPtr) i)));
}
}
/// The total number of entries in the list.
public readonly ulong TotalCount;
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e107cf0bdc434409aaf2cf952cc37436
timeCreated: 1664352647

View File

@ -0,0 +1,115 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform.Models
{
public class KVPairArray
{
public uint Size { get; private set; }
IntPtr Handle;
public IntPtr GetHandle()
{
return Handle;
}
public KVPairArray(uint size)
{
Size = size;
Handle = CLIB.ppf_KeyValuePairArray_Create((UIntPtr) size);
}
~KVPairArray()
{
CLIB.ppf_KeyValuePairArray_Destroy(Handle);
Handle = IntPtr.Zero;
}
public KVPair GetElement(uint index)
{
return new KVPair(CLIB.ppf_KeyValuePairArray_GetElement(Handle, (UIntPtr) index));
}
}
public class KVPair
{
IntPtr Handle;
bool destroyable = true;
public KVPair()
{
Handle = CLIB.ppf_KeyValuePair_Create();
}
public KVPair(IntPtr o)
{
Handle = o;
destroyable = false;
}
public void SetIntValue(int value)
{
CLIB.ppf_KeyValuePair_SetIntValue(Handle, value);
}
public void SetStringValue(string value)
{
CLIB.ppf_KeyValuePair_SetStringValue(Handle, value);
}
public void SetDoubleValue(double value)
{
CLIB.ppf_KeyValuePair_SetDoubleValue(Handle, value);
}
public int GetIntValue()
{
return CLIB.ppf_KeyValuePair_GetIntValue(Handle);
}
public string GetStringValue()
{
return CLIB.ppf_KeyValuePair_GetStringValue(Handle);
}
public double GetDoubleValue()
{
return CLIB.ppf_KeyValuePair_GetDoubleValue(Handle);
}
public void SetKey(string key)
{
CLIB.ppf_KeyValuePair_SetKey(Handle, key);
}
public string GetKey()
{
return CLIB.ppf_KeyValuePair_GetKey(Handle);
}
public KVPairType GetValueType()
{
return (KVPairType) CLIB.ppf_KeyValuePair_GetValueType(Handle);
}
~KVPair()
{
if (destroyable)
{
CLIB.ppf_KeyValuePair_Destroy(Handle);
Handle = IntPtr.Zero;
}
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: af96c3f14f761724db9f93a693fbad2e
timeCreated: 1523486800
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,31 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform.Models
{
public class DetectSensitiveResult
{
/// The filtered text is a string which replace sensitive words with `*`.
public readonly string FilteredText;
/// The proposed strategy to handle user operation.
public readonly SensitiveProposal Proposal;
public DetectSensitiveResult(IntPtr o)
{
FilteredText = CLIB.ppf_DetectSensitiveResult_GetFilteredText(o);
Proposal = CLIB.ppf_DetectSensitiveResult_GetProposal(o);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 3b2e5ad6aabe48df833647b8ce43f0b3
timeCreated: 1679567051

View File

@ -0,0 +1,110 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform.Models
{
/// <summary>
/// Information about screen capturing.
/// </summary>
public class CaptureInfo
{
/// <summary>
/// The path where the image is located.
/// </summary>
public readonly string ImagePath;
/// <summary>
/// The ID of the screen-capturing task.
/// </summary>
public readonly string JobId;
public CaptureInfo(IntPtr o)
{
ImagePath = CLIB.ppf_CaptureInfo_GetImagePath(o);
JobId = CLIB.ppf_CaptureInfo_GetJobId(o);
}
}
/// <summary>
/// Information about screen recording.
/// </summary>
public class RecordInfo
{
/// <summary>
/// The path where the video is located.
/// </summary>
public readonly string VideoPath;
/// <summary>
/// The duration of the video. Unit: milliseconds.
/// </summary>
public readonly int DurationInMilliSeconds;
/// <summary>
/// The width of the video.
/// </summary>
public readonly int Width;
/// <summary>
/// The height of the video.
/// </summary>
public readonly int Height;
/// <summary>
/// The ID of the screen-recording task.
/// </summary>
public readonly string JobId;
public RecordInfo(IntPtr o)
{
VideoPath = CLIB.ppf_RecordInfo_GetVideoPath(o);
DurationInMilliSeconds = CLIB.ppf_RecordInfo_GetDurationInMilliSeconds(o);
Width = CLIB.ppf_RecordInfo_GetWidth(o);
Height = CLIB.ppf_RecordInfo_GetHeight(o);
JobId = CLIB.ppf_RecordInfo_GetJobId(o);
}
}
/// <summary>
/// Information about the images captured and videos recorded in a session.
/// </summary>
public class SessionMedia
{
/// <summary>
/// Image information, including image paths and job IDs.
/// </summary>
public readonly CaptureInfo[] Images;
/// <summary>
/// Video information, including video paths, video durations, video sizes, and job IDs.
/// </summary>
public readonly RecordInfo[] Videos;
public SessionMedia(IntPtr o)
{
{
int sz = (int) CLIB.ppf_SessionMedia_GetImagesSize(o);
Images = new CaptureInfo[sz];
for (int i = 0; i < sz; i++)
{
Images[i] = new CaptureInfo(CLIB.ppf_SessionMedia_GetImages(o, (UIntPtr) i));
}
}
{
int sz = (int) CLIB.ppf_SessionMedia_GetVideosSize(o);
Videos = new RecordInfo[sz];
for (int i = 0; i < sz; i++)
{
Videos[i] = new RecordInfo(CLIB.ppf_SessionMedia_GetVideos(o, (UIntPtr) i));
}
}
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 6effacd11a404d7983207e0418286b47
timeCreated: 1686138789

View File

@ -0,0 +1,225 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform.Models
{
/// <summary>
/// The add-on that can be purchased in the app.
///
/// You can create in-app products on the PICO Developer Platform.
/// </summary>
public class Product
{
/// The description of the add-on.
public readonly string Description;
/// The detailed description of the add-on.
public readonly string DetailDescription;
/// The price of the add-on, which is a number string.
public readonly string Price;
/// The currency required for purchasing the add-on.
public readonly string Currency;
/// The name of the add-on.
public readonly string Name;
/// The unique identifier of the add-on.
public readonly string SKU;
/// The icon of the add-on, which is an image URL.
public readonly string Icon;
/// The type of the add-on
public readonly AddonsType AddonsType;
/// The period type for the subscription add-on. Only valid when it's a subscription add-on.
public readonly PeriodType PeriodType;
/// The trial period unit for the subscription add-on. Only valid when it's a subscription add-on.
public readonly PeriodType TrialPeriodUnit;
/// The trial period value for the subscription add-on. Only valid when it's a subscription add-on.
public readonly int TrialPeriodValue;
/// The original price of the add-on, which means the price without discount.
public readonly string OriginalPrice;
/// The order ID of the subscription. Only valid when it's a subscription add-on.
public readonly string OuterId;
/// Whether the subscription is auto renewed. Only valid when it's a subscription add-on.
public readonly bool IsContinuous;
public Product(IntPtr o)
{
Description = CLIB.ppf_Product_GetDescription(o);
DetailDescription = CLIB.ppf_Product_GetDetailDescription(o);
Price = CLIB.ppf_Product_GetPrice(o);
Currency = CLIB.ppf_Product_GetCurrency(o);
Name = CLIB.ppf_Product_GetName(o);
SKU = CLIB.ppf_Product_GetSKU(o);
Icon = CLIB.ppf_Product_GetIcon(o);
AddonsType = CLIB.ppf_Product_GetAddonsType(o);
PeriodType = CLIB.ppf_Product_GetPeriodType(o);
TrialPeriodUnit = CLIB.ppf_Product_GetTrialPeriodUnit(o);
TrialPeriodValue = CLIB.ppf_Product_GetTrialPeriodValue(o);
OuterId = CLIB.ppf_Product_GetOuterId(o);
OriginalPrice = CLIB.ppf_Product_GetOriginalPrice(o);
IsContinuous = CLIB.ppf_Product_IsContinuous(o);
}
}
/// <summary>
/// Each element is \ref Product.
/// </summary>
public class ProductList : MessageArray<Product>
{
public ProductList(IntPtr a)
{
var count = (int) CLIB.ppf_ProductArray_GetSize(a);
this.Capacity = count;
for (int i = 0; i < count; i++)
{
this.Add(new Product(CLIB.ppf_ProductArray_GetElement(a, (UIntPtr) i)));
}
NextPageParam = CLIB.ppf_ProductArray_GetNextPageParam(a);
}
}
/// <summary>
/// The add-on that the current user has purchased.
/// </summary>
public class Purchase
{
/// The expiration time. Only valid when it's a subscription add-on.
public readonly DateTime ExpirationTime;
/// The grant time. Only valid when it's a subscription add-on.
public readonly DateTime GrantTime;
/// The ID of the purchase order.
public readonly string ID;
/// The unique identifier of the add-on in the purchase order.
public readonly string SKU;
/// The icon of the add-on.
public readonly string Icon;
/// The type of the purchased add-on.
public readonly AddonsType AddonsType;
/// The order ID of the subscription. Only valid when it's a subscription add-on.
public readonly string OuterId;
/// The current period type of subscription. Only valid when it's a subscription add-on.
public readonly PeriodType CurrentPeriodType;
/// The next period type of subscription. Only valid when it's a subscription add-on.
public readonly PeriodType NextPeriodType;
/// The next pay time of subscription. Only valid when it's a subscription add-on.
public readonly DateTime NextPayTime;
/// The discount info of the purchase.
public readonly DiscountType DiscountType;
/// The comment for the order. Developers can add order comment to a purchase. See also: \ref IAPService.LaunchCheckoutFlow3
public readonly string OrderComment;
public Purchase(IntPtr o)
{
ExpirationTime = TimeUtil.MilliSecondsToDateTime(CLIB.ppf_Purchase_GetExpirationTime(o));
GrantTime = TimeUtil.MilliSecondsToDateTime(CLIB.ppf_Purchase_GetGrantTime(o));
ID = CLIB.ppf_Purchase_GetID(o);
SKU = CLIB.ppf_Purchase_GetSKU(o);
Icon = CLIB.ppf_Purchase_GetIcon(o);
AddonsType = CLIB.ppf_Purchase_GetAddonsType(o);
OuterId = CLIB.ppf_Purchase_GetOuterId(o);
CurrentPeriodType = CLIB.ppf_Purchase_GetCurrentPeriodType(o);
NextPeriodType = CLIB.ppf_Purchase_GetNextPeriodType(o);
NextPayTime = TimeUtil.MilliSecondsToDateTime(CLIB.ppf_Purchase_GetNextPayTime(o));
DiscountType = CLIB.ppf_Purchase_GetDiscountType(o);
OrderComment = CLIB.ppf_Purchase_GetOrderComment(o);
}
}
/// <summary>
/// Each element is \ref Purchase.
/// </summary>
public class PurchaseList : MessageArray<Purchase>
{
public PurchaseList(IntPtr a)
{
var count = (int) CLIB.ppf_PurchaseArray_GetSize(a);
this.Capacity = count;
for (int i = 0; i < count; i++)
{
this.Add(new Purchase(CLIB.ppf_PurchaseArray_GetElement(a, (UIntPtr) i)));
}
NextPageParam = CLIB.ppf_PurchaseArray_GetNextPageParam(a);
}
}
/// <summary>
/// \ref IAPService.GetSubscriptionStatus returns the subscription status of a subscription add-on.
/// </summary>
public class SubscriptionStatus
{
/// The SKU of the add-on. SKU is the add-on's unique identifier.
public readonly string SKU;
/// The order ID of the subscription. Only valid when it's a subscription add-on.
public readonly string OuterId;
/// The start time of the subscription.
public readonly DateTime StartTime;
/// The end time of the subscription.
public readonly DateTime EndTime;
/// The period type of the subscription.
public readonly PeriodType PeriodType;
/// The entitlement status of the add-on, which indicates whether the user is entitled to use the add-on.
public readonly EntitlementStatus EntitlementStatus;
/// If `EntitlementStatus` is `Cancel`, `CancelReason` indicates why the subscription has been canceled.
public readonly CancelReason CancelReason;
/// Whether the subscription is in free trial.
public readonly bool IsFreeTrial;
/// The next period of the subscription.
public readonly int NextPeriod;
public SubscriptionStatus(IntPtr o)
{
SKU = CLIB.ppf_SubscriptionStatus_GetSKU(o);
OuterId = CLIB.ppf_SubscriptionStatus_GetOuterId(o);
StartTime = TimeUtil.MilliSecondsToDateTime(CLIB.ppf_SubscriptionStatus_GetStartTime(o));
EndTime = TimeUtil.MilliSecondsToDateTime(CLIB.ppf_SubscriptionStatus_GetEndTime(o));
PeriodType = CLIB.ppf_SubscriptionStatus_GetPeriodType(o);
EntitlementStatus = CLIB.ppf_SubscriptionStatus_GetEntitlementStatus(o);
CancelReason = CLIB.ppf_SubscriptionStatus_GetCancelReason(o);
IsFreeTrial = CLIB.ppf_SubscriptionStatus_GetIsFreeTrial(o);
NextPeriod = CLIB.ppf_SubscriptionStatus_GetNextPeriod(o);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 2178942333fc436ab70032c2073b63bb
timeCreated: 1655278125

View File

@ -0,0 +1,146 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform.Models
{
/// <summary>Leaderboard info.</summary>
public class Leaderboard
{
/// The unique identifier of the leaderboard, which is configured on the PICO Developer Platform.
public readonly string ApiName;
/// Leaderboard ID.
public readonly ulong ID;
/** Associate a destination to the leaderboard so that users can be directed to a specific location in the app.
* If the leaderboard for that challenge is associated with a destination, the app will be launched, and the user will be directed to the destination.
* If the leaderboard for that challenge is not associated with any destination, the app will be launched, and the user will be directed to the Home page.
*/
public readonly Destination DestinationOptional;
public Leaderboard(IntPtr o)
{
ApiName = CLIB.ppf_Leaderboard_GetApiName(o);
ID = CLIB.ppf_Leaderboard_GetID(o);
var pointer = CLIB.ppf_Leaderboard_GetDestination(o);
if (pointer == IntPtr.Zero)
DestinationOptional = null;
else
DestinationOptional = new Destination(pointer);
}
}
/// <summary>Leaderboard list. Each element is \ref Leaderboard.</summary>
public class LeaderboardList : MessageArray<Leaderboard>
{
/// The total number of leaderboards in the list.
public readonly ulong TotalCount;
public LeaderboardList(IntPtr a)
{
TotalCount = CLIB.ppf_LeaderboardArray_GetTotalCount(a);
NextPageParam = CLIB.ppf_LeaderboardArray_HasNextPage(a) ? "true" : string.Empty;
var count = (int) CLIB.ppf_LeaderboardArray_GetSize(a);
this.Capacity = count;
for (var i = 0; i < count; i++)
{
Add(new Leaderboard(CLIB.ppf_LeaderboardArray_GetElement(a, (UIntPtr) i)));
}
}
}
/// <summary>Supplementary metric.</summary>
public class SupplementaryMetric
{
/// The ID of the supplementary metric.
public readonly UInt64 ID;
/// The value of the supplementary metric.
public readonly long Metric;
public SupplementaryMetric(IntPtr o)
{
ID = CLIB.ppf_SupplementaryMetric_GetID(o);
Metric = CLIB.ppf_SupplementaryMetric_GetMetric(o);
}
}
/// <summary>Leaderboard entry info.</summary>
public class LeaderboardEntry
{
/// The entry's display score.
public readonly string DisplayScore;
/// Additional info, no more than 2KB.
public readonly byte[] ExtraData;
/// Entry ID.
public readonly UInt64 ID;
/// The entry's ranking on the leaderboard. For example, returns `1` for top1.
public readonly int Rank;
/// The score used to rank the entry.
public readonly long Score;
/// The supplementary metric used for tiebreakers. This field can be null. Need to check whether it is null before use.
public readonly SupplementaryMetric SupplementaryMetricOptional;
/// The time when the entry was written to the leaderboard.
public readonly DateTime Timestamp;
/// The user the entry belongs to.
public readonly User User;
public LeaderboardEntry(IntPtr o)
{
DisplayScore = CLIB.ppf_LeaderboardEntry_GetDisplayScore(o);
var extraDataPtr = CLIB.ppf_LeaderboardEntry_GetExtraData(o);
var extraDataSize = CLIB.ppf_LeaderboardEntry_GetExtraDataLength(o);
ExtraData = MarshalUtil.ByteArrayFromNative(extraDataPtr, extraDataSize);
ID = CLIB.ppf_LeaderboardEntry_GetID(o);
Rank = CLIB.ppf_LeaderboardEntry_GetRank(o);
Score = CLIB.ppf_LeaderboardEntry_GetScore(o);
Timestamp = TimeUtil.SecondsToDateTime((long) CLIB.ppf_LeaderboardEntry_GetTimestamp(o));
User = new User(CLIB.ppf_LeaderboardEntry_GetUser(o));
{
var pointer = CLIB.ppf_LeaderboardEntry_GetSupplementaryMetric(o);
if (pointer == IntPtr.Zero)
{
SupplementaryMetricOptional = null;
}
else
{
SupplementaryMetricOptional = new SupplementaryMetric(pointer);
}
}
}
}
/// <summary>Leaderboard entry list. Each element is \ref LeaderboardEntry.</summary>
public class LeaderboardEntryList : MessageArray<LeaderboardEntry>
{
/// The total number of entries on the leaderboard.
public readonly ulong TotalCount;
public LeaderboardEntryList(IntPtr a)
{
NextPageParam = CLIB.ppf_LeaderboardEntryArray_HasNextPage(a) ? "true" : string.Empty;
PreviousPageParam = CLIB.ppf_LeaderboardEntryArray_HasPreviousPage(a) ? "true" : string.Empty;
var count = (int) CLIB.ppf_LeaderboardEntryArray_GetSize(a);
this.Capacity = count;
for (uint i = 0; i < count; i++)
{
this.Add(new LeaderboardEntry(CLIB.ppf_LeaderboardEntryArray_GetElement(a, (UIntPtr) i)));
}
TotalCount = CLIB.ppf_LeaderboardEntryArray_GetTotalCount(a);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 457e9a7eddbc4d46ab8add0d8ebc03d6
timeCreated: 1655221465

View File

@ -0,0 +1,202 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform.Models
{
/// <summary>Matchmaking admin snapshot. You will receive this after calling \ref MatchmakingService.GetAdminSnapshot.</summary>
public class MatchmakingAdminSnapshot
{
/// List of matchmaking candidates
public readonly MatchmakingAdminSnapshotCandidateList CandidateList;
/// The current matching threshold.
public readonly double MyCurrentThreshold;
public MatchmakingAdminSnapshot(IntPtr o)
{
CandidateList = new MatchmakingAdminSnapshotCandidateList(CLIB.ppf_MatchmakingAdminSnapshot_GetCandidates(o));
MyCurrentThreshold = CLIB.ppf_MatchmakingAdminSnapshot_GetMyCurrentThreshold(o);
}
}
/// <summary>Matchmaking candidate.</summary>
public class MatchmakingAdminSnapshotCandidate
{
/// Whether me and the other user can be matched.
public readonly bool CanMatch;
/// My matching threshold.
public readonly double MyTotalScore;
/// The other user's matching threshold.
public readonly double TheirCurrentThreshold;
public MatchmakingAdminSnapshotCandidate(IntPtr o)
{
CanMatch = CLIB.ppf_MatchmakingAdminSnapshotCandidate_GetCanMatch(o);
MyTotalScore = CLIB.ppf_MatchmakingAdminSnapshotCandidate_GetMyTotalScore(o);
TheirCurrentThreshold = CLIB.ppf_MatchmakingAdminSnapshotCandidate_GetTheirCurrentThreshold(o);
}
}
/// <summary>
/// Each element is \ref MatchmakingAdminSnapshotCandidate.
/// </summary>
public class MatchmakingAdminSnapshotCandidateList : MessageArray<MatchmakingAdminSnapshotCandidate>
{
/// The total number of MatchmakingAdminSnapshotCandidate in the list.
public readonly ulong TotalCount;
public MatchmakingAdminSnapshotCandidateList(IntPtr a)
{
var count = (int) CLIB.ppf_MatchmakingAdminSnapshotCandidateArray_GetSize(a);
this.Capacity = count;
TotalCount = (ulong)CLIB.ppf_MatchmakingAdminSnapshotCandidateArray_GetTotalCount(a);
for (int i = 0; i < count; i++)
{
this.Add(new MatchmakingAdminSnapshotCandidate(CLIB.ppf_MatchmakingAdminSnapshotCandidateArray_GetElement(a, (UIntPtr) i)));
}
}
}
/// <summary>Matchmaking browse result. You will receive the result after calling \ref MatchmakingService.Browse2. </summary>
public class MatchmakingBrowseResult
{
/// Matchmaking enqueue result.
public readonly MatchmakingEnqueueResult EnqueueResult;
/// The list of matchmaking rooms.
public readonly MatchmakingRoomList MatchmakingRooms;
public MatchmakingBrowseResult(IntPtr o)
{
EnqueueResult = new MatchmakingEnqueueResult(CLIB.ppf_MatchmakingBrowseResult_GetEnqueueResult(o));
MatchmakingRooms = new MatchmakingRoomList(CLIB.ppf_MatchmakingBrowseResult_GetRooms(o));
}
}
/// <summary>Matchmaking enqueue result.</summary>
public class MatchmakingEnqueueResult
{
/// Matchmaking snapshot options. Used for debugging only.
public readonly MatchmakingAdminSnapshot AdminSnapshotOptional;
/// The average waiting time.
public readonly uint AverageWait;
/// The number of matches made in the last hour.
public readonly uint MatchesInLastHourCount;
/// The expected longest waiting time.
public readonly uint MaxExpectedWait;
/// Matchmaking pool name.
public readonly string Pool;
/// Match rate.
public readonly uint RecentMatchPercentage;
public MatchmakingEnqueueResult(IntPtr o)
{
{
var pointer = CLIB.ppf_MatchmakingEnqueueResult_GetAdminSnapshot(o);
if (pointer == IntPtr.Zero)
{
AdminSnapshotOptional = null;
}
else
{
AdminSnapshotOptional = new MatchmakingAdminSnapshot(pointer);
}
}
AverageWait = CLIB.ppf_MatchmakingEnqueueResult_GetAverageWait(o);
MatchesInLastHourCount = CLIB.ppf_MatchmakingEnqueueResult_GetMatchesInLastHourCount(o);
MaxExpectedWait = CLIB.ppf_MatchmakingEnqueueResult_GetMaxExpectedWait(o);
Pool = CLIB.ppf_MatchmakingEnqueueResult_GetPool(o);
RecentMatchPercentage = CLIB.ppf_MatchmakingEnqueueResult_GetRecentMatchPercentage(o);
}
}
/// <summary>Matchmaking enqueue result and room info. You will receive this after calling \ref MatchmakingService.CreateAndEnqueueRoom2.</summary>
public class MatchmakingEnqueueResultAndRoom
{
/// Matchmaking enqueue result.
public readonly MatchmakingEnqueueResult MatchmakingEnqueueResult;
/// Matchmaking room info.
public readonly Room Room;
public MatchmakingEnqueueResultAndRoom(IntPtr o)
{
MatchmakingEnqueueResult = new MatchmakingEnqueueResult(CLIB.ppf_MatchmakingEnqueueResultAndRoom_GetMatchmakingEnqueueResult(o));
Room = new Room(CLIB.ppf_MatchmakingEnqueueResultAndRoom_GetRoom(o));
}
}
/// <summary>Matchmaking room.</summary>
public class MatchmakingRoom
{
/// Room info.
public readonly Models.Room Room;
/// Currently, always `0`.
public readonly uint PingTime;
/// Currently, always `false`.
public readonly bool HasPingTime;
public MatchmakingRoom(IntPtr o)
{
this.PingTime = CLIB.ppf_MatchmakingRoom_GetPingTime(o);
this.Room = new Models.Room(CLIB.ppf_MatchmakingRoom_GetRoom(o));
this.HasPingTime = CLIB.ppf_MatchmakingRoom_HasPingTime(o);
}
}
/**
* Each element is \ref MatchmakingRoom
*/
public class MatchmakingRoomList : MessageArray<MatchmakingRoom>
{
/// The total number.
public readonly int TotalCount;
public MatchmakingRoomList(IntPtr a)
{
TotalCount = CLIB.ppf_MatchmakingRoomArray_GetTotalCount(a);
int count = (int) CLIB.ppf_MatchmakingRoomArray_GetSize(a);
this.Capacity = count;
for (uint i = 0; i < count; i++)
{
this.Add(new MatchmakingRoom(CLIB.ppf_MatchmakingRoomArray_GetElement(a, (UIntPtr) i)));
}
}
}
/// <summary>Matchmaking statistics. Will receive this after calling \ref MatchmakingService.GetStats.</summary>
public class MatchmakingStats
{
/// The current user's number of draws.
public readonly uint DrawCount;
/// The current user's number of losses.
public readonly uint LossCount;
/// The current user's skill level for the current matchmaking pool.
public readonly uint SkillLevel;
/// The average of all skill levels for the current matchmaking pool.
public readonly double SkillMean;
/// The standard deviation of all skill levels for the current matchmaking pool
public readonly double SkillStandardDeviation;
/// The current user's number of wins.
public readonly uint WinCount;
public MatchmakingStats(IntPtr o)
{
DrawCount = CLIB.ppf_MatchmakingStats_GetDrawCount(o);
LossCount = CLIB.ppf_MatchmakingStats_GetLossCount(o);
SkillLevel = CLIB.ppf_MatchmakingStats_GetSkillLevel(o);
SkillMean = CLIB.ppf_MatchmakingStats_GetSkillMean(o);
SkillStandardDeviation = CLIB.ppf_MatchmakingStats_GetSkillStandardDeviation(o);
WinCount = CLIB.ppf_MatchmakingStats_GetWinCount(o);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ad76d09e01dbdf749a00f0dfd0ed3c1a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,69 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
using UnityEngine;
namespace Pico.Platform.Models
{
/// <summary>
/// Invitation notificiation.
/// </summary>
public class RoomInviteNotification
{
/// Invitation ID.
public readonly UInt64 ID;
/// Room ID.
public readonly UInt64 RoomID;
/// Inviter's user ID.
public readonly string SenderID;
/// The time when the invitation is sent.
public readonly DateTime SentTime;
public RoomInviteNotification(IntPtr o)
{
ID = CLIB.ppf_RoomInviteNotification_GetID(o);
RoomID = CLIB.ppf_RoomInviteNotification_GetRoomID(o);
SenderID = CLIB.ppf_RoomInviteNotification_GetSenderID(o);
SentTime = new DateTime();
try
{
SentTime = TimeUtil.SecondsToDateTime((long) CLIB.ppf_RoomInviteNotification_GetSentTime(o));
}
catch (UnityException ex)
{
Debug.LogWarning($"RoomInviteNotification get SentTime fail {ex}");
throw;
}
}
}
/// <summary>
/// Each element is \ref RoomInviteNotification
/// </summary>
public class RoomInviteNotificationList : MessageArray<RoomInviteNotification>
{
/// The total number.
public readonly int TotalCount;
public RoomInviteNotificationList(IntPtr a)
{
TotalCount = CLIB.ppf_RoomInviteNotificationArray_GetTotalCount(a);
NextPageParam = CLIB.ppf_RoomInviteNotificationArray_HasNextPage(a) ? "true" : string.Empty;
int count = (int) CLIB.ppf_RoomInviteNotificationArray_GetSize(a);
this.Capacity = count;
for (uint i = 0; i < count; i++)
{
this.Add(new RoomInviteNotification(CLIB.ppf_RoomInviteNotificationArray_GetElement(a, (UIntPtr)i)));
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0945c228a6a840e0b4046d70ed08ea25
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,91 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
namespace Pico.Platform.Models
{
using System;
using System.Runtime.InteropServices;
/// <summary>
/// The information about the message packet.
/// </summary>
public sealed class Packet : IDisposable
{
/// The size of the message packet.
private readonly ulong size;
/// The handler of the message packet.
private readonly IntPtr handler;
public Packet(IntPtr handler)
{
this.handler = handler;
this.size = (ulong) CLIB.ppf_Packet_GetSize(handler);
}
/// <summary>Get message content.</summary>
public ulong GetBytes(byte[] dest)
{
if ((ulong) dest.LongLength >= size)
{
Marshal.Copy(CLIB.ppf_Packet_GetBytes(handler), dest, 0, (int) size);
return size;
}
else
{
throw new ArgumentException($"Dest array can't hold {size} bytes");
}
}
/// <summary>Get message content.</summary>
public string GetBytes()
{
if (size > 0)
{
byte[] bytes = new byte[size];
Marshal.Copy(CLIB.ppf_Packet_GetBytes(handler), bytes, 0, (int) size);
return System.Text.Encoding.UTF8.GetString(bytes);
}
else
{
return string.Empty;
}
}
/// <summary>Get the ID of the message sender.</summary>
public string SenderId
{
get { return CLIB.ppf_Packet_GetSenderID(handler); }
}
/// <summary>Get message size.</summary>
public ulong Size
{
get { return size; }
}
#region IDisposable
~Packet()
{
Dispose();
}
public void Dispose()
{
CLIB.ppf_Packet_Free(handler);
GC.SuppressFinalize(this);
}
#endregion
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 351ba01c3b9b64a2f99b84ec5e4202b1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,156 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform.Models
{
/// <summary>
/// Destination is a location in the app.
/// You can configure destinations for your app on the PICO Developer Platform.
/// </summary>
public class Destination
{
/// The destination's API name.
public readonly string ApiName;
/// The destination's deeplink message.
public readonly string DeeplinkMessage;
/// The destination's display name.
public readonly string DisplayName;
public Destination(IntPtr o)
{
ApiName = CLIB.ppf_Destination_GetApiName(o);
DeeplinkMessage = CLIB.ppf_Destination_GetDeeplinkMessage(o);
DisplayName = CLIB.ppf_Destination_GetDisplayName(o);
}
}
/// <summary>
/// Each element is \ref Destination
/// </summary>
public class DestinationList : MessageArray<Destination>
{
public DestinationList(IntPtr a)
{
var count = (int) CLIB.ppf_DestinationArray_GetSize(a);
this.Capacity = count;
for (int i = 0; i < count; i++)
{
this.Add(new Destination(CLIB.ppf_DestinationArray_GetElement(a, (UIntPtr) i)));
}
NextPageParam = CLIB.ppf_DestinationArray_GetNextPageParam(a);
}
}
/// <summary>
/// App's invitation info.
/// </summary>
public class ApplicationInvite
{
/// The destination where the user is directed to after accepting the invitation.
public readonly Destination Destination;
/// Invited users.
public readonly User Recipient;
/// Invitation ID.
public readonly UInt64 ID;
/// If the user clicks the invitation message, this field will be `true`.
public readonly bool IsActive;
/// The lobby session ID that identifies a group or team.
public readonly string LobbySessionId;
/// The match session ID that identifies a competition.
public readonly string MatchSessionId;
public ApplicationInvite(IntPtr o)
{
Destination = new Destination(CLIB.ppf_ApplicationInvite_GetDestination(o));
Recipient = new User(CLIB.ppf_ApplicationInvite_GetRecipient(o));
ID = CLIB.ppf_ApplicationInvite_GetID(o);
IsActive = CLIB.ppf_ApplicationInvite_GetIsActive(o);
LobbySessionId = CLIB.ppf_ApplicationInvite_GetLobbySessionId(o);
MatchSessionId = CLIB.ppf_ApplicationInvite_GetMatchSessionId(o);
}
}
/// <summary>
/// Each element is \ref ApplicationInvite.
/// </summary>
public class ApplicationInviteList : MessageArray<ApplicationInvite>
{
public ApplicationInviteList(IntPtr a)
{
var count = (int) CLIB.ppf_ApplicationInviteArray_GetSize(a);
this.Capacity = count;
for (int i = 0; i < count; i++)
{
this.Add(new ApplicationInvite(CLIB.ppf_ApplicationInviteArray_GetElement(a, (UIntPtr) i)));
}
NextPageParam = CLIB.ppf_ApplicationInviteArray_GetNextPageParam(a);
}
}
/// <summary>
/// The result returned after calling \ref PresenceService.SendInvites.
/// </summary>
public class SendInvitesResult
{
public readonly ApplicationInviteList Invites;
public SendInvitesResult(IntPtr o)
{
Invites = new ApplicationInviteList(CLIB.ppf_SendInvitesResult_GetInvites(o));
}
}
/// <summary>
/// When user click the invitation message, the app will be launched and you will receive a message with presence info.
/// </summary>
public class PresenceJoinIntent
{
/// The deeplink message of the destination.
public readonly string DeeplinkMessage;
/// The destination api name of the destination.
public readonly string DestinationApiName;
/// The lobby session id which is configured by the sender.
public readonly string LobbySessionId;
/// The match session id which is configured by the sender.
public readonly string MatchSessionId;
/// The extra info of the presence.
public readonly string Extra;
public PresenceJoinIntent(IntPtr o)
{
DeeplinkMessage = CLIB.ppf_PresenceJoinIntent_GetDeeplinkMessage(o);
DestinationApiName = CLIB.ppf_PresenceJoinIntent_GetDestinationApiName(o);
LobbySessionId = CLIB.ppf_PresenceJoinIntent_GetLobbySessionId(o);
MatchSessionId = CLIB.ppf_PresenceJoinIntent_GetMatchSessionId(o);
Extra = CLIB.ppf_PresenceJoinIntent_GetExtra(o);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cefd599deefe0d44294c1b825693cdff
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,557 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
using System.Runtime.InteropServices;
namespace Pico.Platform.Models
{
/// <summary>
/// The binary message received in a RTC room.
/// </summary>
public class RtcBinaryMessageReceived
{
/// The message sender's user ID.
public readonly string UserId;
/// The binary data of the message.
public readonly byte[] Data;
/// The ID of the room that the message is sent to.
public readonly string RoomId;
public RtcBinaryMessageReceived(IntPtr o)
{
UserId = CLIB.ppf_RtcBinaryMessageReceived_GetUserId(o);
var ptr = CLIB.ppf_RtcBinaryMessageReceived_GetData(o);
var sz = CLIB.ppf_RtcBinaryMessageReceived_GetLength(o);
Data = MarshalUtil.ByteArrayFromNative(ptr, (uint) sz);
RoomId = CLIB.ppf_RtcBinaryMessageReceived_GetRoomId(o);
}
}
/// <summary>
/// The audio frame is several frames of RTC recorded audio.
/// </summary>
public class RtcAudioFrame
{
/// The type of the audio channel for this audio frame.
public readonly RtcAudioChannel Channel;
/// The data pointer of the audio frame.
public readonly IntPtr Data;
/// The size of the data.
public readonly long DataSize;
/// The sample rate of the data.
public readonly RtcAudioSampleRate SampleRate;
/// The timestamp.Its value is always 0. So don't use it.
public readonly long TimeStampInUs;
public RtcAudioFrame(IntPtr o)
{
Channel = CLIB.ppf_RtcAudioFrame_GetChannel(o);
DataSize = CLIB.ppf_RtcAudioFrame_GetDataSize(o);
SampleRate = CLIB.ppf_RtcAudioFrame_GetSampleRate(o);
TimeStampInUs = CLIB.ppf_RtcAudioFrame_GetTimeStampInUs(o);
Data = CLIB.ppf_RtcAudioFrame_GetData(o);
}
public byte[] GetData()
{
return MarshalUtil.ByteArrayFromNative(this.Data, (uint) this.DataSize);
}
public void SetData(byte[] data)
{
Marshal.Copy(data, 0, this.Data, (int) this.DataSize);
}
}
/// <summary>
/// The message sending result that indicates whether the message is successfully sent.
/// </summary>
public class RtcMessageSendResult
{
/// The message ID.
public readonly long MessageId;
/// The error code returned in the result. `200` means success.
public readonly int Error;
/// The ID of the room that the message is sent to.
public readonly string RoomId;
public RtcMessageSendResult(IntPtr o)
{
MessageId = CLIB.ppf_RtcMessageSendResult_GetMessageId(o);
Error = CLIB.ppf_RtcMessageSendResult_GetError(o);
RoomId = CLIB.ppf_RtcMessageSendResult_GetRoomId(o);
}
}
/// <summary>
/// When the remote user canceled publshing stream to the room, you will receive a notification.
/// </summary>
public class RtcUserUnPublishInfo
{
/// The ID of the remote user.
public readonly string UserId;
/// The stream type.
public readonly RtcMediaStreamType MediaStreamType;
/// The reason why the remote user canceled publishing stream.
public readonly RtcStreamRemoveReason Reason;
/// The ID of the room that the remote user is in.
public readonly string RoomId;
public RtcUserUnPublishInfo(IntPtr o)
{
UserId = CLIB.ppf_RtcUserUnPublishInfo_GetUserId(o);
MediaStreamType = CLIB.ppf_RtcUserUnPublishInfo_GetMediaStreamType(o);
Reason = CLIB.ppf_RtcUserUnPublishInfo_GetReason(o);
RoomId = CLIB.ppf_RtcUserUnPublishInfo_GetRoomId(o);
}
}
/// <summary>
/// The publish stream info.
/// If the remote user publishes stream, you will receive a notification.
/// </summary>
public class RtcUserPublishInfo
{
/// The ID of the remote user.
public readonly string UserId;
/// The stream type.
public readonly RtcMediaStreamType MediaStreamType;
/// The ID of the room that the remote user is in.
public readonly string RoomId;
public RtcUserPublishInfo(IntPtr o)
{
UserId = CLIB.ppf_RtcUserPublishInfo_GetUserId(o);
MediaStreamType = CLIB.ppf_RtcUserPublishInfo_GetMediaStreamType(o);
RoomId = CLIB.ppf_RtcUserPublishInfo_GetRoomId(o);
}
}
/// <summary>
/// The message received by a certain room.
/// The remote users can send messages to the room and you will receive this message.
/// </summary>
public class RtcRoomMessageReceived
{
/// The ID of the message sender.
public readonly string UserId;
/// The message.
public readonly string Message;
/// The ID of the room that the message was sent to.
public readonly string RoomId;
public RtcRoomMessageReceived(IntPtr o)
{
UserId = CLIB.ppf_RtcRoomMessageReceived_GetUserId(o);
Message = CLIB.ppf_RtcRoomMessageReceived_GetMessage(o);
RoomId = CLIB.ppf_RtcRoomMessageReceived_GetRoomId(o);
}
}
/// <summary>
/// The message sent to you by a certain user. You will receive a notification.
/// </summary>
public class RtcUserMessageReceived
{
/// The ID of the message sender.
public readonly string UserId;
/// The message.
public readonly string Message;
/// The ID of the room that the message sender and recipient are in.
public readonly string RoomId;
public RtcUserMessageReceived(IntPtr o)
{
UserId = CLIB.ppf_RtcUserMessageReceived_GetUserId(o);
Message = CLIB.ppf_RtcUserMessageReceived_GetMessage(o);
RoomId = CLIB.ppf_RtcUserMessageReceived_GetRoomId(o);
}
}
/// <summary>
/// The stream sync info sent to your room. You will receive a notification,
/// </summary>
public class RtcStreamSyncInfo
{
/// The key of the stream.
public readonly RtcRemoteStreamKey StreamKey;
/// The type of the stream.
public readonly RtcSyncInfoStreamType StreamType;
/// The stream sync info
public readonly byte[] Data;
public RtcStreamSyncInfo(IntPtr o)
{
StreamKey = new RtcRemoteStreamKey(CLIB.ppf_RtcStreamSyncInfo_GetStreamKey(o));
StreamType = CLIB.ppf_RtcStreamSyncInfo_GetStreamType(o);
var ptr = CLIB.ppf_RtcStreamSyncInfo_GetData(o);
var sz = CLIB.ppf_RtcStreamSyncInfo_GetLength(o);
Data = MarshalUtil.ByteArrayFromNative(ptr, (uint) sz);
}
}
/// <summary>
/// If you enable audio properties report, you will periodically receive audio property info.
/// </summary>
public class RtcAudioPropertyInfo
{
/// The volume detected. It's a value between `0` and `255`.
public readonly int Volume;
public RtcAudioPropertyInfo(IntPtr o)
{
Volume = CLIB.ppf_RtcAudioPropertyInfo_GetVolume(o);
}
}
/// <summary>
/// You will receive this message after you call \ref RtcService.JoinRoom.
/// </summary>
public class RtcJoinRoomResult
{
/// The ID of the room that the user joined.
public readonly string RoomId;
/// The ID of the user.
public readonly string UserId;
/// The error code. `0` indicates success.
public readonly int ErrorCode;
/// The time from calling \ref RtcService.JoinRoom to receiving the result.
public readonly int Elapsed;
/// Whether it is the first time that the user has joined the room or if the user is reconnected to the room.
public readonly RtcJoinRoomType JoinType;
public RtcJoinRoomResult(IntPtr o)
{
RoomId = CLIB.ppf_RtcJoinRoomResult_GetRoomId(o);
UserId = CLIB.ppf_RtcJoinRoomResult_GetUserId(o);
ErrorCode = CLIB.ppf_RtcJoinRoomResult_GetErrorCode(o);
Elapsed = CLIB.ppf_RtcJoinRoomResult_GetElapsed(o);
JoinType = CLIB.ppf_RtcJoinRoomResult_GetJoinType(o);
}
}
/// <summary>
/// You will receive this message after you call \ref RtcService.LeaveRoom.
/// </summary>
public class RtcLeaveRoomResult
{
/// The ID of the room that the user left.
public readonly string RoomId;
public RtcLeaveRoomResult(IntPtr o)
{
RoomId = CLIB.ppf_RtcLeaveRoomResult_GetRoomId(o);
}
}
/// <summary>
/// The local audio properties info.
/// You will periodically receive this message after you
/// call \ref RtcService.EnableAudioPropertiesReport.
/// </summary>
public class RtcLocalAudioPropertiesInfo
{
/// The stream index info.
public readonly RtcStreamIndex StreamIndex;
/// The audio property details.
public readonly RtcAudioPropertyInfo AudioPropertyInfo;
public RtcLocalAudioPropertiesInfo(IntPtr o)
{
StreamIndex = CLIB.ppf_RtcLocalAudioPropertiesInfo_GetStreamIndex(o);
AudioPropertyInfo = new RtcAudioPropertyInfo(CLIB.ppf_RtcLocalAudioPropertiesInfo_GetAudioPropertyInfo(o));
}
}
/// <summary>
/// The local audio properties report.
/// You will periodically receive this message after you
/// call \ref RtcService.EnableAudioPropertiesReport.
/// </summary>
public class RtcLocalAudioPropertiesReport
{
public readonly RtcLocalAudioPropertiesInfo[] AudioPropertiesInfos;
public RtcLocalAudioPropertiesReport(IntPtr o)
{
ulong total = (ulong) CLIB.ppf_RtcLocalAudioPropertiesReport_GetAudioPropertiesInfosSize(o);
AudioPropertiesInfos = new RtcLocalAudioPropertiesInfo[total];
for (uint i = 0; i < total; i++)
{
AudioPropertiesInfos[i] = new RtcLocalAudioPropertiesInfo(CLIB.ppf_RtcLocalAudioPropertiesReport_GetAudioPropertiesInfos(o, (UIntPtr) i));
}
}
}
/// <summary>
/// The media device change info.
/// RTC engine will send this message if media device change is detected.
/// </summary>
public class RtcMediaDeviceChangeInfo
{
/// <summary>
/// Device ID.
/// </summary>
public readonly string DeviceId;
/// <summary>
/// Device type.
/// </summary>
public readonly RtcMediaDeviceType DeviceType;
/// <summary>
/// Device state.
/// </summary>
public readonly RtcMediaDeviceState DeviceState;
/// <summary>
/// Device error.
/// </summary>
public readonly RtcMediaDeviceError DeviceError;
public RtcMediaDeviceChangeInfo(IntPtr o)
{
DeviceId = CLIB.ppf_RtcMediaDeviceChangeInfo_GetDeviceId(o);
DeviceType = CLIB.ppf_RtcMediaDeviceChangeInfo_GetDeviceType(o);
DeviceState = CLIB.ppf_RtcMediaDeviceChangeInfo_GetDeviceState(o);
DeviceError = CLIB.ppf_RtcMediaDeviceChangeInfo_GetDeviceError(o);
}
}
/// <summary>
/// You will receive this notification if the remote user call \ref RtcService.MuteLocalAudio.
/// </summary>
public class RtcMuteInfo
{
/// The ID of the remote user who muted audio.
public readonly string UserId;
/// The state of audio muting: muted or canceled.
public readonly RtcMuteState MuteState;
public RtcMuteInfo(IntPtr o)
{
UserId = CLIB.ppf_RtcMuteInfo_GetUserId(o);
MuteState = CLIB.ppf_RtcMuteInfo_GetMuteState(o);
}
}
/// <summary>
/// The remote audio properties info.
/// You can check who is speaking by this method.
/// </summary>
public class RtcRemoteAudioPropertiesInfo
{
public readonly RtcRemoteStreamKey StreamKey;
public readonly RtcAudioPropertyInfo AudioPropertiesInfo;
public RtcRemoteAudioPropertiesInfo(IntPtr o)
{
StreamKey = new RtcRemoteStreamKey(CLIB.ppf_RtcRemoteAudioPropertiesInfo_GetStreamKey(o));
AudioPropertiesInfo = new RtcAudioPropertyInfo(CLIB.ppf_RtcRemoteAudioPropertiesInfo_GetAudioPropertiesInfo(o));
}
}
/// <summary>
/// You will receive remote user's audio info if you call \ref RtcService.EnableAudioPropertiesReport.
/// </summary>
public class RtcRemoteAudioPropertiesReport
{
public readonly RtcRemoteAudioPropertiesInfo[] AudioPropertiesInfos;
/// The total volume of remote users in the room.
public readonly int TotalRemoteVolume;
public RtcRemoteAudioPropertiesReport(IntPtr o)
{
AudioPropertiesInfos = new RtcRemoteAudioPropertiesInfo[(int) CLIB.ppf_RtcRemoteAudioPropertiesReport_GetAudioPropertiesInfosSize(o)];
for (uint i = 0; i < AudioPropertiesInfos.Length; i++)
{
AudioPropertiesInfos[i] = new RtcRemoteAudioPropertiesInfo(CLIB.ppf_RtcRemoteAudioPropertiesReport_GetAudioPropertiesInfos(o, (UIntPtr) i));
}
TotalRemoteVolume = CLIB.ppf_RtcRemoteAudioPropertiesReport_GetTotalRemoteVolume(o);
}
}
/// <summary>
/// RtcRemoteStreamKey indicates the stream index of a remote user.
/// </summary>
public class RtcRemoteStreamKey
{
/// The ID of the room that the remote user is in.
public readonly string RoomId;
/// The ID of the remote user.
public readonly string UserId;
/// Indicates whether the stream is main stream or screen stream.
public readonly RtcStreamIndex RtcStreamIndex;
public RtcRemoteStreamKey(IntPtr o)
{
RoomId = CLIB.ppf_RtcRemoteStreamKey_GetRoomId(o);
UserId = CLIB.ppf_RtcRemoteStreamKey_GetUserId(o);
RtcStreamIndex = CLIB.ppf_RtcRemoteStreamKey_GetStreamIndex(o);
}
}
/// <summary>
/// You will receive an error code when an error occurred in the room.
/// </summary>
public class RtcRoomError
{
/// The error code.
public readonly int Code;
/// The ID of the room where the error occurred.
public readonly string RoomId;
public RtcRoomError(IntPtr o)
{
Code = CLIB.ppf_RtcRoomError_GetCode(o);
RoomId = CLIB.ppf_RtcRoomError_GetRoomId(o);
}
}
/// <summary>
/// You will periodically receive this message after you successfully join a room.
/// </summary>
public class RtcRoomStats
{
/// The time elapsed since you joined the room .
public readonly int TotalDuration;
/// The number of users in the room.
public readonly int UserCount;
/// The ID of the room you joined.
public readonly string RoomId;
public RtcRoomStats(IntPtr o)
{
TotalDuration = CLIB.ppf_RtcRoomStats_GetTotalDuration(o);
UserCount = CLIB.ppf_RtcRoomStats_GetUserCount(o);
RoomId = CLIB.ppf_RtcRoomStats_GetRoomId(o);
}
}
/// <summary>
/// The warning info of the room.
/// </summary>
public class RtcRoomWarn
{
/// The error code.
public readonly int Code;
/// The ID of the room that the warning info comes from.
public readonly string RoomId;
public RtcRoomWarn(IntPtr o)
{
Code = CLIB.ppf_RtcRoomWarn_GetCode(o);
RoomId = CLIB.ppf_RtcRoomWarn_GetRoomId(o);
}
}
/// <summary>
/// You will receive this message after a remote user joins the room.
/// </summary>
public class RtcUserJoinInfo
{
/// The ID of the user.
public readonly string UserId;
/// If the remote user set the `UserExtra` field when calling \ref RtcService.JoinRoom with extra info.
public readonly string UserExtra;
/// The time used for the remote user to join the room.
public readonly int Elapsed;
/// The ID of the room that the remote user joined.
public readonly string RoomId;
public RtcUserJoinInfo(IntPtr o)
{
UserId = CLIB.ppf_RtcUserJoinInfo_GetUserId(o);
UserExtra = CLIB.ppf_RtcUserJoinInfo_GetUserExtra(o);
Elapsed = CLIB.ppf_RtcUserJoinInfo_GetElapsed(o);
RoomId = CLIB.ppf_RtcUserJoinInfo_GetRoomId(o);
}
}
/// <summary>
/// You will receive this message when the remote user leaves the room.
/// </summary>
public class RtcUserLeaveInfo
{
/// The ID of the user.
public readonly string UserId;
/// The reason why the user left the room, which can be network error or proactive quit.
public readonly RtcUserLeaveReasonType OfflineReason;
/// The ID of the room that the user left.
public readonly string RoomId;
public RtcUserLeaveInfo(IntPtr o)
{
UserId = CLIB.ppf_RtcUserLeaveInfo_GetUserId(o);
OfflineReason = CLIB.ppf_RtcUserLeaveInfo_GetOfflineReason(o);
RoomId = CLIB.ppf_RtcUserLeaveInfo_GetRoomId(o);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: df80498d870b6584980cc5a5d3bb404f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,111 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
using System.Collections.Generic;
namespace Pico.Platform.Models
{
/// <summary>
/// Room info.
/// </summary>
public class Room
{
/// The datastore that stores a room's metadata. The maximum datastore key length is 32 bytes and the maximum datastore value length is 64 bytes.
public readonly Dictionary<string, string> DataStore;
/// Room description. The maximum length is 128 bytes.
public readonly string Description;
/// Room ID.
public readonly UInt64 RoomId;
/// Whether the room is locked.
public readonly bool IsMembershipLocked;
/// Room's join policy.
public readonly RoomJoinPolicy RoomJoinPolicy;
/// Room's joinability.
public readonly RoomJoinability RoomJoinability;
/// The maximum number of users allowed to join a room, which is `100`.
public readonly uint MaxUsers;
/// Room owner. This field can be null. Need to check whether it is null before use.
public readonly User OwnerOptional;
/// Room type.
public readonly RoomType RoomType;
/// Room members. This field can be null. Need to check whether it is null before use.
public readonly UserList UsersOptional;
/// Room name.
public readonly string Name;
/// The Num of the users in room.
public readonly uint PlayerNumber;
public Room(IntPtr o)
{
PlayerNumber = CLIB.ppf_Room_GetPlayerNumber(o);
DataStore = CLIB.DataStoreFromNative(CLIB.ppf_Room_GetDataStore(o));
Description = CLIB.ppf_Room_GetDescription(o);
RoomId = CLIB.ppf_Room_GetID(o);
IsMembershipLocked = CLIB.ppf_Room_GetIsMembershipLocked(o);
RoomJoinPolicy = (RoomJoinPolicy) CLIB.ppf_Room_GetJoinPolicy(o);
RoomJoinability = (RoomJoinability) CLIB.ppf_Room_GetJoinability(o);
MaxUsers = CLIB.ppf_Room_GetMaxUsers(o);
Name = CLIB.ppf_Room_GetName(o);
RoomType = (RoomType) CLIB.ppf_Room_GetType(o);
{
var ptr = CLIB.ppf_Room_GetOwner(o);
if (ptr == IntPtr.Zero)
{
OwnerOptional = null;
}
else
{
OwnerOptional = new User(ptr);
}
}
{
var ptr = CLIB.ppf_Room_GetUsers(o);
if (ptr == IntPtr.Zero)
{
UsersOptional = null;
}
else
{
UsersOptional = new UserList(ptr);
}
}
}
}
/// <summary>Room list info. Each element is \ref Room.</summary>
public class RoomList : MessageArray<Room>
{
/// The total number of rooms.
public readonly int TotalCount;
/// The current page idex from which the list begins.
public int CurIndex;
/// The number of rooms given on each page.
public int PageSize;
public RoomList(IntPtr a)
{
TotalCount = CLIB.ppf_RoomArray_GetTotalCount(a);
CurIndex = CLIB.ppf_RoomArray_GetPageIndex(a);
PageSize = CLIB.ppf_RoomArray_GetPageSize(a);
NextPageParam = CLIB.ppf_RoomArray_HasNextPage(a) ? "true" : string.Empty;
int count = (int) CLIB.ppf_RoomArray_GetSize(a);
this.Capacity = count;
for (uint i = 0; i < count; i++)
{
this.Add(new Room(CLIB.ppf_RoomArray_GetElement(a, (UIntPtr)i)));
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b3b9396dfcf9db14a896b58160a9954f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,65 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform.Models
{
/// <summary>
/// The automatic speech recognition result.
/// </summary>
public class AsrResult
{
/// <summary>
/// The text recognized.
/// </summary>
public readonly string Text;
/// <summary>
/// Whether this is the final result:
/// * `true`: yes
/// * `false`: no
/// </summary>
public readonly bool IsFinalResult;
public AsrResult(IntPtr o)
{
Text = CLIB.ppf_AsrResult_GetText(o);
IsFinalResult = CLIB.ppf_AsrResult_GetIsFinalResult(o);
}
}
/// <summary>
/// Information about the automatic speech recognition error.
/// </summary>
public class SpeechError
{
/// <summary>
/// Error message.
/// </summary>
public readonly string Message;
/// <summary>
/// The ID of the session where the error occurred.
/// </summary>
public readonly string SessionId;
/// <summary>
/// Error code.
/// </summary>
public readonly int Code;
public SpeechError(IntPtr o)
{
Message = CLIB.ppf_SpeechError_GetMessage(o);
Code = CLIB.ppf_SpeechError_GetCode(o);
SessionId = CLIB.ppf_SpeechError_GetSessionId(o);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 869552f8209743b5af9b39415c131ee7
timeCreated: 1679484910

View File

@ -0,0 +1,134 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform.Models
{
/// <summary>
/// The summary of daily sport info.
/// Users' daily sports info is recorded in the local database. This structure indicates the sports info generated someday.
/// </summary>
public class SportDailySummary
{
/// The ID of the summary.
public readonly long Id;
/// The date when the summary was generated.
public readonly DateTime Date;
/// The sport duration (in seconds).
public readonly int DurationInSeconds;
/// The planned sport duration (in seconds).
public readonly int PlanDurationInMinutes;
/// The actual calorie burnt (in kilo calorie).
public readonly double Calorie;
/// The planned calorie to burn.
public readonly double PlanCalorie;
public SportDailySummary(IntPtr o)
{
Id = CLIB.ppf_SportDailySummary_GetId(o);
Date = TimeUtil.MilliSecondsToDateTime(CLIB.ppf_SportDailySummary_GetDate(o));
DurationInSeconds = CLIB.ppf_SportDailySummary_GetDurationInSeconds(o);
PlanDurationInMinutes = CLIB.ppf_SportDailySummary_GetPlanDurationInMinutes(o);
Calorie = CLIB.ppf_SportDailySummary_GetCalorie(o);
PlanCalorie = CLIB.ppf_SportDailySummary_GetPlanCalorie(o);
}
}
/// <summary>
/// Each element is \ref SportDailySummary
/// </summary>
public class SportDailySummaryList : MessageArray<SportDailySummary>
{
public SportDailySummaryList(IntPtr a)
{
var count = (int) CLIB.ppf_SportDailySummaryArray_GetSize(a);
this.Capacity = count;
for (int i = 0; i < count; i++)
{
this.Add(new SportDailySummary(CLIB.ppf_SportDailySummaryArray_GetElement(a, (UIntPtr) i)));
}
}
}
/// <summary>
/// User's sport summary of today.
/// </summary>
public class SportSummary
{
/// The sport duration (in seconds).
public readonly int DurationInSeconds;
/// The calorie burnt (in kilo calorie).
public readonly double Calorie;
/// The time when the user started playing sport.
public readonly DateTime StartTime;
/// The time when the user stopped playing sport.
public readonly DateTime EndTime;
public SportSummary(IntPtr o)
{
DurationInSeconds = (int) CLIB.ppf_SportSummary_GetDurationInSeconds(o);
Calorie = CLIB.ppf_SportSummary_GetCalorie(o);
StartTime = TimeUtil.MilliSecondsToDateTime(CLIB.ppf_SportSummary_GetStartTime(o));
EndTime = TimeUtil.MilliSecondsToDateTime(CLIB.ppf_SportSummary_GetEndTime(o));
}
}
/// <summary>
/// The user's sport info.
/// User can set sport goal in the Sport Center app.
/// </summary>
public class SportUserInfo
{
public readonly Gender Gender;
public readonly DateTime Birthday;
/// The height of the user (in cm).
public readonly int Stature;
/// The weight of the user (in kg).
public readonly int Weight;
/// The sport level that indicates the intensity of the sport.
public readonly int SportLevel;
/// The planned daily sport duration (in minutes).
public readonly int DailyDurationInMinutes;
/// The planned weekly sport days.
public readonly int DaysPerWeek;
/// The sport purpose, such as `keep fit` and `lose weight`.
public readonly SportTarget SportTarget;
public SportUserInfo(IntPtr o)
{
Gender = CLIB.ppf_SportUserInfo_GetGender(o);
Birthday = TimeUtil.MilliSecondsToDateTime(CLIB.ppf_SportUserInfo_GetBirthday(o));
Stature = CLIB.ppf_SportUserInfo_GetStature(o);
Weight = CLIB.ppf_SportUserInfo_GetWeight(o);
SportLevel = CLIB.ppf_SportUserInfo_GetSportLevel(o);
DailyDurationInMinutes = CLIB.ppf_SportUserInfo_GetDailyDurationInMinutes(o);
DaysPerWeek = CLIB.ppf_SportUserInfo_GetDaysPerWeek(o);
SportTarget = CLIB.ppf_SportUserInfo_GetSportTarget(o);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: fb62290b60b54d6297318c9a437b7269
timeCreated: 1657617406

View File

@ -0,0 +1,286 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
using System.Collections.Generic;
namespace Pico.Platform.Models
{
/// <summary>
/// The User info structure.
/// Basic fields, such as `DisplayName` and `ImageUrl`, are always valid.
/// Some fields, such as presence-related fields, are valid only when you call presence-related APIs.
/// See also: \ref UserService.GetLoggedInUser
/// </summary>
public class User
{
/// User's display name.
public readonly string DisplayName;
///The URL of user's profile photo. The image size is 300x300.
public readonly string ImageUrl;
/// The URL of the user's small profile photo. The image size is 128x128.
public readonly string SmallImageUrl;
/// User's openID. The same user has different openIDs in different apps.
public readonly string ID;
/// User's presence status which indicates whether the user is online.
public readonly UserPresenceStatus PresenceStatus;
/// User's gender.
public readonly Gender Gender;
/// User's presence information.
public readonly string Presence;
/// The deeplink message.
public readonly string PresenceDeeplinkMessage;
/// The destination's API name.
public readonly string PresenceDestinationApiName;
/// The lobby session ID which identifies a group or team.
public readonly string PresenceLobbySessionId;
/// The match session ID which identifies a competition.
public readonly string PresenceMatchSessionId;
/// User's extra presence information.
public readonly string PresenceExtra;
/// Whether the user can be joined by others.
public readonly bool PresenceIsJoinable;
/// The user's invite token.
public readonly string InviteToken;
/// The user's registration country/region. Returns a country/region code.
public readonly string StoreRegion;
public User(IntPtr obj)
{
DisplayName = CLIB.ppf_User_GetDisplayName(obj);
ImageUrl = CLIB.ppf_User_GetImageUrl(obj);
ID = CLIB.ppf_User_GetID(obj);
InviteToken = CLIB.ppf_User_GetInviteToken(obj);
PresenceStatus = CLIB.ppf_User_GetPresenceStatus(obj);
Gender = CLIB.ppf_User_GetGender(obj);
Presence = CLIB.ppf_User_GetPresence(obj);
PresenceDeeplinkMessage = CLIB.ppf_User_GetPresenceDeeplinkMessage(obj);
PresenceDestinationApiName = CLIB.ppf_User_GetPresenceDestinationApiName(obj);
PresenceLobbySessionId = CLIB.ppf_User_GetPresenceLobbySessionId(obj);
PresenceMatchSessionId = CLIB.ppf_User_GetPresenceMatchSessionId(obj);
PresenceExtra = CLIB.ppf_User_GetPresenceExtra(obj);
PresenceIsJoinable = CLIB.ppf_User_GetPresenceIsJoinable(obj);
SmallImageUrl = CLIB.ppf_User_GetSmallImageUrl(obj);
InviteToken = CLIB.ppf_User_GetInviteToken(obj);
StoreRegion = CLIB.ppf_User_GetStoreRegion(obj);
}
}
/// <summary>
/// Each element is \ref User.
/// </summary>
public class UserList : MessageArray<User>
{
public UserList(IntPtr a)
{
var count = (int) CLIB.ppf_UserArray_GetSize(a);
this.Capacity = count;
for (int i = 0; i < count; i++)
{
this.Add(new User(CLIB.ppf_UserArray_GetElement(a, (UIntPtr) i)));
}
NextPageParam = CLIB.ppf_UserArray_GetNextPageParam(a);
}
}
/// <summary>
/// The user's organization ID.
/// </summary>
public class OrgScopedID
{
/// <summary>
/// The organization ID.
/// </summary>
public readonly string ID;
public OrgScopedID(IntPtr o)
{
ID = CLIB.ppf_OrgScopedID_GetID(o);
}
}
/// <summary>
/// Indicates whether the friend request is canceled or successfully sent.
/// </summary>
public class LaunchFriendResult
{
/// Whether the request is canceled by the user.
public readonly bool DidCancel;
/// Whether the request is successfully sent.
public readonly bool DidSendRequest;
public LaunchFriendResult(IntPtr obj)
{
DidCancel = CLIB.ppf_LaunchFriendRequestFlowResult_GetDidCancel(obj);
DidSendRequest = CLIB.ppf_LaunchFriendRequestFlowResult_GetDidSendRequest(obj);
}
}
/// <summary>
/// The info returned after calling \ref UserService.GetFriendsAndRooms.
/// </summary>
public class UserRoom
{
public readonly User User;
public readonly Room Room;
public UserRoom(IntPtr o)
{
User = new User(CLIB.ppf_UserAndRoom_GetUser(o));
var ptr = CLIB.ppf_UserAndRoom_GetRoom(o);
if (ptr != IntPtr.Zero)
{
Room = new Room(ptr);
}
}
}
/// <summary>
/// Each element is \ref UserRoom.
/// </summary>
public class UserRoomList : MessageArray<UserRoom>
{
public UserRoomList(IntPtr a)
{
var count = (int) CLIB.ppf_UserAndRoomArray_GetSize(a);
this.Capacity = count;
for (int i = 0; i < count; i++)
{
this.Add(new UserRoom(CLIB.ppf_UserAndRoomArray_GetElement(a, (UIntPtr) i)));
}
NextPageParam = CLIB.ppf_UserAndRoomArray_GetNextPageParam(a);
}
}
/// <summary>
/// User permissions list.
/// </summary>
public static class Permissions
{
/// <summary>
/// The permission to get the user's registration information, including the user's nickname, gender, profile photo, and more.
/// </summary>
public const string UserInfo = "user_info";
/// <summary>
/// The permission to get users' friend relations.
/// </summary>
public const string FriendRelation = "friend_relation";
/// <summary>
/// The permission to get the user's information, including the user's gender, birthday, stature, weight, and more, on the PICO Fitness app.
/// </summary>
public const string SportsUserInfo = "sports_userinfo";
/// <summary>
/// The permission to get users' exercise data from the PICO Fitness app.
/// </summary>
public const string SportsSummaryData = "sports_summarydata";
/// <summary>
/// The permission to capture or record the screen, which is required when using the highlight service.
/// </summary>
public const string RecordHighlight = "record_highlight";
}
/// <summary>
/// The result returned after calling \ref UserService.RequestUserPermissions or \ref UserService.GetAuthorizedPermissions.
/// </summary>
public class PermissionResult
{
/// The authorized permissions.
public readonly string[] AuthorizedPermissions;
/// The access token. It has a value only after you call \ref UserService.RequestUserPermissions.
public readonly string AccessToken;
/// The current user's ID.
public readonly string UserID;
public PermissionResult(IntPtr o)
{
{
int sz = (int) CLIB.ppf_PermissionResult_GetAuthorizedPermissionsSize(o);
AuthorizedPermissions = new string[sz];
for (int i = 0; i < sz; i++)
{
AuthorizedPermissions[i] = CLIB.ppf_PermissionResult_GetAuthorizedPermissions(o, (UIntPtr) i);
}
}
AccessToken = CLIB.ppf_PermissionResult_GetAccessToken(o);
UserID = CLIB.ppf_PermissionResult_GetUserID(o);
}
}
/// <summary>
/// The result returned after calling \ref UserService.GetUserRelations.
///
/// This class derives from Dictionary. The key is userId and value is
/// \ref UserRelationType.
/// </summary>
public class UserRelationResult : Dictionary<string, UserRelationType>
{
public UserRelationResult(IntPtr o)
{
{
int sz = (int) CLIB.ppf_UserRelationResult_GetRelationsSize(o);
for (int i = 0; i < sz; i++)
{
string userId = CLIB.ppf_UserRelationResult_GetRelationsKey(o, i);
UserRelationType relation = CLIB.ppf_UserRelationResult_GetRelationsValue(o, i);
Add(userId, relation);
}
}
}
}
/// <summary>
/// The result returned after calling \ref UserService.EntitlementCheck
/// </summary>
public class EntitlementCheckResult
{
/// Whether the user is entitled to use the current app.
public readonly bool HasEntitlement;
/// The status code for entitlement check.
public readonly int StatusCode;
/// The status message for entitlement check. You can show this message to user if the user does not pass the entitlement check.
public readonly string StatusMessage;
public EntitlementCheckResult(IntPtr o)
{
HasEntitlement = CLIB.ppf_EntitlementCheckResult_GetHasEntitlement(o);
StatusCode = CLIB.ppf_EntitlementCheckResult_GetStatusCode(o);
StatusMessage = CLIB.ppf_EntitlementCheckResult_GetStatusMessage(o);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4aae686bf05693c4db87bb0d2875cb40
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: