PICO Platform Unity SDK
|
Static Public Member Functions | |
static Task | ReportResultsInsecure (UInt64 roomId, Dictionary< string, int > data) |
Reports the result of a skill-rating match. More... | |
static Task< MatchmakingStats > | GetStats (string pool, uint maxLevel, MatchmakingStatApproach approach=MatchmakingStatApproach.Trailing) |
Gets the matchmaking statistics for the current user. More... | |
static Task< MatchmakingBrowseResult > | Browse2 (string pool, MatchmakingOptions matchmakingOptions=null) |
Gets rooms by matchmakinging pool name. The user can join the room with RoomService.Join2 to or cancel the retrieval with MatchmakingService.Cancel . More... | |
static Task< MatchmakingBrowseResult > | Browse2ForCustomPage (string pool, MatchmakingOptions matchmakingOptions=null, int pageIndex=0, int pageSize=5) |
Gets rooms by matchmakinging pool name and specify the page number and the number of pages per page. More... | |
static Task | Cancel () |
Cancels a matchmaking request. Call this function to cancel an enqueue request before a match is made. This is typically triggered when a user gives up waiting. If you do not cancel the request but the user goes offline, the user/room will be timed out according to the setting of reserved period on the PICO Developer Platform. More... | |
static Task< MatchmakingEnqueueResultAndRoom > | CreateAndEnqueueRoom2 (string pool, MatchmakingOptions matchmakingOptions=null) |
Creates a matchmaking room, then enqueues and joins it. More... | |
static Task< MatchmakingEnqueueResult > | Enqueue2 (string pool, MatchmakingOptions matchmakingOptions=null) |
Enqueues for an available matchmaking room to join. When the server finds a match, it will return a message of type MessageType.Notification_Matchmaking_MatchFound . You can join found matching rooms by calling RoomService.Join2 . If you want to cancel the match early, you can use MatchmakingService.Cancel . More... | |
static Task< MatchmakingAdminSnapshot > | GetAdminSnapshot () |
Debugs the state of the current matchmaking pool queue. More... | |
static Task | StartMatch (UInt64 roomId) |
Reports that a skill-rating match has started. You can use this method after joining the room. More... | |
static void | SetMatchFoundNotificationCallback (Message< Room >.Handler handler) |
Sets the callback to get notified when a match has been found. For example, after calling MatchmakingService.Enqueue , when the match is successful, you will receive Notification_Matchmaking_MatchFound , and then execute the processing function set by this function. More... | |
static void | SetCancel2NotificationCallback (Message.Handler handler) |
A notification will be sent to the player after they have been kicked out of the matchmaking pool. Listen to the event to receive a message. More... | |
|
inlinestatic |
Reports the result of a skill-rating match.
roomId | The room ID. |
data | The key-value pairs. |
Request information of type Task
, including the request ID, and its response message does not contain data.
Error Code | Error Message |
---|---|
3006209 | match result report: not in match |
3006210 | match result report: error report data |
3006211 | match result report: duplicate report |
3006212 | match result report: conflict with other's report |
Only for pools with skill-based matchmaking. Call this method after calling StartMatch()
to begin a skill-rating match. After the match finishes, the server will record the result and update the skill levels of all players involved based on the result. This method is insecure because, as a client API, it is susceptible to tampering and therefore cheating to manipulate skill ratings.
A message of type MessageType.Matchmaking_ReportResultInsecure
will be generated in response. First call Message.IsError()
to check if any error has occurred. This response has no payload. If no error has occurred, the request is successful.
|
inlinestatic |
Gets the matchmaking statistics for the current user.
pool | The pool to look in. |
maxLevel | (beta feature, don't use it) |
approach | (beta feature, don't use it) |
Request information of type Task
, including the request ID, and its response message will contain data of type MatchmakingStats
.
Error Code | Error Message |
---|---|
3006201 | match enqueue: invalid pool name |
3006208 | match enqueue: no skill |
When given a pool, the system will look up the current user's wins, losses, draws and skill level. The skill level returned will be between 1
and the maximum level. The approach will determine how should the skill level rise toward the maximum level.
A message of type MessageType.Matchmaking_GetStats
will be generated in response. First call Message.IsError()
to check if any error has occurred. If no error has occurred, the message will contain a payload of type MatchmakingStats
. Extract the payload from the message handle with message.Data
.
|
inlinestatic |
Gets rooms by matchmakinging pool name. The user can join the room with RoomService.Join2 to
or cancel the retrieval with MatchmakingService.Cancel
.
pool | The matchmaking pool name you want to browse. |
matchmakingOptions | (Optional) The matchmaking configuration of the browse request. |
Request information of type Task
, including the request ID, and its response message will contain data of type MatchmakingBrowseResult
.
Error Code | Error Message |
---|---|
3006201 | match enqueue: invalid pool name |
3006205 | match browse: access denied |
3006207 | match enqueue: invalid query key |
A message of type MessageType.Matchmaking_Browse2
will be generated in response. First call Message.IsError()
to check if any error has occurred. If no error has occurred, the message will contain a payload of type MatchmakingBrowseResult
. Extract the payload from the message handle with message.Data
.
|
inlinestatic |
Gets rooms by matchmakinging pool name and specify the page number and the number of pages per page.
pool | The matchmaking pool name you want to browse. |
matchmakingOptions | (Optional) The matchmaking configuration of the browse request. |
pageIndex | (Optional)Start page index. |
pageSize | (Optional)the number of pages per page. |
Request information of type Task
, including the request ID, and its response message will contain data of type MatchmakingBrowseResult
.
A message of type MessageType.Matchmaking_Browse2CustomPage
will be generated in response. First call Message.IsError()
to check if any error has occurred. If no error has occurred, the message will contain a payload of type MatchmakingBrowseResult
. Extract the payload from the message handle with message.Data
.
|
inlinestatic |
Cancels a matchmaking request. Call this function to cancel an enqueue request before a match is made. This is typically triggered when a user gives up waiting. If you do not cancel the request but the user goes offline, the user/room will be timed out according to the setting of reserved period on the PICO Developer Platform.
Request information of type Task
, including the request ID, and its response message does not contain data.
Error Code | Error Message |
---|---|
3006201 | match enqueue: invalid pool name |
3006206 | match cancel: not in match |
3006301 | server error: unknown |
A message of type MessageType.Matchmaking_Cancel2
will be generated in response. Call Message.IsError()
to check if any error has occurred. This response has no payload. If no error has occurred, the request is successful.
|
inlinestatic |
Creates a matchmaking room, then enqueues and joins it.
true
)pool | The matchmaking pool to use, which is created on the PICO Developer Platform. |
matchmakingOptions | (Optional) Additional matchmaking configuration for this request. |
Request information of type Task
, including the request ID, and its response message will contain data of type MatchmakingEnqueueResultAndRoom
.
Error Code | Error Message |
---|---|
3006201 | match enqueue: invalid pool name |
3006203 | match create room: pool config not allow user create room |
3006207 | match enqueue: invalid query key |
3006301 | server error: unknown |
3006204 | match enqueue: invalid room id(Assigned room id, present in this context, indicates an internal server error) |
3006103 | invalid room(The room was found to be invalid when joining the room, which appears in this context, indicating an internal server error) |
3006102 | duplicate join room(Duplicate joins are found when joining a room, which appears in this context, indicating an internal server error) |
3006106 | exceed max room player number(Exceeding the maximum number of people when joining a room, appears in this context, indicating an internal server error) |
3006105 | illegal enter request(Illegal incoming requests, such as not in the allowed whitelist, appear in this context, indicating an internal server error) |
3006108 | room is locked(When joining a room, it is found that the room is locked, appears in this context, indicating an internal server error) |
A message of type MessageType.Matchmaking_CreateAndEnqueueRoom2
will be generated in response. First call message.IsError()
to check if any error has occurred. If no error has occurred, the message will contain a payload of type MatchmakingEnqueueResultAndRoom
. Extract the payload from the message handle with message.Data
.
|
inlinestatic |
Enqueues for an available matchmaking room to join. When the server finds a match, it will return a message of type MessageType.Notification_Matchmaking_MatchFound
. You can join found matching rooms by calling RoomService.Join2
. If you want to cancel the match early, you can use MatchmakingService.Cancel
.
pool | The matchmaking pool to use, which is defined on the PICO Developer Platform. |
matchmakingOptions | (Optional) Match configuration for Enqueue. |
Request information of type Task
, including the request ID, and its response message will contain data of type MatchmakingEnqueueResult
.
Error Code | Error Message |
---|---|
3006201 | match enqueue: invalid pool name |
3006401 | logic state checking failed |
3006207 | match enqueue: invalid query key |
3006301 | server error: unknown |
A message of type MessageType.Matchmaking_Enqueue2
will be generated in response. First call message.IsError()
to check if any error has occurred. If no error has occurred, the message will contain a payload of type MatchmakingEnqueueResult
. Extract the payload from the message handle with message.Data
.
|
inlinestatic |
Debugs the state of the current matchmaking pool queue.
Request information of type Task
, including the request ID, and its response message will contain data of type MatchmakingAdminSnapshot
.
Error Code | Error Message |
---|---|
3006201 | match enqueue: invalid pool name |
3006301 | server error: unknown |
A message of type MessageType.Matchmaking_GetAdminSnapshot
will be generated in response. First call message.IsError()
to check if any error has occurred. If no error has occurred, the message will contain a payload of type MatchmakingAdminSnapshot
. Extract the payload from the message handle with message.Data
.
|
inlinestatic |
Reports that a skill-rating match has started. You can use this method after joining the room.
roomId | The ID of the room you want to match. |
Request information of type Task
, including the request ID, and its response message does not contain data.
A message of type MessageType.Matchmaking_StartMatch
will be generated in response. Call message.IsError()
to check if any error has occurred.
Sets the callback to get notified when a match has been found. For example, after calling MatchmakingService.Enqueue
, when the match is successful, you will receive Notification_Matchmaking_MatchFound
, and then execute the processing function set by this function.
handler | The callback function will be called when receiving the Notification_Matchmaking_MatchFound message. |
|
inlinestatic |
A notification will be sent to the player after they have been kicked out of the matchmaking pool. Listen to the event to receive a message.
handler | The callback function will be called when receiving the Matchmaking_Cancel2 message and the value of requestID is 0 . |