Multi-user lobby architecture and dating system?

I want to create a system in which a player can

  • Launch the game, press the button to enter the arena, which will send its profile / address / IP address / player profile to the server.

  • The game / lobby server will store a collection of all available players. He will constantly look for pairs of players that are a “match” (the algorithm doesn't matter right now).

  • When he finds two players in the queue that are a “match”, based on the player’s profile data, he will select one of the players as a server and then inform the game clients that a match has been found. Based on the notification that the client receives, the client that was selected as the server will start the server, and the client of the other player will connect to this initialized server when it is ready.

What is a good way to customize this? My first thought was to send player statistics via HTTP POST. But in some cases, it can be a few minutes before the server finds a match and answers what type of connection the player will have and who will be his opponent. Would HTTP be suitable for this? Or should it be a lower-level, socket-based approach? Or am I completely here?

PS The game is a development in Unity. I would prefer answers that were not just “here is a link to a plugin that works”, since I am interested in understanding the architecture of how this is usually implemented.

Any guidance would be appreciated.

+4
source share
1 answer

. , http . http post/get , . 5 , .

UDP , , , TCP ( , ). - - , http post/gets, - (, , ).

, , http ( udp , http, ).

IIS- {insert framework (WCF, WebAPI, aspx pages, php even)}.

, api, .

, , , , (- > , < - HTTP get/post).

  • 1 → Hello ( . )
  • 1 R.1. < - Welcome ( , , )
  • 1 R.2. < - ( , )
  • 2 → FindMatch (Matchmaking , "", , - . , " " .. , . ping , , . "ping", )
  • 2 R.1 < - NothingYet ( , )
  • 2 R.2 < - GotOne ( . , .)
  • 3 → ( )

, . , , UDP. TCP, ( ).

+4

Source: https://habr.com/ru/post/1529912/


All Articles