Diarkis C++Client Library API Document
DiarkisMatchMakerBase Class Reference

Base class that wraps the IDiarkisMatchMaker class for easy use of MatchMaker functionality. More...

#include <DiarkisMatchMakerBase.h>

Collaboration diagram for DiarkisMatchMakerBase:

Public Member Functions

 DiarkisMatchMakerBase ()
 DiarkisMatchMakerBase constructor. More...
 
virtual ~DiarkisMatchMakerBase ()
 DiarkisMatchMakerBase destructor. More...
 
virtual void SetupTcpMatchMaker (const std::shared_ptr< IDiarkisTcp > &tcp, const std::shared_ptr< LoggerFactory > &loggerFactory)
 Set up MatchMaker with TCP protocol. More...
 
virtual void SetupUdpMatchMaker (const std::shared_ptr< IDiarkisUdp > &udp, const std::shared_ptr< LoggerFactory > &loggerFactory, const std::shared_ptr< DiarkisP2PBase > &p2pBase)
 Setup MatchMaker with UDP protocol. More...
 
void SetRoomModule (const std::shared_ptr< IDiarkisRoom > &room)
 Set the Room module. More...
 
virtual bool SendHostMatchmaking (const char *uid, uint16_t maxMembers, uint16_t ttl, const char *profileID, const char *tag, const MatchMakerCondition *conditions, size_t conditionsCount, const uint8_t *metadata, size_t metadataSize, bool bReserveOnly)
 Starts matchmaking as host. More...
 
virtual bool SendHostMatchmaking (const std::string &uid, uint16_t maxMembers, uint16_t ttl, const std::string &profileID, const std::string &tag, const std::vector< MatchMakerCondition > &conditions, const std::vector< uint8_t > &metadata, bool bReserveOnly)
 Same as SendHostMatchmaking() More...
 
virtual void SendAbortMatchmaking (void)
 You will be excluded from the matchmaking search. Matchmaking is not destroyed and participating members remain. More...
 
virtual void SendDisbandMatchmaking (const uint8_t *message, size_t messageSize)
 Discard current matchmaking. Participating users will be dismissed. More...
 
virtual void SendDisbandMatchmaking (const std::vector< uint8_t > &message)
 Same as SendDisbandMatchmaking() More...
 
virtual void SendClaimReservedMatchmaking (const uint8_t *message, size_t messageSize)
 Participate in a reserved matching as a host. More...
 
virtual void SendClaimReservedMatchmaking (const std::vector< uint8_t > &message)
 Same as SendClaimReservedMatchmaking() More...
 
virtual void SendJoinMatchmakingFromResult (MatchMakerResultItem &result, const uint8_t *message, size_t messageSize)
 Participate in matchmaking as a guest using the results of matchmaking. More...
 
virtual void SendJoinMatchmakingFromResult (MatchMakerResultItem &result, const std::vector< uint8_t > &message)
 Same as SendJoinMatchmakingFromResult() More...
 
virtual void SendLeaveMatchmaking (const uint8_t *message, size_t messageSize)
 Exit from matchmaking in which you are a guest. More...
 
virtual void SendLeaveMatchmaking (const std::vector< uint8_t > &message)
 Same as SendLeaveMatchmaking() More...
 
virtual void SendSync (const uint8_t *message, size_t messageSize)
 マッチしたメンバーにメッセージを送信します。 More...
 
virtual void SendSync (const std::vector< uint8_t > &message)
 Same as SendSync() More...
 
virtual void SendNotifyMatchmakingCompletion (void)
 Notifies all matching clients that matchmaking is complete. More...
 
virtual void SendP2PAddressSync (uint8_t linkedClients=0)
 Notifies matched members that a P2P connection has been initiated. More...
 
virtual void SendSearch (const char **profileIDs, size_t profileIDsCount, const char *tag, const MatchMakerCondition *conditions, size_t conditionsCount, bool joinFlag, uint16_t howmany, const uint8_t *message, size_t messageSize)
 Search for matchmaking using profile IDs. More...
 
virtual void SendSearch (const std::vector< std::string > &profileIDs, const std::string &tag, const std::vector< MatchMakerCondition > &conditions, bool joinFlag, uint16_t howmany, const std::vector< uint8_t > &message)
 Same as SendSearch() More...
 
virtual bool SendStartBackfill (const char *roomID)
 Adds the specified room to the matching search. More...
 
virtual bool SendStartBackfill (const std::string &roomID)
 Same as SendStartBackfill() More...
 
virtual bool SendKick (const char *userID)
 Forces the specified user out of matchmaking. More...
 
virtual bool SendKick (const std::string &userID)
 Same as SendKick() More...
 
virtual bool SendHostTeamMatchmaking (const char *uid, uint16_t maxMembers, uint16_t ttl, const char *profileID, const char *tag, const MatchMakerCondition *conditions, size_t conditionsCount, const uint8_t *metadata, size_t metadataSize, bool bReserveOnly)
 Starts team matchmaking as host. More...
 
virtual bool SendHostTeamMatchmaking (const std::string &uid, uint16_t maxMembers, uint16_t ttl, const std::string &profileID, const std::string &tag, const std::vector< MatchMakerCondition > &conditions, const std::vector< uint8_t > &metadata, bool bReserveOnly)
 Same as SendHostTeamMatchmaking() More...
 
virtual void SendSearchTeamMatchmaking (const char **profileIDs, size_t profileIDsCount, const char *tag, const MatchMakerCondition *conditions, size_t conditionsCount, bool joinFlag, uint16_t howmany, const uint8_t *message, size_t messageSize)
 Search for matchmaking using profile IDs. More...
 
