Mirror icon indicating copy to clipboard operation
Mirror copied to clipboard

Proxy mode

Open Seeung opened this issue 3 years ago • 2 comments

Idea I propose to implement the possibility of the Proxy mode.

Solution Description Add Proxy between client and server. All clients connect to Proxy and having additional logic using RPC determines which server to connect the player to (if there is more than one). I'm also optimizing between the proxy and the server to use one connection, and add the ID connection to the packets accordingly for identification. This mechanism will allow you to use multiple servers without operating the connection and disconnection of the user.

Seeung avatar May 22 '22 22:05 Seeung

Nice idea, but a few questions pop up:

  1. How much complexity would this require? Remember, Mirror is intended to ease the pain of networking.
  2. Would this require extensive modifications to the already existing workflow?
  3. Wouldn't this be similar to a Relay?

SoftwareGuy avatar May 23 '22 04:05 SoftwareGuy

  1. I see this solution through the actual implementation with the new proxy transport. The only question is how to work with RPC calls exactly at the proxy level. the serialization of RPC is in Mirror
  2. Because implementation through the transport, then I think the only thing to be modified is to move the serialization to a separate repository to unify the code source for the transport level (this is purely my vision and it may not be true for Mirror).
  3. It differs from Relay in that Proxy is the point of connection to the game, then the proxy itself already controls which server with the world to connect it to, while the proxy itself can additionally send RPC calls.

An example of such a scenario: There is a game where the combat system and text chat presudsvuet. When a player writes to chat, it will make an RPC call and the first message will be processed by Proxy, and so on. it is more logical to unload the server and leave things directly related to the gameplay on it (in our case, the combat system), then Proxy can either process the chat message itself or transfer it to another service that will do it.

Seeung avatar May 23 '22 14:05 Seeung

Closing as outside the scope of Mirror.

MrGadget1024 avatar Nov 24 '22 11:11 MrGadget1024