diff --git a/README.md b/README.md index a6024d8..b933e5a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,16 @@ # SeaBattle +[![Build Status](https://drone.communiquons.org/api/badges/pierre/SeaBattle/status.svg)](https://drone.communiquons.org/pierre/SeaBattle) + Full stack sea battle game. -Current status: working on backend, and then building web ui... + +## Implementations +Current implementations: +- [x] Rust shell implementations ([server](rust/sea_battle_backend) and [client](rust/sea_battle_cli_player)) +- [ ] web implementation +- [ ] mobile implementation + +## Screenshots +Shell implementation: +![Shell implementation example](rust/sea_battle_cli_player/img/SeaBattleCli.png) diff --git a/rust/sea_battle_backend/README.md b/rust/sea_battle_backend/README.md index fb67f35..aa8ae7c 100644 --- a/rust/sea_battle_backend/README.md +++ b/rust/sea_battle_backend/README.md @@ -1,5 +1,30 @@ # Sea battle backend +[![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/) -A backend server for the Sea Battle game. +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. -A command-line client is available in the `sea_battle_cli_player` crate. +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. diff --git a/rust/sea_battle_cli_player/README.md b/rust/sea_battle_cli_player/README.md index c5f1203..381422a 100644 --- a/rust/sea_battle_cli_player/README.md +++ b/rust/sea_battle_cli_player/README.md @@ -1,3 +1,41 @@ -# Sea battle player +# Sea battle cli player +[![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_cli_player.svg)](https://crates.io/crates/sea_battle_cli_player) +[![Documentation](https://docs.rs/sea_battle_cli_player/badge.svg)](https://docs.rs/sea_battle_cli_player/) -A sea battle shell client player for the `sea_battle_backend` crate. +![](img/SeaBattleCli.png) + +A sea battle shell client player for the [sea_battle_backend](https://crates.io/crates/sea_battle_backend) crate. + +## Available play modes +* 🤖 Play against bot (this mode does not require any Internet connection, a local server is automatically spawn) +* 🎲 Play against a random player +* ➕ Create play invite (online). In this mode, the server returns an invitation code to give to the opponent +* 🎫 Accept play invite (online) + +For the 🤖 bot mode and the ➕ bot mode, game rules can be customized. + +## Installation +You can install the backend using the following command: + +```bash +cargo install sea_battle_cli_player +``` + +## Usage +Simply launch using: +```bash +sea_battle_cli_player +``` + + +## Offline LAN +If you want to run a local server to play offline LAN games, the cli player can also act as the server: +```bash +RUST_LOG=info sea_battle_cli_player -s -l 0.0.0.0:7000 +``` + +Then all the players must specify the address of this server to use it instead of the default official one: +```bash +sea_battle_cli_player -r http://IP_OF_TARGET:7000 +``` \ No newline at end of file diff --git a/rust/sea_battle_cli_player/img/SeaBattleCli.png b/rust/sea_battle_cli_player/img/SeaBattleCli.png new file mode 100644 index 0000000..5864bd7 Binary files /dev/null and b/rust/sea_battle_cli_player/img/SeaBattleCli.png differ