virtual void SendSearchTeamMatchmaking (const std::vector< std::string > &profileIDs, const std::string &tag, const std::vector< MatchMakerCondition > &conditions, bool joinFlag, uint16_t howmany, const std::vector< uint8_t > &message)
 Same as SendSearchTeamMatchmaking() More...
 
virtual void SendCommit (void)
 Notifies all matched team members to participate in team matchmaking. More...
 
virtual void SendIssueTicket (uint8_t ticketType)
 Requests the server to issue a ticket to initiate matchmaking. More...
 
virtual void SendTicketCancel (uint8_t ticketType)
 Cancels an issued matchmaking ticket. More...
 
virtual void SendTicketBroadcast (uint8_t ticketType, const uint8_t *message, size_t messageSize)
 Broadcast message to clients matched by ticket. More...
 
virtual void SendTicketBroadcast (uint8_t ticketType, const std::vector< uint8_t > &message)
 Same as SendTicketBroadcast() More...
 
virtual void SendTicketLeave (uint8_t ticketType)
 Exits the room created by the ticket. More...
 
Diarkis::StdString GetRoomID (void)
 Get Room ID. More...
 
const Diarkis::StdStringGetOwnerUID (void)
 Gets the owner UID of the matched member. More...
 
bool IsComplete (void)
 Whether matchmaking has been completed. More...
 
bool IsGotoRoom (void)
 Whether or not a message wasent to move to the game scene. More...
 
void ResetGotoRoom (void)
 Reset flag to move to game scene. More...
 
void ClearList (void)
 Empty the list of members. More...
 
const Diarkis::StdStringGetTicketMessage (void)
 Retrieves messages received when matching by ticket is completed. More...
 
const Diarkis::StdStringGetTicketBroadcastMessage (void)
 Retrieve received broadcast messages. More...
 
bool IsTicketComplete (void)
 Whether the ticket was completed or not. More...
 
bool IsTicketCancel (void)
 Whether the ticket was canceled or not. More...
 
void GetMatchingMemberList (Diarkis::StdVector< Diarkis::StdString > &memberList)
 Obtain matched members. More...
 
void GetTeamMatchingMemberList (Diarkis::StdVector< Diarkis::StdString > &memberList)
 Obtain matched members with team matching. More...
 
void SetOwnUID (const char *uid)
 Set your user ID. More...
 
void SetOwnUID (const std::string &uid)
 Same as SetOwnUID() More...
 

Protected Member Functions

virtual void OnHostMatchmaking (const DiarkisMMHostEventArgs &e)
 Callback function triggered when matching is initiated as host. More...
 
virtual void OnAbortMatchmaking (const DiarkisMMResponseEventArgs &e)
 Callback function triggered upon leaving the matching target. More...
 
virtual void OnDisbandMatchmaking (const DiarkisMMSyncEventArgs &e)
 Callback function triggered when a match is disbanded. More...
 
virtual void OnMemberLeave (const DiarkisMMSyncEventArgs &e)
 Callback function triggered when a matched member leaves the room. More...
 
virtual void OnMemberJoin (const DiarkisMMSyncEventArgs &e)
 Callback function triggered when another client successfully matches and enters. More...
 
virtual void OnMemberSync (const DiarkisMMSyncEventArgs &e)
 Callback function triggered when a message is sent from a matched member. More...
 
virtual void OnJoin (const DiarkisMMJoinResponseEventArgs &e)
 Callback function triggered upon joining a matchmaking. More...
 
virtual void OnLeave (const DiarkisMMResponseEventArgs &e)
 Callback function triggered when leaving a matchmaking. More...
 
virtual void OnComplete (void)
 Callback function triggered when a match is completed. More...
 
virtual void OnSearch (const DiarkisMMJoinResponseEventArgs &e)
 Callback function triggered when a matching search is completed. More...
 
virtual void OnResutls (const DiarkisMMResultEventArgs &e)
 Callback function called when the search for matching is complete. More...
 
virtual void OnP2PAddress (const DiarkisP2PEventArgs &e)
 Callback function triggered when starting P2P. More...
 
virtual void OnP2PResponse (const DiarkisMMResponseEventArgs &e)
 Callback function triggered when starting P2P. More...
 
virtual void OnBackfillEvent (const DiarkisMMResponseEventArgs &e)
 Callback function triggered when a room is added to the matching search. More...
 
virtual void OnKick (const DiarkisPayloadEventArgs &e)
 Callback function triggered when a host kicks a particular member out of matching. More...
 
virtual void OnKickResponse (const DiarkisMMResponseEventArgs &e)
 Callback function triggered on the host when the host kicks a particular member out of matching. More...
 
virtual void OnCommit (const DiarkisMMResponseEventArgs &e)
 Callback function called when host prompts participation in team matchmaking. More...
 
virtual void OnCompleteCommit (const DiarkisMMJoinResponseEventArgs &e)
 Callback function called on team members when Commit is executed. More...
 
virtual void OnTeamHostMatchmaking (const DiarkisMMHostEventArgs &e)
 Callback function triggered when team matching is initiated as host. More...
 
virtual void OnTeamSearch (const DiarkisMMJoinResponseEventArgs &e)
 Callback function triggered when a team matching search is completed. More...
 
virtual void OnTeamMemberJoin (const DiarkisMMSyncEventArgs &e)
 Callback function triggered when another client successfully matches and enters. More...
 
virtual void OnIssueTicketResponse (const DiarkisMMResponseEventArgs &e)
 Gets the event fired when a response to an IssueTicket is received from the server. More...
 
virtual void OnTicketComplete (const DiarkisMMResponseEventArgs &e)
 Callback function triggered when a ticket processed by IssueTicket is completed. More...
 
virtual void OnHostChange (const DiarkisMMStringEventArgs &e)
 Callback function triggered when matchmaking host changes. More...
 
