Skip to content

Group Matchmaking

Group match making is used when multiple users want to participate in a game together as the same team.

Group matching can be requested not only when matching requests are made on a group basis, but also when a group and individuals form a team depending on the number of team members.

Note

Group matchmaking is only supported in group matching and cannot be used in individual matching.

This guide explains how users can join a group by entering the GroupCode value provided when creating a group and request a match.

Matchmaking operation flow in SDK

Group match making is conducted in the following order.

  • Create group (room) → Member group participation → Matching request

When implementing group matchmaking with Hive SDK, the overall flow of matchmaking differs depending on whether the user is a group leader or a group member.

Matchmaking process flow from the group leader's perspective

Matchmaking process flow from the Group member's perspective


Create group

You must create a group first to use group matchmaking.

If multiple users want to participate in the game together, the created group will be matched as the same team.

When calling the group creation method, the match information corresponding to matchId must be pre-registered in the Hive console.

The parameters used are matchId, the score point (an integer from 0 to less than 10^10), and additional information extraData (information within 256 characters such as nickname, level, country, etc.) to be used for the match.

Note

The match unit for the matchId to be used as an argument must be set to 'team'. Additionally, the user who created the group will be the group leader.

Here is an example code for creating a group.

API Reference: MatchMaking .createGroup

using hive;

int matchId = 25;       // matchId registered in the console
int point = 300;            // points used for the match
string extraData = "your extraData";    // additional information to be used for the match
MatchMaking.createGroup(matchId, point, extraData, (ResultAPI result, MatchMaking.MatchMakingGroupData data) => {
    if (result.isSuccess()) {
            // call successful
    } else {
            // Call failed. See error code below
    }
});

API Reference: MatchMaking ::createGroup

#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace std;
using namespace hive;

int matchId = 25;           // matchId registered in the console
int point = 300;                // points used for the match
string extraData = "your extraData";    // additional information to use for the match

MatchMaking::createGroup(matchId, point, extraData, [=](ResultAPI const & result, MatchMakingGroupData data) {
    if (result.isSuccess()) {
        // call successful
    } else {
        // Call failed. See error code below
    }
});

API Reference: MatchMaking.createGroup

import com.hive.MatchMaking
import com.hive.ResultAPI

val matchId = 25            // matchId registered in the console
val point = 300             // points used for the match
val extraData = "your extraData";   // additional information to be used for the match

MatchMaking.createGroup(matchId, point, extraData, object : MatchMaking.MatchMakingGroupDataListener {
    override fun onMatchMakingGroupData(result: ResultAPI, data: MatchMaking.MatchMakingGroupDataListener) {
        if (result.isSuccess) {
            // call successful
        } else {
            // Call failed. See error code below
        }
    }
})

API Reference: MatchMaking .createGroup

import com.hive.MatchMaking;
import com.hive.ResultAPI;

int matchId = 25;           // matchId registered in the console
int point = 300;                // points used for the match
String extraData = "your extraData";    // additional information to be used for the match

MatchMaking.createGroup(matchId, point, extraData, (result, data) -> {
    if (result.isSuccess()) {
        // call successful
    } else {
        // Call failed. See error code below
    }
});

API Reference: MatchMakingInterface.createGroup

import HIVEService
let matchId: Int = 25                       // matchId registered in the console
let point: Int = 300                        // points used for the match
let extraData: String? = "your extraData"   // additional information to be used for the match

MatchMakingInterface.createGroup(matchId: matchId, point: point, extraData: extraData) { result, data in
    if result.isSuccess() {
        // call successful
    }
    else {
        // Call failed. See error code below
    }
}

API Reference: HIVEMatchMaking createGroup

#import "HIVEService.h"
NSInteger matchId = 25;                 // matchId registered in the console
NSInteger point = 300;                      // points used for the match
NSString *extraData = @"your extraData";    // additional information to use for the match

[MatchMakingInterface createGroupWithMatchId:matchId
                                              point:point
                                          extraData:extraData
                                         completion:^(HIVEResult *result, id data) {
    if ([result isSuccess]) {
        // call successful
    } else {
        // Call failed. See error code below
    }
}];

Join group

You can join the group. Users who are not group leaders can join the group to be matched as the same team.


When calling the group participation method, the parameters used are matchId, the GroupCode issued when the group was created, the score to be used for matching point (an integer from 0 to less than 10^10), and additional information to be used for matching extraData (information within 256 characters such as nickname, level, country, etc.).

