Skip to content

builtin matchmaker

boyism80 edited this page Jul 14, 2026 · 1 revision

Built-in Functions Documentation (Matchmaker)

This document describes functions available to matchmaker type objects (fb.game.matchmaker).

  • mu
  • sigma
  • enrolled
  • registry_id
  • pending_match_id
  • register
  • unregister
  • confirm
  • decline

mu

mu(match_type:integer)

  • Description:
    Returns the current mu (mean skill rating) for the given matchmaking type.
  • Parameters:
    • match_type:integer: Matchmaking queue type (MATCH_TYPE enum value)
  • Return Value:
    • number|nil: Mu value, or nil if no rating exists for the type
  • Example:
    local mm = me:matchmaker()
    local mu = mm:mu(MATCH_TYPE.SOME_QUEUE)
    if mu then
        me:message("mu: " .. mu, MESSAGE_TYPE.STATE)
    end

sigma

sigma(match_type:integer)

  • Description:
    Returns the current sigma (rating uncertainty) for the given matchmaking type.
  • Parameters:
    • match_type:integer: Matchmaking queue type (MATCH_TYPE enum value)
  • Return Value:
    • number|nil: Sigma value, or nil if no rating exists for the type
  • Example:
    local mm = me:matchmaker()
    local sigma = mm:sigma(MATCH_TYPE.SOME_QUEUE)

enrolled

enrolled()

  • Description:
    Returns whether the character is currently enrolled in a matchmaking queue.
  • Parameters:
    • None
  • Return Value:
    • boolean: true if enrolled
  • Example:
    local mm = me:matchmaker()
    if mm:enrolled() then
        me:message("Already in queue", MESSAGE_TYPE.STATE)
    end

registry_id

registry_id()

  • Description:
    Returns the current registry id while enrolled in a queue.
  • Parameters:
    • None
  • Return Value:
    • string|nil: Registry id, or nil if not enrolled
  • Example:
    local mm = me:matchmaker()
    local registry_id = mm:registry_id()

pending_match_id

pending_match_id()

  • Description:
    Returns the pending match id while a proposed match awaits confirmation.
  • Parameters:
    • None
  • Return Value:
    • string|nil: Match id, or nil if no pending match
  • Example:
    local mm = me:matchmaker()
    local match_id = mm:pending_match_id()

register

register(match_type:integer)

  • Description:
    Enrolls the character (or group, when group master) into the given matchmaking queue.
    On success, on_matchmaking_register is invoked from Lua.
  • Parameters:
    • match_type:integer: Matchmaking queue type
  • Return Value:
    • nil on success
    • string error message on failure (suitable for me:message)
  • Example:
    local mm = me:matchmaker()
    local error = mm:register(MATCH_TYPE.SOME_QUEUE)
    if error then
        me:message(error, MESSAGE_TYPE.STATE)
    end

unregister

unregister()

  • Description:
    Unregisters the current queue enrollment.
    On success, on_matchmaking_unregister is invoked from Lua.
  • Parameters:
    • None
  • Return Value:
    • nil on success
    • string error message on failure
  • Example:
    local mm = me:matchmaker()
    local error = mm:unregister()
    if error then
        me:message(error, MESSAGE_TYPE.STATE)
    end

confirm

confirm()

  • Description:
    Confirms participation in the currently pending proposed match. Uses pending_match_id().
    On success, on_matchmaking_confirm is invoked from Lua.
  • Parameters:
    • None
  • Return Value:
    • nil on success
    • string error message on failure (including when there is no pending match)
  • Example:
    local mm = me:matchmaker()
    local error = mm:confirm()
    if error then
        me:message(error, MESSAGE_TYPE.STATE)
    end

decline

decline()

  • Description:
    Declines the currently pending proposed match. Uses pending_match_id().
    On success, on_matchmaking_decline is invoked from Lua.
  • Parameters:
    • None
  • Return Value:
    • nil on success
    • string error message on failure (including when there is no pending match)
  • Example:
    local mm = me:matchmaker()
    local error = mm:decline()
    if error then
        me:message(error, MESSAGE_TYPE.STATE)
    end

See Also

  • me:matchmaker() on character
  • Matchmaking event callbacks in scripts/interaction.lua: on_matchmaking_register, on_matchmaking_unregister, on_matchmaking_confirm, on_matchmaking_decline, on_matchmaking_proposed, on_matchmaking_ready, on_matchmaking_dissolved

Clone this wiki locally