virtual void OnTicketCancel (const DiarkisMMTicketTypeEventArgs &e)
 Callback function triggered when a TicketCancel is received. More...
 
virtual void OnTicketCancelResponse (const DiarkisMMResponseEventArgs &e)
 Callback function triggered when a TicketCancel response is received. More...
 
virtual void OnTicketBroadcastResponse (const DiarkisMMResponseEventArgs &e)
 Callback function triggered when a TicketBroadcast response is received. More...
 
virtual void OnTicketBroadcast (const DiarkisMMSyncEventArgs &e)
 Callback function triggered when a TicketBroadcast is received. More...
 
virtual void OnTicketLeave (const DiarkisMMResponseEventArgs &e)
 Callback function triggered when a TicketLeave response is received. More...
 
virtual void OnResponse (const DiarkisResponseEventArgs &args, DiarkisTransportType tt)
 Callback function triggered when a response is received from the server. More...
 
virtual void OnPush (const DiarkisPushEventArgs &args, DiarkisTransportType tt)
 Callback function triggered when a push is received from the server. More...
 

Protected Attributes

std::shared_ptr< IDiarkisMatchMakermm_
 Pointer to IDiarkisMatchMaker class. More...
 
std::shared_ptr< IDiarkisTcptcp_
 Pointer to IDiarkisTcp class. More...
 
std::shared_ptr< IDiarkisUdpudp_
 Pointer to IDiarkisUdp class. More...
 
std::shared_ptr< IDiarkisRoomroom_
 Pointer to IDiarkisRoom class. More...
 
std::shared_ptr< DiarkisP2PBasep2pBase_
 Pointer to DiarkisP2PBase class. More...
 
std::shared_ptr< IDiarkisLoggerlogger_
 Pointer to IDiarkisLogger class. More...
 
Diarkis::StdVector< std::function< void()> > eventUnsubscriptions_
 Lambda function control list. More...
 
Diarkis::StdVector< uint8_t > Buff_
 Buffer for transmission. More...
 
Diarkis::StdString myUid_
 My user ID. More...
 
Diarkis::StdString ownerUid_
 Matching owner's user ID. More...
 
Diarkis::StdString ticketBroadcastMessage_
 Message received on TicketBroadcast. More...
 
std::recursive_mutex list_mutex_
 list mutex More...
 
Diarkis::StdVector< Diarkis::StdStringmemberLists_
 User ID list of matched members. More...
 
Diarkis::StdVector< Diarkis::StdStringteamMemberLists_
 User ID list of team matched members. More...
 
bool bComplete_
 Whether matching has been completed. More...
 
bool bGotoRoom_
 Whether or not a message wasent to move to the game scene. More...
 
bool bTicketComplete_
 Whether ticket matching has been completed. More...
 
Diarkis::StdString ticketMessage_
 Message when matching by ticket is completed. More...
 
bool bTicketCancel_
 Whether matching by ticket was cancelled. More...
 
bool bTeamMatchOwner_
 Whether the owner who issued the TeamMatch Host or Search. More...
 

Detailed Description

Base class that wraps the IDiarkisMatchMaker class for easy use of MatchMaker functionality.

Constructor & Destructor Documentation

◆ DiarkisMatchMakerBase()

DiarkisMatchMakerBase::DiarkisMatchMakerBase ( )

DiarkisMatchMakerBase constructor.

◆ ~DiarkisMatchMakerBase()

DiarkisMatchMakerBase::~DiarkisMatchMakerBase ( )
virtual

DiarkisMatchMakerBase destructor.

Member Function Documentation

◆ SetupTcpMatchMaker()

void DiarkisMatchMakerBase::SetupTcpMatchMaker ( const std::shared_ptr< IDiarkisTcp > &  tcp,
const std::shared_ptr< LoggerFactory > &  loggerFactory 
)
virtual

Set up MatchMaker with TCP protocol.

Register loggers and callback functions.

Parameters
[in]tcpPointer to IDiarkisTcp class
[in]loggerFactoryPointer to logger class
Here is the call graph for this function:

◆ SetupUdpMatchMaker()

void DiarkisMatchMakerBase::SetupUdpMatchMaker ( const std::shared_ptr< IDiarkisUdp > &  udp,
const std::shared_ptr< LoggerFactory > &  loggerFactory,
const std::shared_ptr< DiarkisP2PBase > &  p2pBase 
)
virtual

Setup MatchMaker with UDP protocol.

Register loggers and callback functions.

Parameters
[in]udpPointer to IDiarkisUdp class
[in]loggerFactoryPointer to logger class
[in]p2pBasePointer to DiarkisP2PBase class
Here is the call graph for this function:

◆ SetRoomModule()

void DiarkisMatchMakerBase::SetRoomModule ( const std::shared_ptr< IDiarkisRoom > &  room)

Set the Room module.

Parameters
[in]roomPointer to IDiarkisRoom class

◆ SendHostMatchmaking() [1/2]

bool DiarkisMatchMakerBase::SendHostMatchmaking ( const char *  uid,
uint16_t  maxMembers,
uint16_t  ttl,
const char *  profileID,
const char *  tag,
const MatchMakerCondition conditions,
size_t  conditionsCount,
const uint8_t *  metadata,
size_t  metadataSize,
bool  bReserveOnly 
)
virtual

Starts matchmaking as host.

Callback events registered with GetHostEvent() (e.g. OnHostMatchmaking) will be triggered.

Parameters
[in]uidYour user ID
[in]maxMembersMaximum number of clients to match
[in]ttlTime (in seconds) before matchmaking is discarded.
[in]profileIDProfile ID of the matching
[in]tagmatching tag
[in]conditionsStructure that specifies conditions to match.
[in]conditionsCountLength of the conditionMap
[in]metadataOptional custom data passed to matchmaking search results
[in]metadataSizeLength of the metadata
[in]bReserveOnlyDetermines whether to join the room after the matching is complete.
true = After the matching is completed, only the reservation is made and you will not join the room.
false = After matching is completed, you will join a room with a member.
Here is the caller graph for this function:

