SeaBattle/rust/sea_battle_cli_player/README.md

41 lines
1.5 KiB
Markdown
Raw Normal View History

2022-10-17 18:25:19 +00:00
# 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/)
2022-10-17 17:13:16 +00:00
2022-10-17 18:25:19 +00:00
![](img/SeaBattleCli.png)
2022-10-17 18:29:41 +00:00
A sea battle shell client player for the [sea_battle_backend](https://crates.io/crates/sea_battle_backend) crate, based on the [tui](https://crates.io/crates/tui) library.
2022-10-17 18:25:19 +00:00
## 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)
2022-10-17 18:29:41 +00:00
For the 🤖 bot and create invite modes, game rules can be customized before starting the game.
2022-10-17 18:25:19 +00:00
## 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
```