[v2.1.0] MatchmakingService - ON HOLD

I am having problems with the party system, where they are unable to queue up. When I do, “MatchmakingService:QueueParty(players, “unranked”, “2v2”)” it does not give any errors. For the argument “players”, I pretty much set a table which contains the players in the party. “2v2” is the name of the map that I am trying to teleport the party to. Could you give an example of how to correctly implement doing it with a party, just like how you did for single player queue?

Well, first the function returns a boolean value that indicates whether or not it was successfully queued, can you do print(MatchmakingService:QueueParty(players, "unranked", "2v2")) and show me what it returns? Also, these kinds of things are better resolved in a private message so we don’t constantly bump the topic, send me a private message with the result of the print and I’ll be happy to help!

I’ve released version 1.1.0!

Version 1.1.0

Changes (breaking):

  • None

Changes (non-breaking):

  • [Addition] Added MajorVersion to the options table when using GetSingleton(). More info.

  • [Addition] Added MatchmakingService:GetAllRunningGames().

  • [Addition] Added MatchmakingService:GetRunningGames(max, filter).

  • [Change] Changed how matchmaking works internally. It’s no longer as complex and should save a lot of memory calls.

Fixes:

  • [Fix] Fixed PlayerRemovedFromQueue firing with a table as the second value, rather than the values inside the table.
2 Likes

How am I able to make sure that it does not send the player until the numberrange of people has been reached?

Players will not be added to games until the low end of the number range is reached. NumberRange.new(min, max). So it wont add players to games until min is reached.

but when i tested it, it sent me into the game even tho am the only person in queue and min range is 5?

You’ll have to show me some of your code because that doesn’t happen to me when using the latest version. Preferably in private messages so that we don’t continue to bump the topic.

1 Like

I’ve released 1.2.0 with a small change, and a fix:

Version 1.2.0

Changes (breaking):

  • None

Changes (non-breaking):

  • [Addition] Added MatchmakingService.FoundGame signal which is fired when a player finds a game and is going to be teleported. It is fired with the arguments userId, gameCode, gameData. More info.

  • [Addition] Added MatchmakingService:SetFoundGameDelay(newValue) which will delay players teleporting to their game for the number of seconds provided so that you can show a UI, etc.

  • [Change] SetPlayerInfo now accepts a teleportAfeter parameter which is the unix timestamp milliseconds after which the player will teleport.

  • [Change] Changed all error calls to warn calls to prevent code execution from stopping.

Fixes:

  • [Fix] GetRunningGames will properly return up to max games.
3 Likes

How would I be able to get all the players in a queue for a map?

https://steven4547466.github.io/MatchmakingService/maindocs/#getting-the-queue

1 Like

Came back to here after a few months and finally implemented it into my game. I have found a few issues however.

  • Finding a match seems to be desynced between 2 servers. If one server finds the match with the other server, server 1 will correctly begin the teleport while server 2 isn’t up to speed with this until a few seconds later. I’d like to note that this is a minor problem and not too much of an issue.

  • The FoundGame signal does not seem to be connecting properly, and instead of returning a connection it returns a function. Of course, doing :Disconnect() on a function just errors. I had to end up forking the module and swapping Signal:Create() to Instance.new(“BindableEvent”) and using .Event to make this work.

  • FoundGame doesn’t seem to be firing all the time, and would sometimes only be firing for one server and not the other server. I fixed this by making it fire right before the teleport happens. This only works in my scenario because there is only one group of players to teleport, so I don’t have to worry about who I fire it for.

After both of these challenges I was able to get it perfectly up and running, just using a modified version.

I’m not sure if there’s anything I can do about this.

If you wish to disconnect a listener from a signal you have to use Signal:Disconnect(Listener) because of the way it’s set up. i.e.:

local listener = MatchmakingService.PlayerRemovedFromQueue:Connect(function(...)
	print(...)
end)

MatchmakingService.PlayerRemovedFromQueue:Disconnect(listener)

However I don’t believe I’ve documented this anywhere, so I will add that soon.

This is a mistake on my part and I will fix that asap so that it fires for all servers.

Version 1.2.1

Changes (breaking):

  • None

Changes (non-breaking):

  • None

Fixes:

  • [Fix] FoundGame should now fire properly on all servers, not just the main handler.
3 Likes

Wow, that was a quick response. I tested the new version you just pushed out and it seems to have fixed that problem, and I swapped my code to using the new :Disconnect() and it seems to have fixed that problem too.

Thank you, its all working fine now.

1 Like

Great to hear, thanks for the feedback!

1 Like

Version 1.3.0

Changes (breaking):

  • None

Changes (non-breaking):

  • [Addition] Added DisableGlobalEvents to the options table when using GetSingleton. Setting this to true will disable PlayerAddedToQueue and PlayerRemovedFromQueue from firing for users not in the server and will save you messaging service quota.

Fixes:

  • None
2 Likes

Testing out the update and it wouldn’t matchmake. I then un-queued and got this error.
image
(I download each new version when I want to so that it won’t auto-update)

Update: I found another error with it.

ServerStorage.Modules.MMService:408: attempt to perform arithmetic (add) on nil and number
ServerStorage.Modules.MMService, line 408

I’ll look into it asap. The update shouldn’t have caused this though, odd. Maybe an oversight. Thanks for the report

Line 408 is an end (however prob just an extra few lines), are you sure you’re up to date? As for the other error does it happen all the time?

This was on version 1.2.1

408: if mainJobId == nil or mainJobId[2] + 30000 <= now then

I’m not sure if this was fixed in the newest version or not.