PICO Unreal Platform SDK
UOnlinePicoFunctionLibrary Class Reference

Pico blueprint function library. More...

#include <OnlinePicoFunctionLibrary.h>

Public Member Functions

 UFUNCTION (BlueprintCallable, meta=(WorldContext="WorldContextObject"), Category="OnlinePico|Rtc", Meta=(DisplayName="Rtc Send Stream Sync int Info")) static int32 RtcSendStreamSyncInfo(UObject *WorldContextObject
 Sends stream sync info. The sync info data will be sent in the same packet with the audio data. Users who subscribe to this audio stream will receive the stream sync info message. More...
 
 UFUNCTION (BlueprintCallable, meta=(WorldContext="WorldContextObject"), Category="OnlinePico|Rtc", Meta=(DisplayName="Rtc Send Stream Sync Bytes Info")) static int32 RtcSendStreamSyncBytesInfo(UObject *WorldContextObject
 Sends stream sync info. The sync info data will be sent in the same packet with the audio data. Users who subscribe to this audio stream will receive the stream sync info message. More...
 
 UFUNCTION (BlueprintCallable, meta=(WorldContext="WorldContextObject"), Category="OnlinePico|Rtc", Meta=(DisplayName="Rtc Send String Binary Message")) static int64 RtcSendRoomBinaryMessage(UObject *WorldContextObject
 Sends a binary message to a room. All in-room users will receive this message. More...
 
 UFUNCTION (BlueprintCallable, meta=(WorldContext="WorldContextObject"), Category="OnlinePico|Rtc", Meta=(DisplayName="Rtc Send Bytes Binary Message")) static int64 RtcSendRoomBytesBinaryMessage(UObject *WorldContextObject
 Sends a binary message to a room. All in-room users will receive this message. More...
 
 UFUNCTION (BlueprintCallable, meta=(WorldContext="WorldContextObject"), Category="OnlinePico|Rtc", Meta=(DisplayName="Rtc Send User String Binary Message")) static int64 RtcSendUserBinaryMessage(UObject *WorldContextObject
 Sends a binary message to a user. Only the user can receive this message. More...
 
 UFUNCTION (BlueprintCallable, meta=(WorldContext="WorldContextObject"), Category="OnlinePico|Rtc", Meta=(DisplayName="Rtc Send User Bytes Binary Message")) static int64 RtcSendUserBytesBinaryMessage(UObject *WorldContextObject
 Sends a binary message to a user. Only the user can receive this message. More...
 

Static Public Member Functions

static void PicoLogin (UObject *WorldContextObject, int32 LocalUserNum, const FString &UserId, const FString &InToken, const FString &InType, FOnlineManagerLoginCompleteDelegate InLoginComleteDelegate)
 Gets the account login information for the current device. More...
 
static FString PicoGetNickName (UObject *WorldContextObject, int32 LocalUserNum)
 Gets a user's nickname. More...
 
static void PicoReadFriendList (UObject *WorldContextObject, int32 LocalUserNum, const FString &ListName, FOnlineManagerReadFriendListDelegate InReadFriendListDelegate)
 Reads user's friend list by account number. More...
 
static void PicoGetFriendList (UObject *WorldContextObject, int32 LocalUserNum, const FString &ListName, TArray< FPicoUserInfo > &OutFriends)
 Gets an arrary of friends for a specified user by friend list name. More...
 
static FPicoUserInfo PicoGetFriend (UObject *WorldContextObject, int32 LocalUserNum, const FString &FriendId, const FString &ListName)
 Gets a user's friends by friend list name and friend ID. More...
 
static void PicoRtcGetToken (UObject *WorldContextObject, const FString &UserId, const FString &RoomId, int Ttl, int InValue, FOnlineManagerRtcGetTokenDelegate InRtcGetTokenDelegate)
 Gets the RTC token. More...
 
static ERtcEngineInitResult PicoGetRtcEngineInit (UObject *WorldContextObject)
 Initializes the RTC engine. More...
 
static int PicoRtcJoinRoom (UObject *WorldContextObject, const FString &RoomId, const FString &UserId, const FString &Token, const FString &UserExtra, ERtcRoomProfileType InRoomProfileType, bool bIsAutoSubscribeAudio)
 Joins a user to a RTC room. More...
 
static int RtcDestroyRoom (UObject *WorldContextObject, const FString &RoomId)
 Destroys a room. More...
 
static void RtcEnableAudioPropertiesReport (UObject *WorldContextObject, int Interval)
 Enables audio properties report. When this switch is turned on, you will regularly receive a statistical report of audio data. More...
 
static int RtcLeaveRoom (UObject *WorldContextObject, const FString &RoomId)
 Leaves a RTC room. More...
 
static void RtcMuteLocalAudio (UObject *WorldContextObject, ERtcMuteState InRtcMuteState)
 Mutes local audio to make a user's voice cannot be heard by other users in the same room. More...
 
static void RtcPublishRoom (UObject *WorldContextObject, const FString &RoomId)
 Publishes local audio stream to a room so that the voice can be heard by other users in the same room. More...
 
static void RtcUnPublishRoom (UObject *WorldContextObject, const FString &RoomId)
 Stops publishing local audio stream to a room so that other users in the same room cannot hear the voice. More...
 
static void RtcRoomPauseAllSubscribedStream (UObject *WorldContextObject, const FString &RoomId, ERtcPauseResumeMediaType InPauseResumeMediaType)
 Pauses all subscribed streams of a room. Once paused, the voice of users in the room is blocked so nothing can be heard from this room. More...
 
static void RtcRoomResumeAllSubscribedStream (UObject *WorldContextObject, const FString &RoomId, ERtcPauseResumeMediaType InPauseResumeMediaType)
 Resumes all subscribed streams of a room. Once resumed, the voice of users in the room can be heard again. More...
 
static void RtcSetAudioPlaybackDevice (UObject *WorldContextObject, ERtcAudioPlaybackDevice InRtcAudioPlaybackDevice)
 Sets the type of audio playback device. More...
 
static void RtcSetAudioScenario (UObject *WorldContextObject, ERtcAudioScenarioType InRtcAudioScenarioType)
 Sets audio scenario type. More...
 
static void RtcSetCaptureVolume (UObject *WorldContextObject, ERtcStreamIndex InRtcStreamIndex, int InVolume)
 Sets volume for audio capturing. More...
 
static void RtcSetEarMonitorMode (UObject *WorldContextObject, ERtcEarMonitorMode InRtcEarMonitorMode)
 Sets the in-ear monitoring mode. More...
 
static void RtcSetEarMonitorVolume (UObject *WorldContextObject, int InVolume)
 Sets the volume for in-ear monitoring. More...
 
static void RtcSetPlaybackVolume (UObject *WorldContextObject, int InVolume)
 Sets the playback volume. More...
 
static void RtcStartAudioCapture (UObject *WorldContextObject)
 Starts audio capturing. More...
 
static void RtcStopAudioCapture (UObject *WorldContextObject)
 Stops audio capturing. More...
 
static void RtcUpdateToken (UObject *WorldContextObject, const FString &RoomId, const FString &Token)
 Updates room token. More...
 
static void RtcRoomPublishStream (UObject *WorldContextObject, const FString &RoomId, ERtcMediaStreamType InRtcMediaStreamType)
 Publishes the local audio stream to a room so that the local user's voice can be heard by other users in the same room. More...
 
static void RtcRoomSetRemoteAudioPlaybackVolume (UObject *WorldContextObject, const FString &RoomId, const FString &UserId, int32 Volume)
 Sets the volume for a remote user in a room. More...
 
static void RtcRoomSubscribeStream (UObject *WorldContextObject, const FString &RoomId, const FString &UserId, ERtcMediaStreamType InRtcMediaStreamType)
 Subscribes to the audio stream of a specific user in a room. More...
 
static void RtcRoomUnPublishStream (UObject *WorldContextObject, const FString &RoomId, ERtcMediaStreamType InRtcMediaStreamType)
 Stops publishing the local audio stream to a room, so that the other in-room users cannot hear the local user's voice. More...
 
static void RtcRoomUnsubscribeStream (UObject *WorldContextObject, const FString &RoomId, const FString &UserId, ERtcMediaStreamType InRtcMediaStreamType)
 Unsubscribes from the audio stream of a specific user in a room. More...
 
static int64 RtcSendRoomMessage (UObject *WorldContextObject, const FString &RoomId, const FString &Message)
 Sends a text message to a room. All in-room users will receive this message. More...
 
static int64 RtcSendUserMessage (UObject *WorldContextObject, const FString &RoomId, const FString &UserId, const FString &Message)
 Sends a text message to a user. Only the user can receive this message. More...
 
static bool IsGameInitSuccess (UObject *WorldContextObject)
 Is game initialize success. More...
 
static bool GameInitialize (UObject *WorldContextObject)
 Game initialize. More...
 
static bool GameUninitialize (UObject *WorldContextObject)
 Game uninitialize. More...
 
static bool CreateSession (UObject *WorldContextObject, int HostingPlayerNum, FName SessionName, const FPicoOnlineSessionSettings &NewSessionSettings, FPicoManagerOnCreateSessionCompleteDelegate OnCreateSessionCompleteDelegate)
 Creates a private session or a matchmaking session. More...
 
static bool StartSession (UObject *WorldContextObject, FName SessionName, FPicoManagerOnStartSessionCompleteDelegate OnStartSessionCompleteDelegate)
 Changes the session state to InProgress. More...
 
static bool UpdateSession (UObject *WorldContextObject, FName SessionName, const FPicoOnlineSessionSettings &UpdatedSessionSettings, FPicoManagerOnUpdateSessionCompleteDelegate OnUpdateSessionCompleteDelegate, bool bShouldRefreshOnlineData=true)
 Updates the datastore of a session. More...
 
static bool EndSession (UObject *WorldContextObject, FName SessionName, FPicoManagerOnEndSessionCompleteDelegate OnEndSessionCompleteDelegate)
 Changes the session state to Ended. More...
 
static bool DestroySession (UObject *WorldContextObject, FName SessionName, FPicoManagerOnDestroySessionCompleteDelegate OnDestroySessionCompleteDelegate)
 Destroys the current session. More...
 
static bool IsPlayerInSession (UObject *WorldContextObject, FName SessionName, const FString &UniqueId)
 Checks whether a player is in a session. More...
 
static bool StartMatchmaking (UObject *WorldContextObject, const TArray< FString > &LocalPlayers, FName SessionName, const FPicoOnlineSessionSettings &NewSessionSettings, UPARAM(ref) FPicoOnlineSessionSearch &NewSessionSearch, FPicoManagerOnMatchmakingCompleteDelegate OnMatchmakingCompleteDelegate)
 Starts matchmaking for a session. More...
 
static bool CancelMatchmaking (UObject *WorldContextObject, int SearchingPlayerNum, FName SessionName, FPicoManagerOnCancelMatchmakingCompleteDelegate OnCancelMatchmakingCompleteDelegate)
 Cancels matchmaking for a session. More...
 
static bool FindSessions (UObject *WorldContextObject, int32 SearchingPlayerNum, UPARAM(ref) FPicoOnlineSessionSearch &NewSessionSearch, FPicoManagerOnFindSessionCompleteDelegate OnFindSessionCompleteDelegate)
 Finds matchmaking sessions or moderated sessions. More...
 
static bool FindSessionById (UObject *WorldContextObject, const FString &SearchingUserId, const FString &SessionId, FPicoManagerOnSingleSessionResultCompleteDelegate OnSingleSessionResultCompleteDelegate)
 Gets session data by session ID. More...
 
static bool JoinSession (UObject *WorldContextObject, int PlayerNum, FName SessionName, const FPicoOnlineSessionSearchResult &SearchResult, FPicoManagerOnJoinSessionCompleteDelegate OnJoinSessionCompleteDelegate)
 Joins a session. More...
 
static void DumpSessionState (UObject *WorldContextObject)
 Dumps a session. More...
 
static EOnlineSessionStatePicoType GetSessionState (UObject *WorldContextObject, FName SessionName)
 Gets the state of a session. More...
 
static FPicoNamedOnlineSession GetNamedSession (UObject *WorldContextObject, FName SessionName)
 Gets the data about a session. More...
 
static FPicoNamedOnlineSession AddNamedSessionBySettings (UObject *WorldContextObject, FName SessionName, const FPicoOnlineSessionSettings &SessionSettings)
 Adds session by session settings. More...
 
static FPicoNamedOnlineSession AddNamedSession (UObject *WorldContextObject, FName SessionName, const FPicoOnlineSession &Session)
 Adds a session. More...
 
static FPicoOnlineSessionSettings GetSessionSettings (UObject *WorldContextObject, FName SessionName)
 Gets the settings of a session. More...
 
static bool SendSessionInviteToFriend (UObject *WorldContextObject, int32 LocalUserNum, FName SessionName, const FString &Friend)
 Invites a friend to the session. More...
 
static bool PresenceClear (UObject *WorldContextObject, FOnlineManagerPresenceClearDelegate InPresenceClearDelegate)
 Clears a user's presence data in the current app. More...
 
static void ReadInvitableUser (UObject *WorldContextObject, TArray< FString > SuggestedUserList, FOnlineManagerPresenceReadInvitableUserDelegate InReadInvitableUserDelegate)
 Reads a list of invitable users for a user. More...
 
static bool GetInvitableFriendList (UObject *WorldContextObject, TArray< FPicoUserInfo > &OutFriendsList)
 Gets a list of invitable friends for a user. These friends are previously retrieved from the online service when PresenceGetDestinations is complete. More...
 
static bool PresenceSet (UObject *WorldContextObject, const FString &ApiName, const FString &LobbySessionId, const FString &MatchSessionId, bool bIsJoinable, const FString &Extra, FOnlineManagerPresenceSetDelegate InPresenceSetDelegate)
 Sets presence data for a user in the current app. More...
 
static bool PresenceSetDestination (UObject *WorldContextObject, const FString &ApiName, FOnlineManagerPresenceSetDestinationDelegate InPresenceSetDestinationDelegate)
 Replaces a user's current destination with the provided one. More...
 
static bool PresenceSetIsJoinable (UObject *WorldContextObject, bool bIsJoinable, FOnlineManagerPresenceSetIsJoinableDelegate InPresenceSetIsJoinableDelegate)
 Sets whether a user is joinable. More...
 
static bool PresenceSetLobbySession (UObject *WorldContextObject, const FString &LobbySession, FOnlineManagerPresenceSetLobbySessionDelegate InPresenceSetLobbySessionDelegate)
 Replaces a user's current lobby session ID with the provided one. More...
 
static bool PresenceSetMatchSession (UObject *WorldContextObject, const FString &MatchSession, FOnlineManagerPresenceSetMatchSessionDelegate InPresenceSetMatchSessionDelegate)
 Replaces a user's current match session ID with the provided one. More...
 
static bool PresenceSetExtra (UObject *WorldContextObject, const FString &Extra, FOnlineManagerPresenceSetExtraDelegate InPresenceSetExtraDelegate)
 Sets extra presence data for a user. More...
 
static bool PresenceReadSendInvites (UObject *WorldContextObject, FOnlineManagerPresenceReadSentInvitesDelegate InPresenceReadSendInvitesDelegate)
 Reads a list of sent invitations. More...
 
static bool PresenceSendInvites (UObject *WorldContextObject, TArray< FString > UserIdArray, FOnlineManagerPresenceSentInvitesDelegate InPresenceSentInvitesDelegate)
 Sends invitations to users. More...
 
static bool GetSendInvitesList (UObject *WorldContextObject, TArray< FPicoApplicationInvite > &OutList)
 Gets a list of sent invitations when PresenceSendInvites or PresenceReadSendInvites is complete. More...
 
static bool PresenceGetDestinations (UObject *WorldContextObject, FOnlineManagerPresenceGetDestinationsDelegate InPresenceGetDestinationsDelegate)
 Gets all the destinations that can be set for a user. More...
 
static bool PresenceGetDestinationsList (UObject *WorldContextObject, TArray< FPicoDestination > &OutList)
 Gets a list of destinations when PresenceGetDestinations is complete. More...
 
static bool LaunchInvitePanel (UObject *WorldContextObject, FOnlineManagerLaunchInvitePanelDelegate InLaunchInvitePanelDelegate)
 Call up the system panel to invite friends. More...
 
static bool ShareMedia (UObject *WorldContextObject, EShareMediaType InMediaType, const FString &InVideoPath, const FString &InVideoThumbPath, TArray< FString > InImagePaths, EShareAppTyp InShareType, FOnlineManagerShareMediaDelegate InShareMediaDelegate)
 Share videos or pictures to different platforms, currently only support sharing to Douyin apps. More...
 
static bool LaunchOtherApp (UObject *WorldContextObject, const FString &PackageName, const FString &Message, FOnlineManagerLaunchOtherAppDelegate InLaunchOtherAppDelegate)
 Launches a different app in a user's library. More...
 
static bool GetVersion (UObject *WorldContextObject, FOnlineManagerGetVersionDelegate InGetVersionDelegate)
 Gets the current app's latest version in the PICO Store. More...
 
static bool LaunchOtherAppByPresence (UObject *WorldContextObject, const FString &AppID, const FString &PackageName, const FString &Message, const FString &ApiName, const FString &LobbySessionId, const FString &MatchSessionId, const FString &TrackId, const FString &Extra, FOnlineManagerLaunchOtherAppByPresenceDelegate InLaunchOtherAppByPresenceDelegate)
 Launches a different app in a user's library. More...
 
static bool LaunchOtherAppByAppId (UObject *WorldContextObject, const FString &AppId, const FString &Message, FOnlineManagerLaunchOtherAppByAppIdDelegate InLaunchOtherAppByAppIdDelegate)
 Launches a different app in a user's library. More...
 
static bool LaunchStore (UObject *WorldContextObject, FOnlineManagerLaunchStoreDelegate InLaunchStoreDelegate)
 Launches the PICO Store and jump to the details page of the current app. More...
 
static bool GetLaunchDetails (UObject *WorldContextObject, FLaunchDetails &OutLaunchDetails)
 Gets information about how the app was launched. More...
 
static bool LogDeeplinkResult (UObject *WorldContextObject, const FString &TrackingID, ELaunchResult LaunchResult)
 Logs if the user has been successfully directed to the desired destination via a deep link. More...
 
static bool ReadLeaderboards (UObject *WorldContextObject, const TArray< FString > &Players, UPARAM(ref) FPicoOnlineLeaderboardRead &PicoReadObject, FPicoManagerOnReadLeaderboardsCompleteDelegate OnReadLeaderboardsCompleteDelegate)
 Get entries of a leaderboard. More...
 
static bool ReadLeaderboardsForFriends (UObject *WorldContextObject, int32 LocalUserNum, UPARAM(ref) FPicoOnlineLeaderboardRead &PicoReadObject, FPicoManagerOnReadLeaderboardsCompleteDelegate OnReadLeaderboardsCompleteDelegate)
 Get entries of a leaderboard. More...
 
static bool WriteLeaderboards (UObject *WorldContextObject, const FString &SessionName, const FString &Player, UPARAM(ref) FPicoOnlineLeaderboardWrite &PicoWriteObject)
 Writes a entry of a leaderboard. More...
 
static UOnlineSubsystemPicoManager * GetOnlineSubsystemPicoManager (UObject *WorldContextObject)
 Gets the class of online subsystem Pico manager for binding notifications. More...
 
static bool ParseErrorInfo (FString InErrorMessage, int32 &ErrorCode)
 Extract ErrorCode from ErrorMessage. More...
 
static void PicoEntitlementVerifyAppDelegate (FOnlinePicoVerifyAppDelegate OnVerifyAppCallback)
 This function will be deprecated, Please use the PicoEntitlementVerifyCheck().
 
static void PicoEntitlementVerifyCheck ()
 Activate the copyright verification function.
 
static FString PicoGetDeviceSN ()
 Get device SN. More...
 

Detailed Description

Pico blueprint function library.

Member Function Documentation

◆ UFUNCTION() [1/5]

UFUNCTION ( BlueprintCallable  ,
meta  = (WorldContext = "WorldContextObject"),
Category  = "OnlinePico|Rtc",
Meta  = (DisplayName = "Rtc Send Bytes Binary Message") 
)

Sends a binary message to a room. All in-room users will receive this message.

Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdThe ID of the room to which the binary message is to be sent.
BytesThe binary array to be sent.
Returns
A room message ID of type int64, which is automatically generated and incremented.

◆ UFUNCTION() [2/5]

UFUNCTION ( BlueprintCallable  ,
meta  = (WorldContext = "WorldContextObject"),
Category  = "OnlinePico|Rtc",
Meta  = (DisplayName = "Rtc Send Stream Sync Bytes Info") 
)

Sends stream sync info. The sync info data will be sent in the same packet with the audio data. Users who subscribe to this audio stream will receive the stream sync info message.

Parameters
WorldContextObjectUsed to get the information about the current world.
BytesThe stream sync bytes info.
InStreamIndexThe Stream index:
  • 0: Main
  • 1: Screen
  • 2: None
RepeatCountThe stream sync info will be sent repeatedly for the times set in repeatCount. It's designed to avoid losing package and to ensure that the sync info can be sent successfully. However, if repeatCount is too large, it will cause the sync info to pile up in the queue. It is recommended to set this parameter to 1.
InSyncInfoStreamTypeThe sync info stream type:
  • 0: Audio
  • 1: None
Returns
Any code which equals to or below 0 indicates success, and other codes indicate failure.
Code Description
>=0 Send successfully. Indicates the times sent successfully.
-1 Send Failed. Message length exceeded 255B.
-2 Send Failed. The data is empty.
-3 Send Failed. Send sync info with a un-publish screen stream.
-4 Send Failed. Send sync info with a un-publish audio stream.

◆ UFUNCTION() [3/5]

UFUNCTION ( BlueprintCallable  ,
meta  = (WorldContext = "WorldContextObject"),
Category  = "OnlinePico|Rtc",
Meta  = (DisplayName = "Rtc Send String Binary Message") 
)

Sends a binary message to a room. All in-room users will receive this message.

Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdThe ID of the room to which the binary message is to be sent.
MessageInfoThe binary message to be sent.
Returns
A room message ID of type int64, which is automatically generated and incremented.

◆ UFUNCTION() [4/5]

UFUNCTION ( BlueprintCallable  ,
meta  = (WorldContext = "WorldContextObject"),
Category  = "OnlinePico|Rtc",
Meta  = (DisplayName = "Rtc Send User Bytes Binary Message") 
)

Sends a binary message to a user. Only the user can receive this message.

Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdThe ID of the room the user is in.
UserIdThe ID of the user the message is sent to.
BytesThe message to be sent.
Returns
A room message ID of type int64, which is automatically generated and incremented.

◆ UFUNCTION() [5/5]

UFUNCTION ( BlueprintCallable  ,
meta  = (WorldContext = "WorldContextObject"),
Category  = "OnlinePico|Rtc",
Meta  = (DisplayName = "Rtc Send User String Binary Message") 
)

Sends a binary message to a user. Only the user can receive this message.

Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdThe ID of the room the user is in.
UserIdThe ID of the user the message is sent to.
MessageInfoThe message to be sent.
Returns
A room message ID of type int64, which is automatically generated and incremented.