Note

A user who is not a group leader must request to join the group. The match unit for the matchId to be used as an argument must be set to 'team'.

This is an example code for group participation.

API Reference: MatchMaking .joinGroup

using hive;

int matchId = 25;       // matchId registered in the console
string groupCode = "5001789"; // group code
int point = 300;            // points used for the match 
string extraData = "your extraData";    // additional information to be used for the match

MatchMaking.joinGroup(matchId, groupCode, point, extraData, (ResultAPI result, MatchMaking.MatchMakingGroupData data) => {
    if (result.isSuccess()) {
        // call successful
    } else {
        // Call failed. See error code below
    }
});

API Reference: MatchMaking ::joinGroup

#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace std;
using namespace hive;

int matchId = 25;           // matchId registered in the console
string groupCode = "5001789";   // group code
int point = 300;                // points used for the match
string extraData = "your extraData";    // additional information to be used for the match

MatchMaking::joinGroup(matchId, groupCode, point, extraData, [=](ResultAPI const & result, MatchMakingGroupData data) {
    if (result.isSuccess()) {
            // call successful
    } else {
            // Call failed. See error code below
    }
});

API Reference: MatchMaking.joinGroup

import com.hive.MatchMaking
import com.hive.ResultAPI

val matchId = 25            // matchId registered in the console
val groupCode = "5001789"   // group code
val point = 300             // points used for the match
val extraData = "your extraData";   // additional information to be used for the match

MatchMaking.joinGroup(matchId, groupCode, point, extraData, object : MatchMaking.MatchMakingGroupDataListener {
    override fun onMatchMakingGroupData(result: ResultAPI, data: MatchMaking.MatchMakingGroupDataListener) {
        if (result.isSuccess) {
            // call successful
        } else {
            // Call failed. See error code below
        }
    }
})

API Reference: MatchMaking .joinGroup

import com.hive.MatchMaking;
import com.hive.ResultAPI;

int matchId = 25;           // matchId registered in the console
String groupCode = "5001789";   // group code
int point = 300;                // points used for the match
String extraData = "your extraData";    // additional information to be used for the match

MatchMaking.joinGroup(matchId, groupCode, point, extraData, (result, data) -> {
    if (result.isSuccess()) {
        // call successful
    } else {
        // Call failed. See error code below
    }
});

API Reference: MatchMakingInterface.requestMatchMaking

import HIVEService
let matchId: Int = 25                       // The matchId registered in the console
let groupCode: String = "5001789"           // Group code
let point: Int = 300                        // Points used for the match
let extraData: String? = "your extraData"   // Additional information to be used for the match

MatchMakingInterface.joinGroup(matchId: matchId, point: point, extraData: extraData) { result, data in
    if result.isSuccess() {
        // call successful
    }
    else {
        // Call failed. See error code below
    }
}

API Reference: HIVEMatchMaking requestMatchMaking

#import "HIVEService.h"
NSInteger matchId = 25;                 // matchId registered in the console
NSString *groupCode = @"5001789";           // group code
NSInteger point = 300;                      // points used for the match
NSString *extraData = @"your extraData";    // additional information to use for the match

[MatchMakingInterface joinGroupWithMatchId:matchId
                                          groupCode:groupCode
                                              point:point
                                          extraData:extraData
                                         completion:^(HIVEResult *result, id data) {
    if ([result isSuccess]) {
        // call successful
    } else {
        // Call failed. See error code below
    }
}];

Group withdrawal

I am leaving the group.

If any one of the group members is in 'Ready' status, they cannot withdraw. Also, if the group leader withdraws, one of the remaining members will automatically become the group leader. If there are no remaining members, the group will be automatically deleted.

This is an example code for group withdrawal.

API Reference: MatchMaking .leaveGroup

using hive;
int matchId = 25;       // The matchId registered in the console
MatchMaking.leaveGroup(matchId, (ResultAPI result) => {
    if (result.isSuccess()) {
        // call successful
    } else {
        // Call failed. See error code below
    }
});

API Reference: MatchMaking ::leaveGroup

#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace std;
using namespace hive;

int matchId = 25;           // matchId registered in the console

MatchMaking::leaveGroup(matchId, [=](ResultAPI const & result) {
    if (result.isSuccess()) {
            // call successful
    } else {
            // Call failed. See error code below
    }
});

API Reference: MatchMaking.deleteRequesting

