PICO Unreal Platform SDK
FPicoRoomInterface Class Reference

PicoRoomInterface class. More...

#include <Pico_Room.h>

Public Member Functions

bool LaunchInvitableUserFlow (const FString &RoomID, FRoomLaunchInvitableUserFlow OnLaunchInvitableUserFlowCallback)
 Launches the invitation flow to let the current user invite friends to a specified room. This launches the system default invite UI where the user can select friends to invite and then send invitations to them. Therefore, this is a shortcut if you do not want to build the invite UI by yourself. More...
 
bool UpdateDataStore (const FString &RoomID, const TMap< FString, FString > &Data, FRoomUpdateDataStore OnUpdateDataStoreCallback)
 Updates the data store of the current room (the caller should be the room owner). More...
 
bool CreateAndJoinPrivate2 (ERoomJoinPolicy JoinPolicy, uint32 MaxUsers, FPicoRoomOptions RoomOptions, FRoomCreateAndJoinPrivate2 OnCreateAndJoinPrivate2Callback)
 Creates a new private room and joins it. More...
 
bool Get (const FString &RoomID, FRoomGet OnGetCallback)
 Gets the information about a specified room. More...
 
bool GetCurrent (FRoomGetCurrent OnGetCurrentCallback)
 Gets the data of the room you are currently in. More...
 
bool GetCurrentForUser (const FString &UserId, FRoomGetCurrentForUser OnGetCurrentForUserCallback)
 Gets the current room of the specified user. More...
 
bool GetInvitableUsers2 (FPicoRoomOptions roomOptions, FRoomGetInvitableUsers2 OnGetInvitableUsers2Callback)
 Gets a list of members the user can invite to the room. These members are drawn from the user's friends list and recently encountered list, and filtered based on relevance and interests. More...
 
bool GetModeratedRooms (int PageIndex, int PageSize, FRoomGetModeratedRooms OnGetModeratedRoomsCallback)
 Gets the list of moderated rooms created for the application. The payload returned is roomarray. The room info contained in roomarray does not include userlist info. More...
 
bool InviteUser (const FString &RoomID, const FString &Token, FRoomInviteUser OnInviteUserCallback)
 Invites a user to the current room. More...
 
bool Join2 (const FString &RoomID, FPicoRoomOptions options, FRoomJoin2 OnJoin2Callback)
 Joins the target room and meanwhile leaves the current room. More...
 
bool KickUser (const FString &RoomID, const FString &UserID, int KickDurationSeconds, FRoomKickUser OnKickUserCallback)
 Kicks a user out of a room. For use by homeowners only. More...
 
bool Leave (const FString &RoomID, FRoomLeave OnLeaveCallback)
 Leaves the current room. More...
 
bool SetDescription (const FString &RoomID, const FString &Description, FRoomSetDescription OnSetDescriptionCallback)
 Sets the description of a room. For use by homeowners only. More...
 
bool UpdateMembershipLockStatus (const FString &RoomID, ERoomMembershipLockStatus MembershipLockStatus, FRoomUpdateMembershipLockStatus OnUpdateMembershipLockStatusCallback)
 Locks/unlocks the membership of a room (the caller should be the room owner) to allow/disallow new members from being able to join the room. More...
 
bool UpdateOwner (const FString &RoomID, const FString &UserID, FRoomUpdateOwner OnUpdateOwnerCallback)
 Modifies the owner of the room, this person needs to be the person in this room. More...
 
bool UpdatePrivateRoomJoinPolicy (const FString &RoomID, ERoomJoinPolicy JoinPolicy, FRoomUpdatePrivateRoomJoinPolicy OnUpdatePrivateRoomJoinPolicyCallback)
 Sets the join policy for a specified private room. More...
 
bool GetNamedRooms (int PageIndex, int PageSize, FRoomGetNamedRooms OnGetNamedRoomsCallback)
 Fetches the list of named rooms created for the application. More...
 
bool JoinOrCreateNamedRoom (ERoomJoinPolicy JoinPolicy, bool CreateIfNotExist, uint32 MaxUsers, FPicoRoomOptions Options, FRoomJoinOrCreateNamedRoom OnRoomJoinOrCreateNamedRoomCallback)
 Join(Create) a named room. More...
 

Detailed Description

PicoRoomInterface class.

Member Function Documentation

◆ CreateAndJoinPrivate2()

bool CreateAndJoinPrivate2 ( ERoomJoinPolicy  JoinPolicy,
uint32  MaxUsers,
FPicoRoomOptions  RoomOptions,
FRoomCreateAndJoinPrivate2  OnCreateAndJoinPrivate2Callback 
)

Creates a new private room and joins it.