◆ SendHostMatchmaking() [2/2]

bool DiarkisMatchMakerBase::SendHostMatchmaking ( const std::string &  uid,
uint16_t  maxMembers,
uint16_t  ttl,
const std::string &  profileID,
const std::string &  tag,
const std::vector< MatchMakerCondition > &  conditions,
const std::vector< uint8_t > &  metadata,
bool  bReserveOnly 
)
virtual

Same as SendHostMatchmaking()

Here is the call graph for this function:

◆ SendAbortMatchmaking()

void DiarkisMatchMakerBase::SendAbortMatchmaking ( void  )
virtual

You will be excluded from the matchmaking search. Matchmaking is not destroyed and participating members remain.

Triggers a callback event (e.g. OnAbortMatchmaking) registered with GetAbortEvent(). This function can only be called by the host.

◆ SendDisbandMatchmaking() [1/2]

void DiarkisMatchMakerBase::SendDisbandMatchmaking ( const uint8_t *  message,
size_t  messageSize 
)
virtual

Discard current matchmaking. Participating users will be dismissed.

A callback event (e.g. OnDisbandMatchmaking) registered with GetDisbandEvent() is triggered by the server.
This function can only be called by the host.

Parameters
[in]messageMessage sent to other matching clients
[in]messageSizeLength of the message
Here is the caller graph for this function:

◆ SendDisbandMatchmaking() [2/2]

void DiarkisMatchMakerBase::SendDisbandMatchmaking ( const std::vector< uint8_t > &  message)
virtual

Same as SendDisbandMatchmaking()

Here is the call graph for this function:

◆ SendClaimReservedMatchmaking() [1/2]

void DiarkisMatchMakerBase::SendClaimReservedMatchmaking ( const uint8_t *  message,
size_t  messageSize 
)
virtual

Participate in a reserved matching as a host.

If the attempt succeeds, the callback event (e.g. OnMemberJoin) registered with GetMemberJoinEvent() will be triggered
on all matching clients. SendHostMatchmaking() must be called with bReserveOnly=true.

Parameters
[in]messageMessage to send to other matching clients
[in]messageSizeLength of the message
Here is the caller graph for this function:

◆ SendClaimReservedMatchmaking() [2/2]

void DiarkisMatchMakerBase::SendClaimReservedMatchmaking ( const std::vector< uint8_t > &  message)
virtual

Same as SendClaimReservedMatchmaking()

Here is the call graph for this function:

◆ SendJoinMatchmakingFromResult() [1/2]

void DiarkisMatchMakerBase::SendJoinMatchmakingFromResult ( MatchMakerResultItem result,
const uint8_t *  message,
size_t  messageSize 
)
virtual

Participate in matchmaking as a guest using the results of matchmaking.

If successful, enter matchmaking (room).

Parameters
[in]resultStructure of matchmaking information
[in]messageMessage sent to other matching clients
[in]messageSizeLength of the message
Here is the caller graph for this function:

◆ SendJoinMatchmakingFromResult() [2/2]

void DiarkisMatchMakerBase::SendJoinMatchmakingFromResult ( MatchMakerResultItem result,
const std::vector< uint8_t > &  message 
)
virtual

Same as SendJoinMatchmakingFromResult()

Here is the call graph for this function:

◆ SendLeaveMatchmaking() [1/2]

void DiarkisMatchMakerBase::SendLeaveMatchmaking ( const uint8_t *  message,
size_t  messageSize 
)
virtual

Exit from matchmaking in which you are a guest.

Triggers a callback event (e.g. OnLeave) registered with GetLeaveEvent().

Parameters
[in]messageMessage sent to other matching clients
[in]messageSizeLength of the message
Here is the caller graph for this function:

◆ SendLeaveMatchmaking() [2/2]

void DiarkisMatchMakerBase::SendLeaveMatchmaking ( const std::vector< uint8_t > &  message)
virtual

Same as SendLeaveMatchmaking()

Here is the call graph for this function:

◆ SendSync() [1/2]

void DiarkisMatchMakerBase::SendSync ( const uint8_t *  message,
size_t  messageSize 
)
virtual

マッチしたメンバーにメッセージを送信します。

~@japanese

GetMemberSyncEvent() で登録されたコールバックイベント(例:OnMemberSync)がトリガーされます。

Parameters
[in]message他のマッチングクライアントに送信されるメッセージ
[in]messageSizeメッセージの長さ

Sends a message to the matched member.

Callback event (e.g. OnMemberSync) registered with GetMemberSyncEvent() will be triggered.

Parameters
[in]messageMessage sent to other matching clients
[in]messageSizeLength of the message
Here is the caller graph for this function:

◆ SendSync() [2/2]

void DiarkisMatchMakerBase::SendSync ( const std::vector< uint8_t > &  message)
virtual

Same as SendSync()

Here is the call graph for this function:

◆ SendNotifyMatchmakingCompletion()

void DiarkisMatchMakerBase::SendNotifyMatchmakingCompletion ( void  )
virtual

Notifies all matching clients that matchmaking is complete.

Triggers a callback event (e.g. OnComplete) registered with GetCompleteEvent() to all members including yourself.
This function can only be called by the host.

◆ SendP2PAddressSync()

void DiarkisMatchMakerBase::SendP2PAddressSync ( uint8_t  linkedClients = 0)
virtual

Notifies matched members that a P2P connection has been initiated.

Triggers a callback event (e.g. OnP2PAddress) registered with GetP2PAddressEvent() on all members including yourself.
You will receive a list of addresses of members matched in the callback event.
This function must be executed by only one of the matched members.