import com.hive.MatchMaking
import com.hive.ResultAPI
val matchId = 25            // The matchId registered in the console
MatchMaking.leaveGroup(matchId, object : MatchMaking.MatchMakingResultListener {
    override fun onMatchMakingResult(result: ResultAPI) {
        if (result.isSuccess) {
            // call successful
        } else {
            // Call failed. See error code below
        }
    }
})

API Reference: MatchMaking.INSTANCE .deleteRequesting

import com.hive.MatchMaking;
import com.hive.ResultAPI;
int matchId = 25;           // The matchId registered in the console
MatchMaking.leaveGroup(matchId, (result) -> {
    if (result.isSuccess()) {
        // call successful
    } else {
        // Call failed. See error code below
    }
});

API Reference: MatchMakingInterface.deleteRequesting

import HIVEService
let matchId = 25            // The matchId registered in the console
MatchMakingInterface.leaveGroup(matchId: matchId) { result in
    if result.isSuccess() {
        // call successful
    } else {
        // Call failed. See error code below
    }
}

API Reference: HIVEMatchMaking deleteRequesting

#import "HIVEService.h"
NSInteger matchId = 25;          // Registered matchId in the console

[MatchMakingInterface leaveGroupWithMatchId:matchId
                                       completion:^(HIVEResult *result, id data) {
    if ([result isSuccess]) {
        // call successful
    } else {
        // Call failed. See error code below
    }
}];

Group member forced exit

The group leader can forcibly remove a specific member. Forced removal can only be requested for the same group members and cannot be used during an ongoing match.

When calling the group member force exit method, use the targetPlayerId of the member you want to forcibly exit as an argument.

The following is an example code for forcibly removing a group member.

API Reference: MatchMaking .kickGroupUser

using hive;

int matchId = 25;       // matchId registered in the console
long targetPlayerId = 123456789; // Player id of the member to be forcibly expelled

MatchMaking.kickGroupUser(matchId, targetPlayerId, (ResultAPI result, MatchMaking.MatchMakingGroupData data) => {
    if (result.isSuccess()) {
        // call successful
    } else {
        // Call failed. See error code below
    }
});

API Reference: MatchMaking ::kickGroupUser

#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace std;
using namespace hive;

int matchId = 25; // matchId registered in the console
long long targetPlayerId = 123456789; // member player id to forcibly expel

MatchMaking::kickGroupUser(matchId, targetPlayerId, [=](ResultAPI const & result, MatchMakingGroupData data) {
    if (result.isSuccess()) {
            // call successful
    } else {
            // Call failed. See error code below
    }
});

API Reference: MatchMaking.kickGroupUser

import com.hive.MatchMaking
import com.hive.ResultAPI

val matchId = 25 // matchId registered in the console
val targetPlayerId = 123456789 // member player id to forcibly export

MatchMaking.kickGroupUser(matchId, targetPlayerId, object : MatchMaking.MatchMakingGroupDataListener {
    override fun onMatchMakingGroupData(result: ResultAPI, data: MatchMaking.MatchMakingGroupDataListener) {
        if (result.isSuccess) {
            // call successful
        } else {
            // Call failed. See error code below
        }
    }
})

API Reference: MatchMaking .kickGroupUser

import com.hive.MatchMaking;
import com.hive.ResultAPI;

int matchId = 25; // matchId registered in the console
long targetPlayerId = 123456789; // member player id to forcefully expel

MatchMaking.kickGroupUser(matchId, targetPlayerId, (result, data) -> {
    if (result.isSuccess()) {
        // call successful
    } else {
        // Call failed. See error code below
    }
});

API Reference: MatchMakingInterface.kickGroupUser

import HIVEService
let matchId = 25                    // The matchId registered in the console
let targetPlayerId = 123456789      // The member player id to forcibly expel

MatchMakingInterface.kickGroupUser(matchId: matchId, targetPlayerId) { result, data in
    if result.isSuccess() {
        // call successful
    }
    else {
        // Call failed. See error code below
    }
}

API Reference: HIVEMatchMaking requestMatchMaking

#import "HIVEService.h"
NSInteger matchId = 25;                 // The matchId registered in the console
NSNumber *targetPlayerId = 123456789;       // The player id of the member to forcibly expel

[MatchMakingInterface kickGroupUserWithMatchId:matchId
                                          targetPlayerId:targetPlayerId
                                         completion:^(HIVEResult *result, id data) {
    if ([result isSuccess]) {
        // call successful
    } else {
        // Call failed. See error code below
    }
}];

