Proxy mode
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.
Nice idea, but a few questions pop up:
- How much complexity would this require? Remember, Mirror is intended to ease the pain of networking.
- Would this require extensive modifications to the already existing workflow?
- Wouldn't this be similar to a Relay?
- I see this solution through the actual implementation with the new proxy transport. The only question is how to work with
RPCcalls exactly at the proxy level. the serialization ofRPCis inMirror - 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). - It differs from
Relayin thatProxyis 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 sendRPCcalls.
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.
Closing as outside the scope of Mirror.