2022-10-17 17:13:16 +00:00
|
|
|
# Sea battle backend
|
2022-10-17 18:25:19 +00:00
|
|
|
[![Build Status](https://drone.communiquons.org/api/badges/pierre/SeaBattle/status.svg)](https://drone.communiquons.org/pierre/SeaBattle)
|
|
|
|
[![Crate](https://img.shields.io/crates/v/sea_battle_backend.svg)](https://crates.io/crates/sea_battle_backend)
|
|
|
|
[![Documentation](https://docs.rs/sea_battle_backend/badge.svg)](https://docs.rs/sea_battle_backend/)
|
2022-10-17 17:13:16 +00:00
|
|
|
|
2022-10-17 18:25:19 +00:00
|
|
|
A backend HTTP server for the Sea Battle game. The binary included in
|
|
|
|
this crate can be used to deploy a server that will allow players to
|
|
|
|
connect to play together.
|
2022-10-17 17:13:16 +00:00
|
|
|
|
2022-10-17 18:25:19 +00:00
|
|
|
The `actix-web` library is used to spawn HTTP server. The games are encapsulated
|
|
|
|
inside websockets.
|
|
|
|
|
|
|
|
An official server is running at https://seabattleapi.communiquons.org/
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
You can install the backend using the following command:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cargo install sea_battle_backend
|
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
```bash
|
|
|
|
sea_battle_backend -l 0.0.0.0:7000
|
|
|
|
```
|
|
|
|
|
|
|
|
> Note: a reverse-proxy must be used to protect
|
|
|
|
|
|
|
|
## Client
|
|
|
|
A command-line client is available in the [sea_battle_cli_player](https://crates.io/crates/sea_battle_cli_player) crate.
|