colyseus / colyseus-unity-sdk

⚔ Colyseus Multiplayer SDK for Unity
https://docs.colyseus.io/getting-started/unity-sdk/
MIT License
371 stars 102 forks source link

Regression: Cannot use multiple Colyseus settings. #156

Closed tonygiang closed 3 years ago

tonygiang commented 3 years ago

The current Unity client is very restrictive in terms of endpoints. At any given moment, ColyseusRequest has only one monolithic ColyseusSettings to send request through, and we'd have to override this monolithic settings via ColyseusManager to connect to a different endpoint on runtime.

This does not fit a lot of real use-cases, such as running each gameplay mode endpoint on one process that listens to one port, and the global chat endpoint on a different process that listens to a different port, so that they can each can be independently taken down for maintenance without affecting the other processes. And the client has to simultaneously connect to all of these endpoints.

Pre-0.14.5, we could connect to different Colyseus endpoints by creating a separate Colyseus.Client for each endpoint. But that method has no effect now. Please rework the API of the Unity client to restore this feature.