Loading...
Searching...
No Matches
AccelByte.Api.LobbyWebsocketApi Class Reference

Public Member Functions

delegate T NotificationPayloadModifier< T > (T payload)
 LobbyWebsocketApi (CoroutineRunner inCoroutineRunner, string inWebsocketUrl, IWebSocket inWebsocket, UserSession inSession, string inNamespace)
void OverrideWebsocket (IWebSocket inWebSocket, int inPingDelay=4000, int inBackoffDelay=1000, int inMaxDelay=30000, int inTotalTimeout=60000)
void SetLogger (IDebugger logger)
void Connect ()
 Connect to lobby with current logged in user credentials. The token generator need to be set for connection with entitlement verification.
void SetRetryParameters (int inTotalTimeout=60000, int inBackoffDelay=1000, int inMaxDelay=30000)
 Change the delay parameters to maintain connection in the lobby before lobby connected.
void SetConnectionTokenGenerator (ITokenGenerator tokenGenerator)
 TokenGenerator is used for generate access token when connecting to lobby. If token generator is not specified, no token will be used when connecting to lobby. For entitlement token verification, use EntitlementTokenGenerator class on the parameter.
void Disconnect ()
 Disconnect from Lobby.
void HandleNotification< T > (string message, ResultCallback< T > handler, NotificationPayloadModifier< T > modifier=null)
void HandleUserStatusNotif (string message, ResultCallback< FriendsStatusNotif > handler)
void DispatchNotification< T > (T notification, ResultCallback< T > handler)
void HandleResponse (long messageId, string message, ErrorCode errorCode)
void ChangeUserRegion (string region, ResultCallback callback)
 Change user region.
void GetPartyInfo (ResultCallback< PartyInfo > callback)
 Get party information (leader, members, invitation token).
void CreateParty (ResultCallback< PartyInfo > callback)
 Create a party and become a party leader for the party. The newer function has different struct return callback and it has partyCode.
void CreateParty (ResultCallback< PartyCreateResponse > callback)
 Create a party and become a party leader for the party. PartyCode is also provided to the party creator through the callback?.
void LeaveParty (ResultCallback callback)
 Leave a party a current logged in user is in.
void InviteToParty (string userId, ResultCallback callback)
 Invite other user by userId. Only party leader (creator) can invite other user.
void InviteToPartyDetailedCallback (string userId, ResultCallback< PartyInviteResponse > callback)
 Invite other user by userId with detailed model in response callback?. Only party leader (creator) can invite other user.
void JoinParty (string partyID, string invitationToken, ResultCallback< PartyInfo > callback)
 Join a party by invitation from party leader.
void KickPartyMember (string userId, ResultCallback callback)
 Kick a member out of our party. Only a party leader can kick a party member.
void KickPartyMemberDetailedCallback (string userId, ResultCallback< KickResponse > callback)
 Kick a member out of our party with detailed model in response callback?. Only a party leader can kick a party member.
void RejectPartyInvitation (string partyId, string invitationToken, ResultCallback< PartyRejectResponse > callback)
 Reject a party invitation.
void GeneratePartyCode (ResultCallback< PartyGenerateCodeResponse > callback)
 Generate party code for invitation.
void GetPartyCode (ResultCallback< PartyGetCodeResponse > callback)
 Get party code.
void DeletePartyCode (ResultCallback callback)
 Remove party invite code.
void JoinPartyViaCode (string invitationPartyCode, ResultCallback< PartyInfo > callback)
 Join to a party via party code.
void PromotePartyLeader (string userId, ResultCallback< PartyPromoteLeaderResponse > callback)
 Promote member to be a party leader.
void SendNotificationToPartyMember (string topic, string payload, ResultCallback< PartySendNotifResponse > callback)
 Send notification to party member.
void SendPartyChat (string chatMessage, ResultCallback callback)
 Send chat to other party members.
void SendPersonalChat (string userId, string chatMessage, ResultCallback callback)
 Send personal chat to friend.