Note
This type of room can be obtained by querying the room where a friend is, so it is suitable for playing with friends.
Parameters
JoinPolicySpecifies who can join the room:
  • 0: nobody
  • 1: everybody
  • 2: friends of members
  • 3: friends of the room owner
  • 4: invited users
  • 5: unknown
MaxUsersThe maximum number of members allowed in the room, including the room creator.
RoomOptionsRoom configuration for this request.
OnCreateAndJoinPrivate2CallbackWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_Room *, Room).
Returns
Bool:
  • true: success
  • false: failure


◆ Get()

bool Get ( const FString &  RoomID,
FRoomGet  OnGetCallback 
)

Gets the information about a specified room.

Parameters
RoomIDThe ID of the room to get information for.
OnGetCallbackWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_Room *, Room).
Returns
Bool:
  • true: success
  • false: failure


◆ GetCurrent()

bool GetCurrent ( FRoomGetCurrent  OnGetCurrentCallback)

Gets the data of the room you are currently in.

Parameters
OnGetCurrentCallbackWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_Room *, Room).
Returns
Bool:
  • true: success
  • false: failure


◆ GetCurrentForUser()

bool GetCurrentForUser ( const FString &  UserId,
FRoomGetCurrentForUser  OnGetCurrentForUserCallback 
)

Gets the current room of the specified user.

Note
The user's privacy settings may not allow you to access their room.
Parameters
UserIdThe ID of the user.
OnGetCurrentForUserCallbackWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_Room *, Room).
Returns
Bool:
  • true: success
  • false: failure


◆ GetInvitableUsers2()

bool GetInvitableUsers2 ( FPicoRoomOptions  roomOptions,
FRoomGetInvitableUsers2  OnGetInvitableUsers2Callback 
)

Gets a list of members the user can invite to the room. These members are drawn from the user's friends list and recently encountered list, and filtered based on relevance and interests.

Parameters
roomOptionsAdditional configuration for this request. If you pass null, the response will return code 0.
OnGetInvitableUsers2CallbackWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_UserArray *, UserArray).
Returns
Bool:
  • true: success
  • false: failure


◆ GetModeratedRooms()

bool GetModeratedRooms ( int  PageIndex,
int  PageSize,
FRoomGetModeratedRooms  OnGetModeratedRoomsCallback 
)

Gets the list of moderated rooms created for the application. The payload returned is roomarray. The room info contained in roomarray does not include userlist info.

Parameters
indexStart page index.
sizePage entry number in response (should range from 5 to 20).
OnGetModeratedRoomsCallbackWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_RoomArray *, RoomArray).
Returns
Bool:
  • true: success
  • false: failure


◆ GetNamedRooms()

bool GetNamedRooms ( int  PageIndex,
int  PageSize,
FRoomGetNamedRooms  OnGetNamedRoomsCallback 
)

Fetches the list of named rooms created for the application.

Parameters
PageIndexStart page index.
PageSizepage entry number in response (should range in [5,20]).
OnGetNamedRoomsCallbackWill be executed when the request has been completed. Delegate will contain the requested object class.
Returns
Bool:
  • true: success
  • false: failure


◆ InviteUser()

bool InviteUser ( const FString &  RoomID,
const FString &  Token,
FRoomInviteUser  OnInviteUserCallback 
)

Invites a user to the current room.

Note
The user invited will receive a notification of type MessageType.Notification_Room_InviteReceived.
Parameters
roomIdThe ID of the room.
tokenThe user's invitation token, which is returned by RoomService.GetInvitableUsers2().
OnInviteUserCallbackWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_Room *, Room).
Returns
Bool:
  • true: success
  • false: failure


◆ Join2()

bool Join2 ( const FString &  RoomID,
FPicoRoomOptions  options,
FRoomJoin2  OnJoin2Callback 
)

Joins the target room and meanwhile leaves the current room.

Parameters
RoomIDThe ID of the room to join.
options(Optional) Additional room configuration for this request.
OnJoin2CallbackWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_Room *, Room).
Returns
Bool:
  • true: success
  • false: failure


◆ JoinOrCreateNamedRoom()

bool JoinOrCreateNamedRoom ( ERoomJoinPolicy  JoinPolicy,
bool  CreateIfNotExist,
uint32  MaxUsers,
FPicoRoomOptions  Options,
FRoomJoinOrCreateNamedRoom  OnRoomJoinOrCreateNamedRoomCallback 
)

Join(Create) a named room.

Parameters
JoinPolicySpecifies who can join the room. Currently only supports 'RoomJoinPolicy Everyone.'
CreateIfNotExistCreate a new room if the named room does not exist.
MaxUsersThe maximum number of users allowed in the room, including the creator.
OptionsAdditional room configuration for this request. Optional.
OnRoomJoinOrCreateNamedRoomCallbackWill be executed when the request has been completed. Delegate will contain the requested object class.
Returns
Bool:
  • true: success
  • false: failure