Parameters
[in]linkedClientsSpecifies the number of clients to establish a P2P connection.
0 = Receive addresses of all matched members.
n = Receive addresses of n randomly selected members from among the matched members.

◆ SendSearch() [1/2]

void DiarkisMatchMakerBase::SendSearch ( const char **  profileIDs,
size_t  profileIDsCount,
const char *  tag,
const MatchMakerCondition conditions,
size_t  conditionsCount,
bool  joinFlag,
uint16_t  howmany,
const uint8_t *  message,
size_t  messageSize 
)
virtual

Search for matchmaking using profile IDs.

Parameters
[in]profileIDsMultiple matching profiles can be used to search for matchmaking.
[in]profileIDsCountNumber of profiles
[in]tagSpecifies the tag to search. Matchmaking that specifies the same tag will be searched.
[in]conditionsSpecifies the condition to search.
[in]conditionsCountNumber of the conditions
[in]joinFlagDetermines whether to join the room after a match is made.
true = The client will automatically join the room; callback events registered with GetSearchEvent() (e.g. OnSearch) will be triggered.
false = The client will receive a list of search results; the callback event registered with GetResultsEvent() (e.g. OnResutls) will be triggered.
[in]howmanymatches in the search results
[in]messageMessage sent to other clients who matched
[in]messageSizeLength of the message
Here is the caller graph for this function:

◆ SendSearch() [2/2]

void DiarkisMatchMakerBase::SendSearch ( const std::vector< std::string > &  profileIDs,
const std::string &  tag,
const std::vector< MatchMakerCondition > &  conditions,
bool  joinFlag,
uint16_t  howmany,
const std::vector< uint8_t > &  message 
)
virtual

Same as SendSearch()

Here is the call graph for this function:

◆ SendStartBackfill() [1/2]

bool DiarkisMatchMakerBase::SendStartBackfill ( const char *  roomID)
virtual

Adds the specified room to the matching search.

A callback event (e.g. OnBackfillEvent) registered with GetBackfillEvent() will be triggered.
It is used to compensate members when a member leaves the room after the match has been finished.

Parameters
[in]roomIDRoom ID to be added to the matching search
Here is the caller graph for this function:

◆ SendStartBackfill() [2/2]

bool DiarkisMatchMakerBase::SendStartBackfill ( const std::string &  roomID)
virtual

Same as SendStartBackfill()

Here is the call graph for this function:

◆ SendKick() [1/2]

bool DiarkisMatchMakerBase::SendKick ( const char *  userID)
virtual

Forces the specified user out of matchmaking.

A callback event (e.g. OnKickResponse) registered with GetKickResponseEvent() will be triggered.
If the specified user is kicked, a callback event registered with GetKickEvent() (e.g. OnKick)
will be triggered for all matching users, including the kicked user. Only matchmaking hosts can execute kicks.

Parameters
[in]userIDUser ID of the user to kick
Here is the caller graph for this function:

◆ SendKick() [2/2]

bool DiarkisMatchMakerBase::SendKick ( const std::string &  userID)
virtual

Same as SendKick()

Here is the call graph for this function:

◆ SendHostTeamMatchmaking() [1/2]

bool DiarkisMatchMakerBase::SendHostTeamMatchmaking ( const char *  uid,
uint16_t  maxMembers,
uint16_t  ttl,
const char *  profileID,
const char *  tag,
const MatchMakerCondition conditions,
size_t  conditionsCount,
const uint8_t *  metadata,
size_t  metadataSize,
bool  bReserveOnly 
)
virtual

Starts team matchmaking as host.

Callback events registered with GetTeamHostEvent() (e.g. OnTeamHostMatchmaking) will be triggered.

Parameters
[in]uidYour user ID
[in]maxMembersSpecify the maximum number of people to be matched. The number of matches is the number of teams x the number of people in the team.
[in]ttlTime (in seconds) before matchmaking is discarded.
[in]profileIDProfile ID of the matching
[in]tagmatching tag
[in]conditionsStructure that specifies conditions to match.
[in]conditionsCountLength of the conditionMap
[in]metadataOptional custom data passed to matchmaking search results
[in]metadataSizeLength of the metadata
[in]bReserveOnlyDetermines whether to join the room after the matching is complete.
true = After the matching is completed, only the reservation is made and you will not join the room.
false = After matching is completed, you will join a room with a member.
Here is the caller graph for this function:

◆ SendHostTeamMatchmaking() [2/2]

bool DiarkisMatchMakerBase::SendHostTeamMatchmaking ( const std::string &  uid,
uint16_t  maxMembers,
uint16_t  ttl,
const std::string &  profileID,
const std::string &  tag,
const std::vector< MatchMakerCondition > &  conditions,
const std::vector< uint8_t > &  metadata,
bool  bReserveOnly 
)
virtual

Same as SendHostTeamMatchmaking()

Here is the call graph for this function:

◆ SendSearchTeamMatchmaking() [1/2]

void DiarkisMatchMakerBase::SendSearchTeamMatchmaking ( const char **  profileIDs,
size_t  profileIDsCount,
const char *  tag,
const MatchMakerCondition conditions,
size_t  conditionsCount,
bool  joinFlag,
uint16_t  howmany,
const uint8_t *  message,
size_t  messageSize 
)
virtual

Search for matchmaking using profile IDs.

Parameters
[in]profileIDsMultiple matching profiles can be used to search for matchmaking.
[in]profileIDsCountNumber of profiles
[in]tagSpecifies the tag to search. Matchmaking that specifies the same tag will be searched.
[in]conditionsSpecifies the condition to search.
[in]conditionsCountNumber of the conditions
[in]joinFlagDetermines whether to join the room after a match is made.
true = The client will automatically join the room; callback events registered with GetSearchEvent() (e.g. OnSearch) will be triggered.
false = The client will receive a list of search results; the callback event registered with GetResultsEvent() (e.g. OnResutls) will be triggered.
[in]howmanymatches in the search results
[in]messageMessage sent to other clients who matched
[in]messageSizeLength of the message
Here is the caller graph for this function:

