Skip to main content
Version: 5.11.6

MatchEnd

public void MatchEnd(MatchGameResult matchGameResult);

Parameter

ValueTypeDescription
matchGameResultMatchGameResultResult of the game

Description

Sends the result of the game to the server.
When the game result message is sent to the server and the server determines the overall result, game result event and in-game server disconnection event are called simultaneously.

How to process results

The method to process the game result varies depending on the method of result process set in the console.

Result Processing MethodDescription
DefaultTo save game results in the server properly, all users who participated in the game must send the game results.
Super Gamer
(Old Battle Royale mode)
The game result will be saved in the server properly when only the Super Gamer sends the game result.

In the case of the default method, if any user left the game while it was in progress, the overall result cannot be determined because some users cannot send a result message to the server.

Example

// 1:1
MatchGameResult matchGameResult = new MatchGameResult();
matchGameResult.m_winners = new List<SessionId>();
matchGameResult.m_losers = new List<SessionId>();

matchGameResult.m_winners.Add("Winner session ID");
matchGameResult.m_losers.Add("Loser session ID");
// --------------------

// Team battle
MatchGameResult matchGameResult = new MatchGameResult();
matchGameResult.m_winners = new List<SessionId>();
matchGameResult.m_losers = new List<SessionId>();

foreach(var session in winnerTeam)
{
// The order is not important.
matchGameResult.m_winners.Add(session);
}

foreach(var session in loserTeam)
{
// The order is not important.
matchGameResult.m_losers .Add(session);
}
// --------------------

// Solo battle
MatchGameResult matchGameResult = new MatchGameResult();
foreach(var session in rank)
{
// It should be added in order of placement, from 1st place.
matchGameResult.m_winners.Add(session);
}
// --------------------

// Send the result to the server
Backend.Match.MatchEnd(matchGameResult);