◆ KickUser()

bool KickUser ( const FString &  RoomID,
const FString &  UserID,
int  KickDurationSeconds,
FRoomKickUser  OnKickUserCallback 
)

Kicks a user out of a room. For use by homeowners only.

Parameters
RoomIDThe ID of the room.
UserIDThe ID of the user to be kicked (cannot be yourself).
kickDurationThe Length of the ban (in seconds).
OnKickUserCallbackWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_Room *, Room).
Returns
Bool:
  • true: success
  • false: failure


◆ LaunchInvitableUserFlow()

bool LaunchInvitableUserFlow ( const FString &  RoomID,
FRoomLaunchInvitableUserFlow  OnLaunchInvitableUserFlowCallback 
)

Launches the invitation flow to let the current user invite friends to a specified room. This launches the system default invite UI where the user can select friends to invite and then send invitations to them. Therefore, this is a shortcut if you do not want to build the invite UI by yourself.

Parameters
RoomIDThe ID of the room.
OnLaunchInvitableUserFlowCallbackWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, int, ErrorCode, const FString&, ErrorMessage).
Returns
Bool:
  • true: success
  • false: failure


◆ Leave()

bool Leave ( const FString &  RoomID,
FRoomLeave  OnLeaveCallback 
)

Leaves the current room.

Note
The room you are now in will be returned if the request succeeds.
Parameters
RoomIDThe ID of the room.
OnLeaveCallbackWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_Room *, Room).
Returns
Bool:
  • true: success
  • false: failure


◆ SetDescription()

bool SetDescription ( const FString &  RoomID,
const FString &  Description,
FRoomSetDescription  OnSetDescriptionCallback 
)

Sets the description of a room. For use by homeowners only.

Parameters
RoomIDThe ID of the room to set description for.
DescriptionThe new description of the room.
OnSetDescriptionCallbackWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_Room *, Room).
Returns
Bool:
  • true: success
  • false: failure


◆ UpdateDataStore()

bool UpdateDataStore ( const FString &  RoomID,
const TMap< FString, FString > &  Data,
FRoomUpdateDataStore  OnUpdateDataStoreCallback 
)

Updates the data store of the current room (the caller should be the room owner).

Note
Room data stores only allow string values. The maximum key length is 32 bytes and the maximum value length is 64 bytes. If you provide illegal values, this method will return an error.
Parameters
roomIdThe ID of the room that you currently own (call Room.OwnerOptional to check).
dataThe key/value pairs to add or update. Null value will clear a given key.
OnUpdateDataStoreCallbackWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_Room *, Room).
Returns
Bool:
  • true: success
  • false: failure


◆ UpdateMembershipLockStatus()

bool UpdateMembershipLockStatus ( const FString &  RoomID,
ERoomMembershipLockStatus  MembershipLockStatus,
FRoomUpdateMembershipLockStatus  OnUpdateMembershipLockStatusCallback 
)

Locks/unlocks the membership of a room (the caller should be the room owner) to allow/disallow new members from being able to join the room.

Note
Locking membership will prevent other users from joining the room through Join2(), invitations, etc. Users that are in the room at the time of lock will be able to rejoin.
Parameters
RoomIDThe ID of the room to lock/unlock membership for.
MembershipLockStatusThe new membership status to set for the room:
  • 0: Unknown
  • 1: lock
  • 2: unlock
OnUpdateMembershipLockStatusCallbackWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_Room *, Room).
Returns
Bool:
  • true: success
  • false: failure


◆ UpdateOwner()

bool UpdateOwner ( const FString &  RoomID,
const FString &  UserID,
FRoomUpdateOwner  OnUpdateOwnerCallback 
)

Modifies the owner of the room, this person needs to be the person in this room.

Parameters
RoomIDThe ID of the room to change ownership for.
UserIDThe ID of the new user to own the room. The new user must be in the same room.
OnUpdateOwnerCallbackWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, int, ErrorCode, const FString&, ErrorMessage).
Returns
Bool:
  • true: success
  • false: failure


◆ UpdatePrivateRoomJoinPolicy()

bool UpdatePrivateRoomJoinPolicy ( const FString &  RoomID,
ERoomJoinPolicy  JoinPolicy,
FRoomUpdatePrivateRoomJoinPolicy  OnUpdatePrivateRoomJoinPolicyCallback 
)

Sets the join policy for a specified private room.

Parameters
RoomIDThe ID of the room you want to set join policy for.
JoinPolicySpecifies who can join the room:
  • 0: nobody
  • 1: everybody
  • 2: friends of members
  • 3: friends of the room owner
  • 4: invited users
  • 5: unknown
OnUpdatePrivateRoomJoinPolicyCallbackWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_Room *, Room).
Returns
Bool:
  • true: success
  • false: failure