◆ SendSearchTeamMatchmaking() [2/2]

void DiarkisMatchMakerBase::SendSearchTeamMatchmaking ( const std::vector< std::string > &  profileIDs,
const std::string &  tag,
const std::vector< MatchMakerCondition > &  conditions,
bool  joinFlag,
uint16_t  howmany,
const std::vector< uint8_t > &  message 
)
virtual

Same as SendSearchTeamMatchmaking()

Here is the call graph for this function:

◆ SendCommit()

void DiarkisMatchMakerBase::SendCommit ( void  )
virtual

Notifies all matched team members to participate in team matchmaking.

Callback events (e.g. OnCommit) registered with GetCommitEvent() will be triggered.
Triggers callback events (e.g. OnCompleteCommit) registered with GetCompleteCommitEvent() on all team members.
When a team is committed, any previous matchmaking that formed the team is discarded.
Committed members will be able to receive synchronization messages.
This function is only available when team matchmaking is used, and can only be called by the host.

◆ SendIssueTicket()

void DiarkisMatchMakerBase::SendIssueTicket ( uint8_t  ticketType)
virtual

Requests the server to issue a ticket to initiate matchmaking.

Triggers a callback event (e.g. OnTicketComplete) registered with GetTicketCompleteEvent().
The matchmaking logic is controlled by the server, and the client only waits for the callback event to occur.

Parameters
[in]ticketTypetype of matching ticket

◆ SendTicketCancel()

void DiarkisMatchMakerBase::SendTicketCancel ( uint8_t  ticketType)
virtual

Cancels an issued matchmaking ticket.

Triggers a callback event (e.g. OnTicketCancel) registered with GetTicketCancelEvent().

Parameters
[in]ticketTypeType of matching ticket.

◆ SendTicketBroadcast() [1/2]

void DiarkisMatchMakerBase::SendTicketBroadcast ( uint8_t  ticketType,
const uint8_t *  message,
size_t  messageSize 
)
virtual

Broadcast message to clients matched by ticket.

 *

Triggers a callback event (e.g. OnTicketBroadcast) registered with GetTicketBroadcastEvent().

Parameters
[in]ticketTypeType of matching ticket
[in]messageMessage to be sent to other clients
[in]messageSizeLength of the message
Here is the caller graph for this function:

◆ SendTicketBroadcast() [2/2]

void DiarkisMatchMakerBase::SendTicketBroadcast ( uint8_t  ticketType,
const std::vector< uint8_t > &  message 
)
virtual

Same as SendTicketBroadcast()

Here is the call graph for this function:

◆ SendTicketLeave()

void DiarkisMatchMakerBase::SendTicketLeave ( uint8_t  ticketType)
virtual

Exits the room created by the ticket.

Triggers a callback event (e.g. OnTicketLeave) registered with GetTicketLeaveEvent().

Parameters
[in]ticketTypeType of matching ticket.

◆ GetRoomID()

Diarkis::StdString DiarkisMatchMakerBase::GetRoomID ( void  )

Get Room ID.

◆ GetOwnerUID()

const Diarkis::StdString & DiarkisMatchMakerBase::GetOwnerUID ( void  )

Gets the owner UID of the matched member.

◆ IsComplete()

bool DiarkisMatchMakerBase::IsComplete ( void  )

Whether matchmaking has been completed.

◆ IsGotoRoom()

bool DiarkisMatchMakerBase::IsGotoRoom ( void  )

Whether or not a message wasent to move to the game scene.

◆ ResetGotoRoom()

void DiarkisMatchMakerBase::ResetGotoRoom ( void  )

Reset flag to move to game scene.

◆ ClearList()

void DiarkisMatchMakerBase::ClearList ( void  )

Empty the list of members.

◆ GetTicketMessage()

const Diarkis::StdString & DiarkisMatchMakerBase::GetTicketMessage ( void  )

Retrieves messages received when matching by ticket is completed.

◆ GetTicketBroadcastMessage()

const Diarkis::StdString & DiarkisMatchMakerBase::GetTicketBroadcastMessage ( void  )

Retrieve received broadcast messages.

◆ IsTicketComplete()

bool DiarkisMatchMakerBase::IsTicketComplete ( void  )

Whether the ticket was completed or not.

◆ IsTicketCancel()

bool DiarkisMatchMakerBase::IsTicketCancel ( void  )

Whether the ticket was canceled or not.

◆ GetMatchingMemberList()

void DiarkisMatchMakerBase::GetMatchingMemberList ( Diarkis::StdVector< Diarkis::StdString > &  memberList)

Obtain matched members.

◆ GetTeamMatchingMemberList()

void DiarkisMatchMakerBase::GetTeamMatchingMemberList ( Diarkis::StdVector< Diarkis::StdString > &  memberList)

Obtain matched members with team matching.

◆ SetOwnUID() [1/2]

void DiarkisMatchMakerBase::SetOwnUID ( const char *  uid)

Set your user ID.

Here is the caller graph for this function:

◆ SetOwnUID() [2/2]

void DiarkisMatchMakerBase::SetOwnUID ( const std::string &  uid)

Same as SetOwnUID()

Here is the call graph for this function:

◆ OnHostMatchmaking()

void DiarkisMatchMakerBase::OnHostMatchmaking ( const DiarkisMMHostEventArgs e)
protectedvirtual

Callback function triggered when matching is initiated as host.

Triggered when a HostMatchmaking response is received.

Here is the call graph for this function:

