2024-04-06 18:17:11 -04:00
# Cards For Humanity
2024-04-05 22:38:41 -04:00
2024-04-06 18:17:11 -04:00
A game master server for the popular game [Cards Against Humanity ](https://www.cardsagainsthumanity.com/ ) using data from [Chris Hallberg ](https://crhallberg.com/ )'s project [JSON Against Humanity ](https://github.com/crhallberg/json-against-humanity ) (everyone say "Thanks, Chris!")
2024-04-05 22:38:41 -04:00
2024-04-06 18:17:11 -04:00
This started as a problem trying to play games with friends who are all on different platforms. This shall be as cross-platform as it gets. I want it to work on anything that can establish a connection and allow anyone to write any front-end they can dream up whether it be a web page, chat bot, VR, etc. Any clients who share a master server can play together across any platform.
2024-04-05 22:38:41 -04:00
2024-07-20 23:00:19 -04:00
## Test/Dev:
### Server
With auto-reload:
2024-07-20 23:02:58 -04:00
* [Install cargo-watch ](https://github.com/watchexec/cargo-watch?tab=readme-ov-file#install )
2024-07-20 23:10:22 -04:00
2024-07-20 23:41:20 -04:00
Then:
2024-07-20 23:40:07 -04:00
2024-07-20 23:10:22 -04:00
```sh
2024-07-20 23:07:05 -04:00
watch -i client -cx run
```
2024-07-20 23:00:19 -04:00
2024-07-24 22:09:01 -04:00
or if you're lazy like me just run `./test`
2024-07-20 23:00:19 -04:00
Without auto-reload:
2024-07-20 23:40:07 -04:00
```sh
cargo run
```
2024-04-13 21:04:42 -04:00
2024-07-18 19:53:28 -04:00
### Client
* [Install Trunk ](https://trunkrs.dev/#install )
2024-07-20 23:40:07 -04:00
2024-07-20 23:41:20 -04:00
Then:
2024-07-20 23:40:07 -04:00
```sh
trunk serve --open
```
2024-07-20 23:00:19 -04:00
## Build:
### Client
2024-07-20 23:40:07 -04:00
```sh
trunk build --release
```
2024-07-18 19:53:28 -04:00
### Server
2024-07-20 23:40:07 -04:00
```sh
cargo build
```
2024-07-18 19:53:28 -04:00
2024-07-20 23:41:20 -04:00
----------
2024-07-20 23:00:19 -04:00
* The server automatically serves the built client from `/dist` at `0.0.0.0:3030`
2024-04-27 02:34:28 -04:00
2024-07-23 23:10:13 -04:00
* Configure any custom clients to connect to `ws://0.0.0.0:3030/websocket`
2024-04-13 21:04:42 -04:00
2024-04-05 22:38:41 -04:00
## TODO:
2024-04-06 18:17:11 -04:00
* finish game logic
2024-08-02 20:33:51 -04:00
* prevent multiple users claiming the same identity and then all losing it - may create a zombie
* prevent zombie users after browser crash
2024-08-04 16:18:44 -04:00
* figure out proper auth - client's problem?
2024-08-02 20:33:51 -04:00
* use db
2024-08-04 16:18:44 -04:00
* test bincode and probably move away from json
* make typescript sdk
2024-04-06 18:17:11 -04:00
* support card text editing
* prevent import of cards that have been seen already and edited
* handle duplicates
2024-05-17 01:25:12 -04:00
* efficiency
* make demo clients for multiple platforms and screens