void JoinDefaultChatChannel (ResultCallback< ChatChannelSlug > callback)
 Send Join default global chat channel request.
void SendChannelChat (string chatMessage, ResultCallback callback)
 Send a Chat Message to a Global Chat Channel.
void SetUserStatus (UserStatus status, string activity, ResultCallback callback)
 Set current user status and activity.
void ListFriendsStatus (ResultCallback< FriendsStatus > callback)
 Get a list of friends status (availability, activity, last seen at).
void PullAsyncNotifications (ResultCallback callback)
 Ask lobby to send all pending notification to user. Listen to OnNotification.
void RequestFriend (string userId, ResultCallback callback)
 Send request friend request.
void RequestFriendByPublicId (string publicId, ResultCallback callback)
 Send request friend request using other profile's public id.
void Unfriend (string userId, ResultCallback callback)
 Send unfriend request.
void ListOutgoingFriends (ResultCallback< Friends > callback)
 Send list of outgoing friends request.
void ListOutgoingFriendsWithTime (ResultCallback< FriendsWithTimestamp > callback)
 Send list of outgoing friends request with additional timestamp.
void CancelFriendRequest (string userId, ResultCallback callback)
 Send cancel friend request.
void ListIncomingFriends (ResultCallback< Friends > callback)
 Send list of incoming friends request.
void ListIncomingFriendsWithTime (ResultCallback< FriendsWithTimestamp > callback)
 Send list of incoming friends request with additional timestamp.
void AcceptFriend (string userId, ResultCallback callback)
 Send accept friend request.
void RejectFriend (string userId, ResultCallback callback)
 Send reject friend request.
void LoadFriendsList (ResultCallback< Friends > callback)
 Send load friends list request.
void GetFriendshipStatus (string userId, ResultCallback< FriendshipStatus > callback)
 Send get friendship status request.
void StartMatchmaking (string gameMode, MatchmakingOptionalParam param, ResultCallback< MatchmakingCode > callback)
 Send matchmaking start request.
void ConfirmReadyForMatch (string matchId, ResultCallback callback)
 Send a message to matchmaking service to indicate the user is ready for match.
void RejectMatch (string matchId, ResultCallback callback)
 Reject match that was found.
void CancelMatchmaking (string gameMode, ResultCallback< MatchmakingCode > callback)
 Send matchmaking cancel request.
void CancelMatchmaking (string gameMode, bool isTempParty, ResultCallback< MatchmakingCode > callback)
 Send matchmaking cancel request.
void RequestDS (CustomDsCreateRequest request)
 Request Dedicated Custom Server.
void BlockPlayer (string userId, ResultCallback< BlockPlayerResponse > callback)
 Block the specified player from doing some action against current user. The specified player will be removed from current user's friend list too.
void UnblockPlayer (string userId, ResultCallback< UnblockPlayerResponse > callback)
 Unblock the specified player and allow it to some action against current user again.
void SetProfanityFilterLevel (ProfanityFilterLevel level, ResultCallback callback)
void SetSessionAttribute (string key, string value, ResultCallback callback)
void GetSessionAttribute (string key, ResultCallback< GetSessionAttributeResponse > callback)
void GetSessionAttributeAll (ResultCallback< GetSessionAttributeAllResponse > callback)
void SendSignalingMessage (string userId, string message)
 Send a signaling message to another user.
void RefreshToken (string newAccessToken, ResultCallback callback)

Properties

AccelByteWebSocket WebSocket [get]
bool IsConnected [get]
 Lobby connection status.

Events

OnOpenHandler OnOpen
 Raised when websocket successfully opened connection.
OnCloseHandler OnClose
 Raised when websocket closed connection.
OnMessageHandler OnMessage
 Raised when websocket received a message.
OnErrorHandler OnError
 Raised when websocket connection has an error.

Member Function Documentation

◆ AcceptFriend()

void AccelByte.Api.LobbyWebsocketApi.AcceptFriend ( string userId,
ResultCallback callback )
inline