◆ OnAbortMatchmaking()

void DiarkisMatchMakerBase::OnAbortMatchmaking ( const DiarkisMMResponseEventArgs e)
protectedvirtual

Callback function triggered upon leaving the matching target.

Triggered when a response to AbortMatchmaking is received.

Here is the call graph for this function:

◆ OnDisbandMatchmaking()

void DiarkisMatchMakerBase::OnDisbandMatchmaking ( const DiarkisMMSyncEventArgs e)
protectedvirtual

Callback function triggered when a match is disbanded.

Triggered when a DisbandMatchmaking push is received.

Here is the call graph for this function:

◆ OnMemberLeave()

void DiarkisMatchMakerBase::OnMemberLeave ( const DiarkisMMSyncEventArgs e)
protectedvirtual

Callback function triggered when a matched member leaves the room.

Triggered when a LeaveMatchmaking push is received.

Here is the call graph for this function:

◆ OnMemberJoin()

void DiarkisMatchMakerBase::OnMemberJoin ( const DiarkisMMSyncEventArgs e)
protectedvirtual

Callback function triggered when another client successfully matches and enters.

Triggered when a Search push is received.

Here is the call graph for this function:

◆ OnMemberSync()

void DiarkisMatchMakerBase::OnMemberSync ( const DiarkisMMSyncEventArgs e)
protectedvirtual

Callback function triggered when a message is sent from a matched member.

Triggered when a Sync push is received.

Here is the call graph for this function:

◆ OnJoin()

void DiarkisMatchMakerBase::OnJoin ( const DiarkisMMJoinResponseEventArgs e)
protectedvirtual

Callback function triggered upon joining a matchmaking.

Triggered when responses to Search, ClaimReservedMatchmaking, and JoinMatchmakingFromResult are received.

Here is the call graph for this function:

◆ OnLeave()

void DiarkisMatchMakerBase::OnLeave ( const DiarkisMMResponseEventArgs e)
protectedvirtual

Callback function triggered when leaving a matchmaking.

Triggered when a LeaveMatchmaking response is received.

Here is the call graph for this function:

◆ OnComplete()

void DiarkisMatchMakerBase::OnComplete ( void  )
protectedvirtual

Callback function triggered when a match is completed.

Triggered when NotifyMatchmakingCompletion is pushed or the maximum number of matches is reached.

◆ OnSearch()

void DiarkisMatchMakerBase::OnSearch ( const DiarkisMMJoinResponseEventArgs e)
protectedvirtual

Callback function triggered when a matching search is completed.

Triggered when a Search response or push is received.

Here is the call graph for this function:

◆ OnResutls()

void DiarkisMatchMakerBase::OnResutls ( const DiarkisMMResultEventArgs e)
protectedvirtual

Callback function called when the search for matching is complete.

Triggered when the matchmaking search by Search with joinFlag set to false is completed.

Here is the call graph for this function:

◆ OnP2PAddress()

void DiarkisMatchMakerBase::OnP2PAddress ( const DiarkisP2PEventArgs e)
protectedvirtual

Callback function triggered when starting P2P.

Triggered when a push is received for a P2PAddressSync call.
You can get the address of the matched members from arguments.

Here is the call graph for this function:

◆ OnP2PResponse()

void DiarkisMatchMakerBase::OnP2PResponse ( const DiarkisMMResponseEventArgs e)
protectedvirtual

Callback function triggered when starting P2P.

Triggered when a P2PAddressSync response is received.

Here is the call graph for this function:

◆ OnBackfillEvent()

void DiarkisMatchMakerBase::OnBackfillEvent ( const DiarkisMMResponseEventArgs e)
protectedvirtual

Callback function triggered when a room is added to the matching search.

Triggered when a Backfill response is received.

Here is the call graph for this function:

◆ OnKick()

void DiarkisMatchMakerBase::OnKick ( const DiarkisPayloadEventArgs e)
protectedvirtual

Callback function triggered when a host kicks a particular member out of matching.

Triggered when a Kick push is received. Triggered for all members.

Here is the call graph for this function:

◆ OnKickResponse()

void DiarkisMatchMakerBase::OnKickResponse ( const DiarkisMMResponseEventArgs e)
protectedvirtual

Callback function triggered on the host when the host kicks a particular member out of matching.

Triggered when a Kick response is received.

Here is the call graph for this function:

◆ OnCommit()

void DiarkisMatchMakerBase::OnCommit ( const DiarkisMMResponseEventArgs e)
protectedvirtual

Callback function called when host prompts participation in team matchmaking.

Triggered when a Commit response is received.

Here is the call graph for this function:

◆ OnCompleteCommit()

void DiarkisMatchMakerBase::OnCompleteCommit ( const DiarkisMMJoinResponseEventArgs e)
protectedvirtual

Callback function called on team members when Commit is executed.

Triggered when a Commit push is received.

Here is the call graph for this function:

◆ OnTeamHostMatchmaking()

void DiarkisMatchMakerBase::OnTeamHostMatchmaking ( const DiarkisMMHostEventArgs e)
protectedvirtual

Callback function triggered when team matching is initiated as host.

Triggered when a TeamHostMatchmaking response is received.

Here is the call graph for this function:

◆ OnTeamSearch()

void DiarkisMatchMakerBase::OnTeamSearch ( const DiarkisMMJoinResponseEventArgs e)
protectedvirtual

Callback function triggered when a team matching search is completed.

Triggered when a TeamSearch response or push is received.

Here is the call graph for this function:

◆ OnTeamMemberJoin()

void DiarkisMatchMakerBase::OnTeamMemberJoin ( const DiarkisMMSyncEventArgs e)
protectedvirtual

Callback function triggered when another client successfully matches and enters.

Triggered when a TeamSearch push is received.

