انتقل إلى المحتوى
#0881
DaemonContainers

A hundred ports, one program, a room per port

Your match server is one program in the daemon: room-server, port_range 9000 to 9099, port_param --port, lazy_load: true. A hundred ports, a hundred registered instances, none of them running.

A lobby fills. The matchmaker POSTs /programs/{id}/start with port: 9037 and wait: true; the daemon brings up that one instance and returns when it is RUNNING. Players connect over WebSocket at the container's port-forward URL for 9037: HTTPS, HTTP/2, certificate already there. The match ends and the matchmaker sends stop with the same port. Room 37 goes back to being a line in a config file.

Nothing you don't start is running, so an empty room costs nothing and a full one costs the box you already pay for. No pod per match, no autoscaler, no cluster to keep warm.

The room list is a port range.