Send accept friend request.

Parameters
userIdTargeted user ID.
callbackResult of the function.

◆ BlockPlayer()

void AccelByte.Api.LobbyWebsocketApi.BlockPlayer ( string userId,
ResultCallback< BlockPlayerResponse > callback )
inline

Block the specified player from doing some action against current user. The specified player will be removed from current user's friend list too.

Actions that prevented to do each other:

  • add friend
  • direct chat
  • invite to party
  • invite to group
  • matchmaking result as one alliance

Additional limitation:

  • blocked player cannot access blocker/current user's UserProfile.
Parameters
userIdBlocked user's user ID
callbackReturns a result via callback when completed

◆ CancelFriendRequest()

void AccelByte.Api.LobbyWebsocketApi.CancelFriendRequest ( string userId,
ResultCallback callback )
inline

Send cancel friend request.

Parameters
userIdTargeted user ID.
callbackReturns a Result via callback when completed.

◆ CancelMatchmaking() [1/2]

void AccelByte.Api.LobbyWebsocketApi.CancelMatchmaking ( string gameMode,
bool isTempParty,
ResultCallback< MatchmakingCode > callback )
inline

Send matchmaking cancel request.

Parameters
gameModeTarget matchmaking game mode
isTempPartyIs using temp party when starting matchmaking
callbackResult of the function with a cancel matchmaking status code.

◆ CancelMatchmaking() [2/2]

void AccelByte.Api.LobbyWebsocketApi.CancelMatchmaking ( string gameMode,
ResultCallback< MatchmakingCode > callback )
inline

Send matchmaking cancel request.

Parameters
gameModeTarget matchmaking game mode
callbackResult of the function with a cancel matchmaking status code.

◆ ChangeUserRegion()

void AccelByte.Api.LobbyWebsocketApi.ChangeUserRegion ( string region,
ResultCallback callback )
inline

Change user region.

Parameters
regionNew region
callbackReturns a result via callback when completed

◆ ConfirmReadyForMatch()

void AccelByte.Api.LobbyWebsocketApi.ConfirmReadyForMatch ( string matchId,
ResultCallback callback )
inline

Send a message to matchmaking service to indicate the user is ready for match.

Parameters
matchIdmatch Id that was found
callbackReturns a Result via callback when completed

◆ CreateParty() [1/2]

void AccelByte.Api.LobbyWebsocketApi.CreateParty ( ResultCallback< PartyCreateResponse > callback)
inline

Create a party and become a party leader for the party. PartyCode is also provided to the party creator through the callback?.

Parameters
callbackReturns a Result that contain PartyCreateResponse via callback when completed.

◆ CreateParty() [2/2]

void AccelByte.Api.LobbyWebsocketApi.CreateParty ( ResultCallback< PartyInfo > callback)
inline

Create a party and become a party leader for the party. The newer function has different struct return callback and it has partyCode.

Parameters
callbackReturns a Result that contain PartyInfo via callback when completed.

◆ DeletePartyCode()

void AccelByte.Api.LobbyWebsocketApi.DeletePartyCode ( ResultCallback callback)
inline

Remove party invite code.

Parameters
callback

◆ DispatchNotification< T >()

void AccelByte.Api.LobbyWebsocketApi.DispatchNotification< T > ( T notification,
ResultCallback< T > handler )
inline
Type Constraints
T :class 
T :new() 

◆ GeneratePartyCode()

void AccelByte.Api.LobbyWebsocketApi.GeneratePartyCode ( ResultCallback< PartyGenerateCodeResponse > callback)
inline

Generate party code for invitation.

Parameters
callbackReturn the party code that has been generated if success

◆ GetFriendshipStatus()

void AccelByte.Api.LobbyWebsocketApi.GetFriendshipStatus ( string userId,
ResultCallback< FriendshipStatus > callback )
inline

Send get friendship status request.

Parameters
userIdTargeted user ID.
callbackReturns a Result that contains FriendshipStatus via callback when completed.