Here is the call graph for this function:

◆ OnIssueTicketResponse()

void DiarkisMatchMakerBase::OnIssueTicketResponse ( const DiarkisMMResponseEventArgs e)
protectedvirtual

Gets the event fired when a response to an IssueTicket is received from the server.

Here is the call graph for this function:

◆ OnTicketComplete()

void DiarkisMatchMakerBase::OnTicketComplete ( const DiarkisMMResponseEventArgs e)
protectedvirtual

Callback function triggered when a ticket processed by IssueTicket is completed.

Triggered when a push for an IssueTicket is received.

Here is the call graph for this function:

◆ OnHostChange()

void DiarkisMatchMakerBase::OnHostChange ( const DiarkisMMStringEventArgs e)
protectedvirtual

Callback function triggered when matchmaking host changes.

Triggered when a push is received when the host is changed.

Here is the call graph for this function:

◆ OnTicketCancel()

void DiarkisMatchMakerBase::OnTicketCancel ( const DiarkisMMTicketTypeEventArgs e)
protectedvirtual

Callback function triggered when a TicketCancel is received.

Here is the call graph for this function:

◆ OnTicketCancelResponse()

void DiarkisMatchMakerBase::OnTicketCancelResponse ( const DiarkisMMResponseEventArgs e)
protectedvirtual

Callback function triggered when a TicketCancel response is received.

Here is the call graph for this function:

◆ OnTicketBroadcastResponse()

void DiarkisMatchMakerBase::OnTicketBroadcastResponse ( const DiarkisMMResponseEventArgs e)
protectedvirtual

Callback function triggered when a TicketBroadcast response is received.

Here is the call graph for this function:

◆ OnTicketBroadcast()

void DiarkisMatchMakerBase::OnTicketBroadcast ( const DiarkisMMSyncEventArgs e)
protectedvirtual

Callback function triggered when a TicketBroadcast is received.

Here is the call graph for this function:

◆ OnTicketLeave()

void DiarkisMatchMakerBase::OnTicketLeave ( const DiarkisMMResponseEventArgs e)
protectedvirtual

Callback function triggered when a TicketLeave response is received.

Here is the call graph for this function:

◆ OnResponse()

void DiarkisMatchMakerBase::OnResponse ( const DiarkisResponseEventArgs args,
DiarkisTransportType  tt 
)
protectedvirtual

Callback function triggered when a response is received from the server.

Here is the call graph for this function:

◆ OnPush()

void DiarkisMatchMakerBase::OnPush ( const DiarkisPushEventArgs args,
DiarkisTransportType  tt 
)
protectedvirtual

Callback function triggered when a push is received from the server.

Here is the call graph for this function:

Member Data Documentation

◆ mm_

std::shared_ptr<IDiarkisMatchMaker> DiarkisMatchMakerBase::mm_
protected

Pointer to IDiarkisMatchMaker class.

◆ tcp_

std::shared_ptr<IDiarkisTcp> DiarkisMatchMakerBase::tcp_
protected

Pointer to IDiarkisTcp class.

◆ udp_

std::shared_ptr<IDiarkisUdp> DiarkisMatchMakerBase::udp_
protected

Pointer to IDiarkisUdp class.

◆ room_

std::shared_ptr<IDiarkisRoom> DiarkisMatchMakerBase::room_
protected

Pointer to IDiarkisRoom class.

◆ p2pBase_

std::shared_ptr<DiarkisP2PBase> DiarkisMatchMakerBase::p2pBase_
protected

Pointer to DiarkisP2PBase class.

◆ logger_

std::shared_ptr<IDiarkisLogger> DiarkisMatchMakerBase::logger_
protected

Pointer to IDiarkisLogger class.

◆ eventUnsubscriptions_

Diarkis::StdVector<std::function<void()> > DiarkisMatchMakerBase::eventUnsubscriptions_
protected

Lambda function control list.

◆ Buff_

Diarkis::StdVector<uint8_t> DiarkisMatchMakerBase::Buff_
protected

Buffer for transmission.

◆ myUid_

Diarkis::StdString DiarkisMatchMakerBase::myUid_
protected

My user ID.

◆ ownerUid_

Diarkis::StdString DiarkisMatchMakerBase::ownerUid_
protected

Matching owner's user ID.

◆ ticketBroadcastMessage_

Diarkis::StdString DiarkisMatchMakerBase::ticketBroadcastMessage_
protected

Message received on TicketBroadcast.

◆ list_mutex_

std::recursive_mutex DiarkisMatchMakerBase::list_mutex_
protected

list mutex

◆ memberLists_

Diarkis::StdVector<Diarkis::StdString> DiarkisMatchMakerBase::memberLists_
protected

User ID list of matched members.

◆ teamMemberLists_

Diarkis::StdVector<Diarkis::StdString> DiarkisMatchMakerBase::teamMemberLists_
protected

User ID list of team matched members.

◆ bComplete_

bool DiarkisMatchMakerBase::bComplete_
protected

Whether matching has been completed.

◆ bGotoRoom_

bool DiarkisMatchMakerBase::bGotoRoom_
protected

Whether or not a message wasent to move to the game scene.

◆ bTicketComplete_

bool DiarkisMatchMakerBase::bTicketComplete_
protected

Whether ticket matching has been completed.

◆ ticketMessage_

Diarkis::StdString DiarkisMatchMakerBase::ticketMessage_
protected

Message when matching by ticket is completed.

◆ bTicketCancel_

bool DiarkisMatchMakerBase::bTicketCancel_
protected

Whether matching by ticket was cancelled.

◆ bTeamMatchOwner_

bool DiarkisMatchMakerBase::bTeamMatchOwner_
protected

Whether the owner who issued the TeamMatch Host or Search.


The documentation for this class was generated from the following files: