spring / uberserver

uberserver, a matchmaking/chat lobby server for the spring rts project
https://springrts.com/wiki/Uberserver
Other
33 stars 38 forks source link

Matchmaking protocol proposal #384

Closed Teifion closed 1 year ago

Teifion commented 3 years ago

As part of my Uberserver (US) alternative Teiserver (TS) I'm going to be adding matchmaking. While I currently work with the BAR team, I'd like all aspects of the Spring community the option/opportunity to have feature compatibility.

The matchmaking document I've been working on sits here but I'm including the full document below to save jumping around.


Matchmaking is where players join a matchmaking queue and the server gradually matches them up against other players in the same queue. Where possible the server will try to match them up against players of a similar skill but this must be balanced with wait times and queue size.

Other resources

Client to Server messages

c.matchmaking.list_all_queues

Expects a response of s.matchmaking.full_queue_list

C > c.matchmaking.list_all_queues
S > s.matchmaking.full_queue_list queue1 queue2

c.matchmaking.list_my_queues

Expects a response of s.matchmaking.your_queue_list

C > c.matchmaking.list_my_queues
S > s.matchmaking.your_queue_list queue1 queue2

c.matchmaking.get_queue_info queue_name

Expects a response of s.matchmaking.queue_info

C > c.matchmaking.get_queue_info
S > s.matchmaking.queue_info queue1 --TODO--

c.matchmaking.join_queue queue_name

Tells the server to add the player to the MM queue. A player can be part of multiple queues at the same time (provided they and their party meet all criteria of the queues such as party size). Expects either a OK cmd=c.matchmaking.join_queue queue_name or NO cmd=c.matchmaking.join_queue queue_name.

C > c.matchmaking.join_queue queue1
S > OK cmd=c.matchmaking.join_queue queue1
S > NO cmd=c.matchmaking.join_queue queue1

c.matchmaking.leave_queue queue_name

queue_name :: String Tells the server to remove the player from the specified MM queue. No response expected.

C > c.matchmaking.leave_queue queue1

c.matchmaking.leave_all_queues

Tells the server to remove the player from all MM queues. No response selected.

C > c.matchmaking.leave_all_queues

c.matchmaking.ready

Tells the server the player is ready to participate in the MM game. Sent in response to a ready_check. It is possible others will not ready up, in which case a s.matchmaking.match_cancelled will be sent.

S > s.matchmaking.ready_check queue1
C > c.matchmaking.ready
S > s.matchmaking.match_cancelled queue1

c.matchmaking.decline

Tells the server the player is not ready to participate in the MM game. This will result in the player being removed from all MM queues as if they'd sent c.matchmaking.leave_all_queues.

S > s.matchmaking.ready_check queue1
C > c.matchmaking.decline

Server to Client messages

s.matchmaking.full_queue_list

Lists all the queues currently active along with basic information about each queue such as player count and expected wait time.

C > c.matchmaking.list_all_queues
S > s.matchmaking.full_queue_list queue1 queue2

s.matchmaking.your_queue_list

Identical to s.matchmaking.full_queue_list but filtered to only include queues the player is a member of.

C > c.matchmaking.list_my_queues
S > s.matchmaking.your_queue_list queue1 queue2

s.matchmaking.queue_info

Gives more detailed info about the queue. Currently not sure exactly what info will need to be contained but it feels like this might be needed as things are fleshed out.

C > c.matchmaking.get_queue_info
S > s.matchmaking.queue_info queue1 --TODO--

s.matchmaking.ready_check queue_name

When an MM game is ready the player is placed into a special "readyup" state where they are assigned to a potential game and sent this message. The player is expected to either send back a c.matchmaking.ready or c.matchmaking.decline.

If all players ready up the game is created. If any players fail to ready up in the time frame or decline those players are removed from all matchmaking queues (they can rejoin though a timeout could be applied) and the players that did ready up are placed back in the queue in their previous positions (the readyup state is removed).

S > s.matchmaking.ready_check queue1
C > c.matchmaking.ready
C > c.matchmaking.decline

s.matchmaking.match_cancelled queue_name

When one or more of the other players selected for a match cancel, this message is sent to all others that were selected as potentials for this match. It informs the client they are still in the queue and retain their place in the queue. No client response is expected.

S > s.matchmaking.match_cancelled queue1

Structure of a queue on server

Persistent values

Transient values

Other features to consider in the future