This module provides functionality for user matchmaking grouped by game type.

It is available only on Snipe Kit server.

Constructor

Methods

add (c:ClientKit, params:Params):Dynamic

kit/matchmaking.add

Adds this user to the specified matchmaking user list (bound to game type).

User has to be in the default state. Puts the user into "kit/matchExt" state.

Note: A single user can only be in one matchmaking list. This call will produce an error if the user will try to get into more than one list.

Input:

  • typeID - String. Game type ID.

Output:

  • errorCode - String. Operation error code.

Error codes:

  • ok - Operation successful.
  • listNotFound - Matchmaking list with this ID was not found.
  • actionNotFound - This game type does not have corresponding init action.
  • wrongState - User is currently in a wrong state. State is returned in state response field.
  • Error codes defined in the action requirements.

remove (c:ClientKit, params:Params):Dynamic

kit/matchmaking.remove

Removes this user from the current matchmaking queue.

User has to be in the "kit/matchExt" state. Puts the user into the default state.

Input:

Output:

  • errorCode - String. Operation error code.

Error codes:

  • ok - Operation successful.
  • wrongState - User is currently in a wrong state. State is returned in state response field.
  • Error codes defined in the action requirements.

startNotify (msg:{webSocket:String, users:Array<Dynamic>, roomID:Int, port:String, moduleName:String, markerID:Int, host:String, clientID:Int}):Void

kit/matchmaking.start

This is a server notification about successful matchmaking. Client needs to connect to the given room server and join the given room.

Output:

  • errorCode - String. Operation error code.
  • host - String. Room server host.
  • port - Int. Room server port.
  • webSocket - String. Room server websocket location.
  • roomID - Int. Room server room ID. Room type string is the same as game type.
  • users - 'Array'. Public matchmaking user information.

Error codes:

  • ok - Operation successful.