-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace party ready
check with match confirmation
#607
Comments
* Add dummy implementation for client command `match_ready` (#607) * Add test * Fx test * Fix test 2 * Fix test 3
@Askaholic That way it would be possible for the client to detect sombody dropping out (for example by closing the client) and then instesd of everybody having to wait for the timeout, the server could immediately cancel the match. |
There is a ready and unready message |
Wait yeah I see this spec is different. I thought that the messages were the ready_party and unready_party messages as these were put into the client? Not that it matters to much as the name and text can be changed but just making sure. |
Sounds like a reasonable idea to me. |
So can the ready and unready party commands be removed as they aren't currently used anyway |
Yea I think so. We were going to repurpose them to solve the issue of not knowing when your party members are in game, but I don't think that will happen anymore. I'd rather solve that issue the right way. |
Soo... what exactly is the conclusion? Keep match_ready? Add flag? Remove the others? And while we are at it, i find the command name a bit confusing, but i guess its really not that important. |
Now would be the time to change it so feel free to suggest how you think it should work. A flag is probably better that two separate commands. |
Yeah i feel it would be cleaner with a flag, so like this:
|
What format is this |
Yea it should have a T. Not sure where I got that from, but we should stick to standard ISO format. One thing we learned from using ISO timestamps for matchmaker queue pops is that they lead to bad data sometimes when users system time is misconfigured. So we might want to consider a time delta instead. |
Both never hurts in case of weird delays as well |
Isnt delta time a bit overkill here? |
Well do you want people complaining on the forums that the match confirmation box is displaying a time of 2 hours or do you not want that to happen... |
Sendiing both relative and absolute times whenever you need to send a time is really the solution to that problem? How often does this problem happen? Should we not make a general check if system clock is correct instead of duplicating all our time fields wherever we go? The misconfigured time is a problem that lies on a completely different abstraction level than matchmaker code should ever concern itself with, so sending two fields here is just messy. If the time problem is really a relevant problem than that can be handled with a check that will not start the client at all if time is misconfigured. |
It is for better user experience. Otherwise you have to tell every user who has the issue to set their clock correctly. And locking people out of the client because of a mis-configured system time is definitely not a good thing to do. |
Telling the user to fix his time settings is much more reasonable than fixing broken time sync in every time related API call that will ever be added to this client. Fixing it in this issue means that you will fix it again and again ein every API to come! Your are increasing, not just code but API complexity, to workaround user level problems, and you are doing it in a way that it will infect all future APIs as well! |
Here is an example for how a much better solution could look like:
Dont get me wrong,, i am not in favor of doing that, i think a simple user facing error is fully reasonable, but at least you don't infect unrelated API endpoints with time problem workarounds. |
I guess we could just have a relative time in seconds. But having two times (if they conflict you would use the relative time anyway) is just not right. |
We wouldn't even need to add a time sync endpoint. We could just send the current time in the welcome message. |
Overview
For the purposes of a matchmaker it makes more sense to perform the "are players ready to start" check when a match is found instead of when the party is entered into the queue. I suggest that we add a
match_info
message that look something like this:Where
expires_at
is a timestamp in ISO format andready
refers the the ready state of the player that the message is being sent to (this way the client can synchronize its UI state with the server).The client can display this information and provide a "Ready up" button. When a player clicks the button, the client will send a
match_ready
command that will look something like this:Once all players have readied up, the server will start the match launching procedure. If some players fail to ready up by the expiry time (say
20
seconds from when the match was found) then the match will be cancelled, the server will send amatch_cancelled
message and return both searches to the matchmaker queue (notifying the client with asearch_info
command).Implementation
I suggest writing a small wrapper around a future that will keep track of which players have readied up:
and adding a weak reference to it on the
Player
objects. Then the player object can also get a methodwhich will check if the player has a match offer and proxy the call to
ready_player
.Multiqueue support
To support players joining multiple queues at the same time we'll also need to modify the
Search
object and add a property which signals whether the search should be included in the matching phase, or if it is currently "busy" waiting for players to accept a match offer.The text was updated successfully, but these errors were encountered: