Insprill / dv-multiplayer

A Derail Valley mod adding multiplayer to the game.
Apache License 2.0
40 stars 20 forks source link

Server browser #10

Open Insprill opened 1 year ago

Insprill commented 1 year ago

Along with being able to manually join servers via an IP, port, and password, there should also be a server browser where players can find servers to play on. In the host settings, there should be an option to list your server in the browser, so people can opt out if they'd like.

We'll create a basic REST API for the backend to ensure compatibility between Steam and Oculus users. This will be written in šŸ¦€RUUUUUUUUUUUUUUUSTšŸ¦€using Actix. Servers will be stored only in memory, so there's no need for a database or any persistent data storage. When a server comes online, it'll send a POST request to the API containing its IP, port, whether it's password protected, and the current/max player count. Every minute the server will send the same POST request to the API to update the data and signify that it's still online. If a request isn't received from a server for over two minutes, it will be removed from the list. When a server shuts down or the owner removes it from the server browser, it'll send another request to the API to remove it from the list immediately.

There will be an advanced config option to specify the URL the server browser API is reachable at, so anyone can host their own instance if need be.

morm075 commented 2 weeks ago

46 resolves this issue