A simple matchmaking module for Javascript.
Here's an example on how to use this:
``
import mm from "matchmaking"
const serverArray = [sv1, sv2, sv3]
mm.startMatchMaker(serverArray, 1, 50) // Rank matching enabled, anyone within 50 rank of another user will be matched with them
const user1 = await mm.startMatch(UUID1, "100") // Doesn't return anything until someone else enters the queue with a close enough rank or after ~21 seconds, after which it returns "002-0001". It sends a promise if the call worked.
const user2 = await mm.startMatch(UUID2, "120") // Returns sv1 for this call and the other since they both have a close enough rank to be matched.
`
Alternatively, if you don't want to use ranking, do this instead:
`
import mm from "matchmaking"
const serverArray = [sv1, sv2, sv3]
mm.startMatchMaker(serverArray, 0) // Rank matching disabled
const user1 = await mm.startMatch(UUID1) // Same as before, just without the rank check
const user2 = await mm.startMatch(UUID2) // Returns sv1 for this call and the other one since there is someone in the queue
``