Group information query based on group user

Queries group information based on users within the group. It is used to check the information of other users participating in the group or to check the matching results after a matching request.

It is recommended to periodically check the status of group users.

The following is an example code that queries group information based on group users.

API Reference: MatchMaking .getGroupInfoByUser

using hive;

int matchId = 25;       // matchId registered in the console

MatchMaking.getGroupInfoByUser(matchId, (ResultAPI result, MatchMaking.MatchMakingGroupData data) => {
    if (result.isSuccess()) {
        // call successful
    } else {
        // Call failed. See error code below
    }
});

API Reference: MatchMaking ::getGroupInfoByUser

#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace std;
using namespace hive;

int matchId = 25; // matchId registered in the console

MatchMaking::getGroupInfoByUser(matchId, [=](ResultAPI const & result, MatchMakingGroupData data) {
    if (result.isSuccess()) {
            // call successful
    } else {
            // Call failed. See error code below
    }
});

API Reference: MatchMaking.getGroupInfoByUser

import com.hive.MatchMaking
import com.hive.ResultAPI

val matchId = 25 // matchId registered in the console

MatchMaking.getGroupInfoByUser(matchId, object : MatchMaking.MatchMakingGroupDataListener {
    override fun onMatchMakingGroupData(result: ResultAPI, data: MatchMaking.MatchMakingGroupDataListener) {
        if (result.isSuccess) {
            // call successful
        } else {
            // Call failed. See error code below
        }
    }
})

API Reference: MatchMaking .getGroupInfoByUser

import com.hive.MatchMaking;
import com.hive.ResultAPI;

int matchId = 25; // Registered matchId in the console

MatchMaking.getGroupInfoByUser(matchId, (result, data) -> {
    if (result.isSuccess()) {
        // call successful
    } else {
        // Call failed. See error code below
    }
});

API Reference: MatchMakingInterface.getGroupInfoByUser

import HIVEService
let matchId = 25                    // Registered matchId in the console

MatchMakingInterface.getGroupInfoByUser(matchId: matchId) { result, data in
    if result.isSuccess() {
        // call successful
    }
    else {
        // Call failed. See error code below
    }
}

API Reference: HIVEMatchMaking getGroupInfoByUser

#import "HIVEService.h"
NSInteger matchId = 25;                 // Registered matchId in the console

[MatchMakingInterface getGroupInfoByUserWithMatchId:matchId
                                         completion:^(HIVEResult *result, id data) {
    if ([result isSuccess]) {
        // call successful
    } else {
        // Call failed. See error code below
    }
}];

Group information query based on group code

Queries information about the group based on the group code. It is used to check whether the group exists.

The following is an example code that retrieves group information based on the group code.

API Reference: MatchMaking .getGroupInfoByGroupCode

using hive;

string groupCode = "5001789";   // group code

MatchMaking.getGroupInfoByGroupCode(groupCode, (ResultAPI result, MatchMaking.MatchMakingGroupData data) => {
    if (result.isSuccess()) {
        // call successful
    } else {
        // Call failed. See error code below
    }
});

API Reference: MatchMaking ::getGroupInfoByGroupCode

#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace std;
using namespace hive;

string groupCode = "5001789"; // group code

MatchMaking::getGroupInfoByGroupCode(groupCode, [=](ResultAPI const & result, MatchMakingGroupData data) {
    if (result.isSuccess()) {
            // call successful
    } else {
            // Call failed. See error code below
    }
});

API Reference: MatchMaking.getGroupInfoByGroupCode

import com.hive.MatchMaking
import com.hive.ResultAPI

val groupCode = "5001789" // group code

MatchMaking.getGroupInfoByGroupCode(groupCode, object : MatchMaking.MatchMakingGroupDataListener {
    override fun onMatchMakingGroupData(result: ResultAPI, data: MatchMaking.MatchMakingGroupDataListener) {
        if (result.isSuccess) {
            // call successful
        } else {
            // Call failed. See error code below
        }
    }
})

API Reference: MatchMaking .getGroupInfoByGroupCode

import com.hive.MatchMaking;
import com.hive.ResultAPI;

String groupCode = "5001789"; // Group code

MatchMaking.getGroupInfoByGroupCode(groupCode, (result, data) -> {
    if (result.isSuccess()) {
        // call successful
    } else {
        // Call failed. See error code below
    }
});