◆ GetPartyCode()

void AccelByte.Api.LobbyWebsocketApi.GetPartyCode ( ResultCallback< PartyGetCodeResponse > callback)
inline

Get party code.

Parameters
callbackReturn the party code that has been generated previously if success

◆ GetPartyInfo()

void AccelByte.Api.LobbyWebsocketApi.GetPartyInfo ( ResultCallback< PartyInfo > callback)
inline

Get party information (leader, members, invitation token).

Parameters
callbackReturns a Result that contains PartyInfo via callback when completed.

◆ HandleNotification< T >()

void AccelByte.Api.LobbyWebsocketApi.HandleNotification< T > ( string message,
ResultCallback< T > handler,
NotificationPayloadModifier< T > modifier = null )
inline
Type Constraints
T :class 
T :new() 

◆ InviteToParty()

void AccelByte.Api.LobbyWebsocketApi.InviteToParty ( string userId,
ResultCallback callback )
inline

Invite other user by userId. Only party leader (creator) can invite other user.

Parameters
userIdUser Id of a person to be invited to
callbackReturns a Result via callback when completed

◆ InviteToPartyDetailedCallback()

void AccelByte.Api.LobbyWebsocketApi.InviteToPartyDetailedCallback ( string userId,
ResultCallback< PartyInviteResponse > callback )
inline

Invite other user by userId with detailed model in response callback?. Only party leader (creator) can invite other user.

Parameters
userIdUser Id of a person to be invited to
callbackReturns a Result that contain PartyInviteResponse via callback when completed

◆ JoinDefaultChatChannel()

void AccelByte.Api.LobbyWebsocketApi.JoinDefaultChatChannel ( ResultCallback< ChatChannelSlug > callback)
inline

Send Join default global chat channel request.

Parameters
callbackReturns a Result that contains ChatChannelSlug via callback when completed.

◆ JoinParty()

void AccelByte.Api.LobbyWebsocketApi.JoinParty ( string partyID,
string invitationToken,
ResultCallback< PartyInfo > callback )
inline

Join a party by invitation from party leader.

Parameters
partyIDParty ID of the party to join to
invitationTokenInvitation token to join the party
callbackReturns a Result that contains PartyInfo via callback when completed

◆ JoinPartyViaCode()

void AccelByte.Api.LobbyWebsocketApi.JoinPartyViaCode ( string invitationPartyCode,
ResultCallback< PartyInfo > callback )
inline

Join to a party via party code.

Parameters
callback

◆ KickPartyMember()

void AccelByte.Api.LobbyWebsocketApi.KickPartyMember ( string userId,
ResultCallback callback )
inline

Kick a member out of our party. Only a party leader can kick a party member.

Parameters
userIdUser Id of the user to be kicked out of party
callbackReturns a Result via callback when completed.

◆ KickPartyMemberDetailedCallback()

void AccelByte.Api.LobbyWebsocketApi.KickPartyMemberDetailedCallback ( string userId,
ResultCallback< KickResponse > callback )
inline

Kick a member out of our party with detailed model in response callback?. Only a party leader can kick a party member.

Parameters
userIdUser Id of the user to be kicked out of party
callbackReturns a Result that contains PartyKickResponse via callback when completed.

◆ LeaveParty()

void AccelByte.Api.LobbyWebsocketApi.LeaveParty ( ResultCallback callback)
inline

Leave a party a current logged in user is in.

Parameters
callbackReturns a Result via callback when completed

◆ ListFriendsStatus()

void AccelByte.Api.LobbyWebsocketApi.ListFriendsStatus ( ResultCallback< FriendsStatus > callback)
inline

Get a list of friends status (availability, activity, last seen at).

Parameters
callbackReturns a Result that contains Friends Status via callback when completed.

◆ ListIncomingFriends()

void AccelByte.Api.LobbyWebsocketApi.ListIncomingFriends ( ResultCallback< Friends > callback)
inline

