https://github.com/ralith/metaserve
Toolkit for building meta servers for multiplayer games
https://github.com/ralith/metaserve
Last synced: 11 months ago
JSON representation
Toolkit for building meta servers for multiplayer games
- Host: GitHub
- URL: https://github.com/ralith/metaserve
- Owner: Ralith
- License: apache-2.0
- Created: 2018-10-15T02:38:12.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2022-02-20T02:35:33.000Z (over 4 years ago)
- Last Synced: 2025-01-12T06:40:34.264Z (over 1 year ago)
- Language: Rust
- Homepage:
- Size: 60.5 KB
- Stars: 8
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
[](LICENSE-MIT)
[](LICENSE-APACHE)
# metaserve
Multiplayer games often want to present players with a list of servers to choose from, with
information about each server's current state such as server name, selected map, and player
count. To support this, metaserve provides a toolkit for aggregating small "heartbeat" blobs of
information from game servers and distributing the aggregated data to clients on demand, labeling
each blob with the address of the originating game server. Metaserve does not enforce any structure
within an individual heartbeat blob; it's up to calling code to decide what information game servers
will publish and how it is encoded.
A system built using this toolkit consists of three types of logical entities: meta servers, game
servers, and game clients.
Every **game server** maintains a connection to a meta server, sending a heartbeat blob at regular
intervals. To implement a game server, connect to a meta server, then use that connection to
construct a `metaserve_heartbeat::Heartbeat` and `send` new heartbeat data at regular intervals.
**Game clients** may connect to a meta server to receive the set of currently-connected game servers
and the latest heartbeat from each, updated at regular intervals. Game servers are identified to
clients by the IP address and port they contacted the meta server from. To implement a game client,
connect to a meta server, then use that connection to construct a `metaserve_client::Client` and
`recv` lists of server updates as they occur.
The **meta server** stores the latest heartbeat from every currently-connected server and broadcasts
changed heartbeat data to clients. A complete implementation is provided in `daemon`.
All communications are performed over QUIC, using `quinn` connections. Downstream code is
responsible for establishing connections and recovering from connection loss if necessary; this
ensures that arbitrary connection configurations can be used.
## License
Licensed under either of
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the
work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any
additional terms or conditions.