API Reference: MatchMakingInterface.getGroupInfoByGroupCode

import HIVEService
let groupCode = "5001789" // Group code

MatchMakingInterface.getGroupInfoByGroupCode(groupCode: groupCode) { result, data in
    if result.isSuccess() {
        // call successful
    }
    else {
        // Call failed. See error code below
    }
}

API Reference: HIVEMatchMaking getGroupInfoByGroupCode

#import "HIVEService.h"
NSString *groupCode = @"5001789"; // Group code

[MatchMakingInterface getGroupInfoByGroupCodeWithGroupCode:groupCode
                                         completion:^(HIVEResult *result, id data) {
    if ([result isSuccess]) {
        // call successful
    } else {
        // Call failed. See error code below
    }
}];

Member information update

Members in the group can change their status or information.

When calling the member information modification method, the parameters include the readiness status of the member excluding the group leader, ready, the score to be used in the match point (an integer from 0 to less than 10^10), and additional information to be used in the match extraData (information such as nickname, level, country, etc., within 256 characters).

Warning

All members in the group must be in a ready state for the group leader to make a matching request.
For the group leader, the ready value is always true, and changing it to false will result in an error.

This is an example code for group participation.

API Reference: MatchMaking .updateGroupUser

using hive;

int matchId = 25;       // matchId registered in the console
bool ready = true;          // readiness status
int point = 300;            // points used for the match 
string extraData = "your extraData";    // additional information to be used for the match

MatchMaking.updateGroupUser(matchId, ready, point, extraData, (ResultAPI result, MatchMaking.MatchMakingGroupData data) => {
    if (result.isSuccess()) {
        // call successful
    } else {
        // Call failed. See error code below
    }
});

API Reference: MatchMaking ::updateGroupUser

#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace std;
using namespace hive;

int matchId = 25;           // matchId registered in the console
bool ready = true;              // readiness status
int point = 300;                // points used for the match
string extraData = "your extraData";    // additional information to be used for the match

MatchMaking::updateGroupUser(matchId, ready, point, extraData, [=](ResultAPI const & result, MatchMakingGroupData data) {
    if (result.isSuccess()) {
            // call successful
    } else {
            // Call failed. See error code below
    }
});

API Reference: MatchMaking.updateGroupUser

import com.hive.MatchMaking
import com.hive.ResultAPI

val matchId = 25            // matchId registered in the console
val ready = true            // readiness status
val point = 300             // points used for the match
val extraData = "your extraData";   // additional information to be used for the match

MatchMaking.updateGroupUser(matchId, ready, point, extraData, object : MatchMaking.MatchMakingGroupDataListener {
    override fun onMatchMakingGroupData(result: ResultAPI, data: MatchMaking.MatchMakingGroupDataListener) {
        if (result.isSuccess) {
            // call successful
        } else {
            // Call failed. See error code below
        }
    }
})

API Reference: MatchMaking .updateGroupUser

import com.hive.MatchMaking;
import com.hive.ResultAPI;

int matchId = 25;           // matchId registered in the console
boolean ready = true;           // readiness status
int point = 300;                // points used for the match
String extraData = "your extraData";    // additional information to be used for the match

MatchMaking.updateGroupUser(matchId, ready, point, extraData, (result, data) -> {
    if (result.isSuccess()) {
        // call successful
    } else {
        // Call failed. See error code below
    }
});

API Reference: MatchMakingInterface.updateGroupUser

import HIVEService
let matchId: Int = 25                       // The matchId registered in the console
let ready: Bool = true                      // Ready status
let point: Int = 300                        // Match usage points
let extraData: String? = "your extraData"   // Additional information to be used for the match

MatchMakingInterface.updateGroupUser(matchId: matchId, ready: ready, point: point, extraData: extraData) { result, data in
    if result.isSuccess() {
        // call successful
    }
    else {
        // Call failed. See error code below
    }
}

API Reference: HIVEMatchMaking updateGroupUser

#import "HIVEService.h"
NSInteger matchId = 25;                 // matchId registered in the console
BOOL *ready = true;                         // group code
NSInteger point = 300;                      // points used for the match
NSString *extraData = @"your extraData";    // additional information to be used for the match

[MatchMakingInterface updateGroupUserWithMatchId:matchId
                                           ready:ready
                                           point:point
                                       extraData:extraData
                                      completion:^(HIVEResult *result, id data) {
    if ([result isSuccess]) {
        // call successful
    } else {
        // Call failed. See error code below
    }
}];