Send list of incoming friends request.

Parameters
callbackReturns a Result that contains Friends via callback when completed.

◆ ListIncomingFriendsWithTime()

void AccelByte.Api.LobbyWebsocketApi.ListIncomingFriendsWithTime ( ResultCallback< FriendsWithTimestamp > callback)
inline

Send list of incoming friends request with additional timestamp.

Parameters
callbackReturns a Result that contains FriendsWithTimestamp via callback when completed.

◆ ListOutgoingFriends()

void AccelByte.Api.LobbyWebsocketApi.ListOutgoingFriends ( ResultCallback< Friends > callback)
inline

Send list of outgoing friends request.

Parameters
callbackReturns a Result that contains Friends via callback when completed.

◆ ListOutgoingFriendsWithTime()

void AccelByte.Api.LobbyWebsocketApi.ListOutgoingFriendsWithTime ( ResultCallback< FriendsWithTimestamp > callback)
inline

Send list of outgoing friends request with additional timestamp.

Parameters
callbackReturns a Result that contains FriendsWithTimestamp via callback when completed.

◆ LoadFriendsList()

void AccelByte.Api.LobbyWebsocketApi.LoadFriendsList ( ResultCallback< Friends > callback)
inline

Send load friends list request.

Parameters
callbackReturns a Result that contains Friends via callback when completed.

◆ NotificationPayloadModifier< T >()

delegate T AccelByte.Api.LobbyWebsocketApi.NotificationPayloadModifier< T > ( T payload)
Type Constraints
T :class 
T :new() 

◆ PromotePartyLeader()

void AccelByte.Api.LobbyWebsocketApi.PromotePartyLeader ( string userId,
ResultCallback< PartyPromoteLeaderResponse > callback )
inline

Promote member to be a party leader.

Parameters
userIdUser ID that will be promoted as a party leader.
callbackReturns a Result via callback when completed.

◆ PullAsyncNotifications()

void AccelByte.Api.LobbyWebsocketApi.PullAsyncNotifications ( ResultCallback callback)
inline

Ask lobby to send all pending notification to user. Listen to OnNotification.

Parameters
callbackReturns a Result via callback when completed.

◆ RejectFriend()

void AccelByte.Api.LobbyWebsocketApi.RejectFriend ( string userId,
ResultCallback callback )
inline

Send reject friend request.

Parameters
userIdTargeted user ID.
callbackResult of the function.

◆ RejectMatch()

void AccelByte.Api.LobbyWebsocketApi.RejectMatch ( string matchId,
ResultCallback callback )
inline

Reject match that was found.

Parameters
matchIdmatch Id we want to reject.
callbackReturns a Result via callback when completed.

◆ RejectPartyInvitation()

void AccelByte.Api.LobbyWebsocketApi.RejectPartyInvitation ( string partyId,
string invitationToken,
ResultCallback< PartyRejectResponse > callback )
inline

Reject a party invitation.

Parameters
partyIdParty ID of an incoming party invitation that will be declined.
invitationTokenInvitation token of an incoming party invitation that will be declined.
callbackReturns a Result via callback when completed.

◆ RequestDS()

void AccelByte.Api.LobbyWebsocketApi.RequestDS ( CustomDsCreateRequest request)
inline

Request Dedicated Custom Server.

Parameters
requestSpecification
callback

◆ RequestFriend()

void AccelByte.Api.LobbyWebsocketApi.RequestFriend ( string userId,
ResultCallback callback )
inline

Send request friend request.

Parameters
userIdTargeted user ID.
callbackReturns a Result via callback when completed.

◆ RequestFriendByPublicId()

void AccelByte.Api.LobbyWebsocketApi.RequestFriendByPublicId ( string publicId,
ResultCallback callback )
inline

Send request friend request using other profile's public id.

Parameters
publicIdTargeted user ID.
callbackReturns a Result via callback when completed.

◆ SendChannelChat()

