Functions - Group Presence¶
Related Oculus Platform documentation:
- https://developer.oculus.com/documentation/native/ps-group-presence-overview/
- https://developer.oculus.com/documentation/native/ps-multiplayer-overview
Functions¶
grouppresence_clear¶
grouppresence_clear()
Clears the group presence information for the current application/user.
Returns: A GDOculusPlatformPromise
that will contain a bool
which will always be true, if fulfilled. The promise will error if the request couldn't be completed.
grouppresence_send_invites¶
grouppresence_send_invites(user_ids : Array
)
Sends an invite to the specified users to join the current user session. Note that you must have ser the group presence information before to be allowed to send invites.
Returns: A GDOculusPlatformPromise
that will contain a Dictionary
which will contain a list of the invites that were sent, if fulfilled. The promise will error if the request couldn't be completed.
Example response:
More info about next_page_url.
Note
The recipient
and destination
can be empty Dictionaries
in some cases.
Example
grouppresence_set¶
grouppresence_set(options : Dictionary
)
Sets the information of the group presence for the current application/user. A list of options that can be included is shown bellow.
Returns: A GDOculusPlatformPromise
that will contain a bool
which will always be true, if fulfilled. The promise will error if the request couldn't be completed.
Available options:
Key | Type | Example value |
---|---|---|
deeplink_message_override | String | DEEPLINK_GO_TO_LOBBY |
destination_api_name | String | MY_AWESOME_DESTINATION |
lobby_session_id | String | some_lobby_id_147721 |
match_session_id | String | 41808448444_match |
is_joinable | bool | true |
Example
grouppresence_set_deeplink_message_override¶
grouppresence_set_deeplink_message_override(deeplink_message : String
)
Sets the user's deeplink message without changing the other group presence parameters. A destination must be set before using this function.
Returns: A GDOculusPlatformPromise
that will contain a bool
which will always be true, if fulfilled. The promise will error if the request couldn't be completed.
grouppresence_set_destination¶
grouppresence_set_destination(destination : String
)
Replaces the user's destination without chagind other group presence parameters.
Returns: A GDOculusPlatformPromise
that will contain a bool
which will always be true, if fulfilled. The promise will error if the request couldn't be completed.
grouppresence_set_is_joinable¶
grouppresence_set_destination(is_joinable : bool
)
Sets whether the current user's destination and session is joinable without changing other parameters. The destination or lobby/match session ID must be set before.
Returns: A GDOculusPlatformPromise
that will contain a bool
which will always be true, if fulfilled. The promise will error if the request couldn't be completed.
grouppresence_set_lobby_session¶
grouppresence_set_lobby_session(id : String
)
Replaces the user's lobby session ID without chagind other group presence parameters.
Returns: A GDOculusPlatformPromise
that will contain a bool
which will always be true, if fulfilled. The promise will error if the request couldn't be completed.
grouppresence_set_match_session¶
grouppresence_set_match_session(id : String
)
Replaces the user's match session ID without chagind other group presence parameters.
Returns: A GDOculusPlatformPromise
that will contain a bool
which will always be true, if fulfilled. The promise will error if the request couldn't be completed.
grouppresence_get_invitable_users¶
grouppresence_get_invitable_users(options : Dictionary
)
Requests a list of invitable users that can be invited to the current session. The list includes the user's bidirectional followers and other recently met users. The options
argument is optional, and a list of allowed keys and examples is shown bellow.
Returns: A GDOculusPlatformPromise
that will contain a Dictionary
with two keys: data
and next_page_url
. The data
key will contain a list of users, if fulfilled. The promise will error if the request couldn't be completed.
Available options for options
:
Key | Type | Example |
---|---|---|
suggested_users | Array of Strings | ["8110887962260", "2154895289701"] |
Each element of the suggested_users
Array
should be a user ID as a String
. Adding users to suggested_users
will add them to the invitable users list.
Note
Take a look at the example response and the note from the user_get_blocked_users function to know more details about the possible response from this function.
grouppresence_get_sent_invites¶
grouppresence_get_sent_invites()
Requests a list of invites sent by the current user.
Returns: A GDOculusPlatformPromise
that will contain a Dictionary
which will contain a list of the invites that have been sent by the user, if fulfilled. The promise will error if the request couldn't be completed.
Note
Take a look at the example response and the note from the grouppresence_send_invites function to know more details about the possible response from this function.
Example
grouppresence_launch_invite_panel¶
grouppresence_launch_invite_panel(options : Dictionary
)
Launches the invite panel to invite other users to join the current session. The options
argument is optional, and a list of allowed keys and examples is shown bellow.
Returns: A GDOculusPlatformPromise
that will contain a bool
that indicates if the user did invite other users or not, if fulfilled. The promise will error if the request couldn't be completed.
Available options for options
:
Key | Type | Example |
---|---|---|
suggested_users | Array of Strings | ["8110887962260", "2154895289701"] |
Each element of the suggested_users
Array
should be a user ID as a String
. Adding users to suggested_users
will add them to the invitable users list.
Example
grouppresence_launch_multiplayer_error_dialog¶
grouppresence_launch_multiplayer_error_dialog(error_key : MultiplayerErrorErrorKey
)
Shows an error dialog with a predefined message.
Returns: A GDOculusPlatformPromise
that will contain a bool
which will always be true, if fulfilled. The promise will error if the request couldn't be completed.
Enums:
MultiplayerErrorErrorKey:
Name | Value | Description |
---|---|---|
MULTIPLAYER_ERR_KEY_DEST_UNAVAILABLE | 1 | Destination unavailable |
MULTIPLAYER_ERR_KEY_DLC_REQUIRED | 2 | A DLC is required |
MULTIPLAYER_ERR_KEY_GENERAL | 3 | Generic error message |
MULTIPLAYER_ERR_KEY_GROUP_FULL | 4 | The lobby/match is full |
MULTIPLAYER_ERR_KEY_INVITER_NOT_JOINABLE | 5 | The inviter cannot be joined |
MULTIPLAYER_ERR_KEY_LVL_NOT_HIGH_ENOUGH | 6 | User is not of high enough level |
MULTIPLAYER_ERR_KEY_LVL_NOT_UNLOCKED | 7 | The level has not been unlocked yet |
MULTIPLAYER_ERR_KEY_NETWORK_TIMEOUT | 8 | Network timed out |
MULTIPLAYER_ERR_KEY_NO_LONGER_AVAILABLE | 9 | The lobby/match/invite is not longer valid or available |
MULTIPLAYER_ERR_KEY_UPDATE_REQUIRED | 10 | An update is required |
MULTIPLAYER_ERR_KEY_TUTORIAL_REQUIRED | 11 | Completing the tutorial is required |
Example
grouppresence_launch_rejoin_dialog¶
grouppresence_launch_rejoin_dialog(lobby_session_id : String
, match_session_id : String
, destination_api_name : String
)
Launches a rejoin dialog to allow the user to rejoin a previous session from a lobby/match ID. lobby_session_id
and/or match_session_id
must be set, but if you only use one and not the other, you can pass an empty String
as the parameter.
Returns: A GDOculusPlatformPromise
that will contain a bool
which will indicate if the user decided to rejoin or not, if fulfilled. The promise will error if the request couldn't be completed.
Example
grouppresence_launch_roster_panel¶
grouppresence_launch_roster_panel(options : Dictionary
)
Launches the roster panel which displays the current user in the roster and also users in the same session. The options
argument is optional, and a list of allowed keys and examples is shown bellow.
Returns: A GDOculusPlatformPromise
that will contain a bool
which will always be true, if fulfilled. The promise will error if the request couldn't be completed.
Available options for options
:
Key | Type | Example |
---|---|---|
suggested_users | Array of Strings | ["8110887962260", "2154895289701"] |
Each element of the suggested_users
Array
should be a user ID as a String
. Adding users to suggested_users
will add them to the invitable users list (the user can invite other users from the roster panel as well).