Matching request

Requesting a match. Once all members in the group are in a ready state, the group leader can make a match request.

When requesting a match, the prerequisites are as follows.

  • There must be at least 2 group members at the time of the request.
  • Members who are not the group leader (room leader) must have their 'Ready' status set to true.
  • If there is an existing match, it must be deleted before making a request.
  • Only the group leader (room leader) can make the request.
Warning

If you request matching again while a matching request is already in progress, the existing matching will not be interrupted, and the callback function will return an error value (MatchMakingResponseError). Therefore, be sure to check the matching status first through Check Matching Status before requesting matching.

This is an example code for a matching request.

API Reference: MatchMaking .requestGroupMatching

using hive;
int matchId = 25;       // matchId registered in the console

MatchMaking.requestGroupMatching(matchId, (ResultAPI result, MatchMaking.MatchMakingGroupData data) => {
    if (result.isSuccess()) {
        // call successful
    } else {
        // Call failed. See error code below
    }
});

API Reference: MatchMaking ::requestGroupMatching

#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace std;
using namespace hive;

int matchId = 25;           // Registered matchId in the console

MatchMaking::requestGroupMatching(matchId, [=](ResultAPI const & result, MatchMakingGroupData data) {
    if (result.isSuccess()) {
        // call successful
    } else {
        // Call failed. See error code below
    }
});

API Reference: MatchMaking.requestGroupMatching

import com.hive.MatchMaking
import com.hive.ResultAPI

val matchId = 25            // matchId registered in the console

MatchMaking.requestGroupMatching(matchId, object : MatchMaking.MatchMakingGroupDataListener {
    override fun onMatchMakingGroupData(result: ResultAPI, data: MatchMaking.MatchMakingGroupDataListener) {
        if (result.isSuccess) {
            // call successful
        } else {
            // Call failed. See error code below
        }
    }
})

API Reference: MatchMaking .requestGroupMatching

import com.hive.MatchMaking;
import com.hive.ResultAPI;

int matchId = 25;           // Registered matchId in the console

MatchMaking.requestGroupMatching(matchId, (result, data) -> {
    if (result.isSuccess()) {
        // call successful
    } else {
        // Call failed. See error code below
    }
});

API Reference: MatchMakingInterface.requestGroupMatching

import HIVEService

let matchId = 25                    // Registered matchId in the console

MatchMakingInterface.requestGroupMatching(matchId: matchId) { result, data in
    if result.isSuccess() {
        // call successful
    }
    else {
        // Call failed. See error code below
    }
}

API Reference: HIVEMatchMaking requestGroupMatching

#import "HIVEService.h"

NSInteger matchId = 25;                 // Registered matchId in the console

[MatchMakingInterface requestGroupMatchingWithMatchId:matchId
                                         completion:^(HIVEResult *result, id data) {
    if ([result isSuccess]) {
        // call successful
    } else {
        // Call failed. See error code below
    }
}];

Cancel matching Request (delete)

Cancelling (deleting) the match. The match must be deleted if it meets one or more of the following conditions.

  • If the user cancels the match
  • If the match status is a timeout
  • If the game between users is completed successfully

    You must request to delete the match after updating the game results (rankings, scores, win/loss status, etc.) data on the game server.

The following is an example code for canceling (deleting) a matching request.

API Reference: MatchMaking .deleteGroupMatching

using hive;
int matchId = 25;       // matchId registered in the console

MatchMaking.deleteGroupMatching(matchId, (ResultAPI result, MatchMaking.MatchMakingGroupData data) => {
    if (result.isSuccess()) {
        // call successful
    } else {
        // Call failed. See error code below
    }
});

API Reference: MatchMaking ::deleteGroupMatching

#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace std;
using namespace hive;

int matchId = 25;           // matchId registered in the console

MatchMaking::deleteGroupMatching(matchId, [=](ResultAPI const & result, MatchMakingGroupData data) {
    if (result.isSuccess()) {
        // call successful
    } else {
        // Call failed. See error code below
    }
});

API Reference: MatchMaking.deleteGroupMatching

import com.hive.MatchMaking
import com.hive.ResultAPI

val matchId = 25            // matchId registered in the console