void AccelByte.Api.LobbyWebsocketApi.SendChannelChat ( string chatMessage,
ResultCallback callback )
inline

Send a Chat Message to a Global Chat Channel.

Parameters
chatMessageMessage to send to the channel
callbackReturns a Result via callback when completed

◆ SendNotificationToPartyMember()

void AccelByte.Api.LobbyWebsocketApi.SendNotificationToPartyMember ( string topic,
string payload,
ResultCallback< PartySendNotifResponse > callback )
inline

Send notification to party member.

Parameters
topicTopic The topic of the request. Can use this as ID to know how to marshal the payload
payloadPayload The Payload of the request. Can be JSON string
callbackReturns a Result that contains PartySendNotifResponse via callback when completed.

◆ SendPartyChat()

void AccelByte.Api.LobbyWebsocketApi.SendPartyChat ( string chatMessage,
ResultCallback callback )
inline

Send chat to other party members.

Parameters
chatMessageMessage to send to party
callbackReturns a Result via callback when completed

◆ SendPersonalChat()

void AccelByte.Api.LobbyWebsocketApi.SendPersonalChat ( string userId,
string chatMessage,
ResultCallback callback )
inline

Send personal chat to friend.

Parameters
userIdFriend user id
chatMessageMessage to send to friend
callbackReturns a Result via callback when completed

◆ SendSignalingMessage()

void AccelByte.Api.LobbyWebsocketApi.SendSignalingMessage ( string userId,
string message )
inline

Send a signaling message to another user.

Parameters
userIdThe recipient's user ID.
messageSignaling message to be sent.

◆ SetConnectionTokenGenerator()

void AccelByte.Api.LobbyWebsocketApi.SetConnectionTokenGenerator ( ITokenGenerator tokenGenerator)
inline

TokenGenerator is used for generate access token when connecting to lobby. If token generator is not specified, no token will be used when connecting to lobby. For entitlement token verification, use EntitlementTokenGenerator class on the parameter.

Parameters
tokenGeneratorToken generator for connecting lobby.

◆ SetRetryParameters()

void AccelByte.Api.LobbyWebsocketApi.SetRetryParameters ( int inTotalTimeout = 60000,
int inBackoffDelay = 1000,
int inMaxDelay = 30000 )
inline

Change the delay parameters to maintain connection in the lobby before lobby connected.

Parameters
inTotalTimeoutTime limit until stop to re-attempt
inBackoffDelayInitial delay time
inMaxDelayMaximum delay time

◆ SetUserStatus()

void AccelByte.Api.LobbyWebsocketApi.SetUserStatus ( UserStatus status,
string activity,
ResultCallback callback )
inline

Set current user status and activity.

Parameters
statusUser status (Online, Available, Busy, Invisible)
activityDescribe an activity of the user, could be anything.
callbackReturns a Result via callback when completed.

◆ StartMatchmaking()

void AccelByte.Api.LobbyWebsocketApi.StartMatchmaking ( string gameMode,
MatchmakingOptionalParam param,
ResultCallback< MatchmakingCode > callback )
inline

Send matchmaking start request.

Parameters
gameModegame mode to use
paramoptional matchmaking parameter
callbackReturns a Result via callback when completed

◆ UnblockPlayer()

void AccelByte.Api.LobbyWebsocketApi.UnblockPlayer ( string userId,
ResultCallback< UnblockPlayerResponse > callback )
inline

Unblock the specified player and allow it to some action against current user again.

Allow each other to:

  • add friend
  • direct chat
  • invite to party
  • invite to group
  • matchmaking result as one alliance

Additional limitation:

  • unblocked player can access blocker/current user's UserProfile.
Parameters
userIdUnblocked user's user ID
callbackReturns a result via callback when completed

◆ Unfriend()

void AccelByte.Api.LobbyWebsocketApi.Unfriend ( string userId,
ResultCallback callback )
inline

Send unfriend request.

Parameters
userIdTargeted user ID.
callbackReturns a Result via callback when completed.