Matchmaking package game server module.

ALPHA: This module and all underlying classes are currently in alpha.

Include in game server with:

    loadModules([
      snipe.packages.matchmaking.GameModule,
      ]);

Needs user class link defined in a MatchmakingUserClass.hx file like this:

typedef MatchmakingUserClass = MatchmakingUser;

Cache server configuration variables:

*

Game server configuration variables:

  • packages/matchmaking.getCountCacheTime - Amount of time in seconds that getCount() API result is cached for on the game server. Equals 1 by default.

Constructor

Methods

inline add (listID:String, user:MatchmakingUserClass):Unknown

Adds this user to the specified matchmaking user list.

Note: A single user can only be in one matchmaking list. It will be automatically removed from other lists. If the user is added for the second time, his record will be replaced with the new one.

Parameters:

listID

Matchmaking list ID.

user

User data object. Has to at least have "id" and "__addedTime" fields.

Returns:

Operation error code. "ok" - operation was successful. "listNotFound" - list with this ID was not found.

getCount (listID:String):Int

Returns the amount of users in the specified matchmaking user list. The value is cached locally for the amount of seconds specified in packages/matchmaking.getCountCacheTime configuration variable.

Parameters:

listID

Matchmaking list ID.

Returns:

Amount of users in the list.

inline remove (listID:String, id:Int):Unknown

Removes this user from the specified matchmaking user list.

Parameters:

listID

Matchmaking list ID.

id

User ID.

Returns:

Operation error code. "ok" - operation was successful. "listNotFound" - list with this ID was not found.