MatchMaking.deleteGroupMatching(matchId, object : MatchMaking.MatchMakingGroupDataListener {
    override fun onMatchMakingGroupData(result: ResultAPI, data: MatchMaking.MatchMakingGroupDataListener) {
        if (result.isSuccess) {
            // call successful
        } else {
            // Call failed. See error code below
        }
    }
})

API Reference: MatchMaking .deleteGroupMatching

import com.hive.MatchMaking;
import com.hive.ResultAPI;

int matchId = 25;           // matchId registered in the console

MatchMaking.deleteGroupMatching(matchId, (result, data) -> {
    if (result.isSuccess()) {
        // call successful
    } else {
        // Call failed. See error code below
    }
});

API Reference: MatchMakingInterface.deleteGroupMatching

import HIVEService

let matchId = 25                    // Registered matchId in the console

MatchMakingInterface.deleteGroupMatching(matchId: matchId) { result, data in
    if result.isSuccess() {
        // call successful
    }
    else {
        // Call failed. See error code below
    }
}

API Reference: HIVEMatchMaking deleteGroupMatching

#import "HIVEService.h"

NSInteger matchId = 25;                 // Registered matchId in the console

[MatchMakingInterface deleteGroupMatchingWithMatchId:matchId
                                         completion:^(HIVEResult *result, id data) {
    if ([result isSuccess]) {
        // call successful
    } else {
        // Call failed. See error code below
    }
}];

MatchMakingGroupData object structure

This is the object that is delivered in response to the main feature requests provided by group match making.

The response object includes the information entered during the request, group code, group leader information, team member information, and matching result information.

Field Name Description Type
groupCode The group code generated when creating a group String
ownerPlayerId The playerId (group leader) that requested the group creation Long
requestGameIndex Match game index Int
requestMatchId The match ID requested (in the format registered in the Hive console) Int
requestStatus Match request status (requested: match requested, notRequested: not requested (or, no ongoing match has been matched)) String
requestTimeUtc Match request time (ex: 2025-01-02T11:13:50.96) String
matchingStatus Match progress status (matchingInProgress: matching in progress, timeout: no matching occurred within the time limit, matched: matching succeeded) String
matchingType Whether it is team participation or individual participation (exists if matchingStatus is matched) (team: team, player: individual, unknown: if matching confirmation is not available) String
matchingId The id assigned to the successful match (exists if matchingStatus is matched) (ex: 539:21_2025-01-02T11:45:55.25_1) String
memberInfoList List of member player information currently belonging to the group MatchMemberInfo Array
matchingTeamInfoList List of team information MatchingResultTeamInfo if the match is successful (exists if matchingStatus is matched) Array

MatchMemberInfo object structure

This is the object passed when participating in a team match. It contains user information of team members belonging to the same team (group).

Field Name Description Type
playerId Group member playerId Long
ready Group member's readiness status Boolean
point Group member's point Int
extraData Other information provided by the group member (exists if the user used extraData upon request) String

MatchingResultTeamInfo object structure

This is the object that is delivered when a team participates in a match and the matching is successful (when matchingStatus is matched). It contains the team index and information about the users belonging to the team.

Field Name Description Type
teamIndex Unique index of the team Int
playerInfos List of user information belonging to the team MatchingResultPlayerInfo Array

Check Matching status

Checking the user's matching status.

When calling the matching status check method, it returns one of the three matching statuses below.

  1. Matching in progress (matchingStatus: matchingInProgress)
  2. Matching successful (matchingStatus: matched)
  3. Timeout (matchingStatus: timeout)

You can check the matching status using the Get Group Information by User API or the Get Group Information by Group Code API.

Matching in progress

If the matching status is In Progress, you need to repeatedly call the method to check the matching status to see if it has reached Matched.

It is recommended to call the repeat call cycle at intervals of 3 to 10 seconds. Depending on the implementation characteristics of the app, it is also possible to increase the time interval further.

Matching success

If the matching status is Match Successful, the developer's game will be launched. This means that users connected through the Hive SDK are in a state to play the game together, and the matched users can participate in the developer's game.

Timeout

If the status is a timeout (matchingStatus: timeout), you must delete the existing match and request the match again.

Error code

Error Code Message Description
NEED_INITIALIZE MatchMakingNotInitialized If the SDK Setup is not done (AuthV4.setup)
INVALID_SESSION MatchMakingNeedSignIn If AuthV4 Sign-In is not done
RESPONSE_FAIL MatchMakingResponseError If the API call fails due to incorrect parameters, network issues, or if a matching request is made while already in a matching request state