cards/readme.md

83 lines
2 KiB
Markdown
Raw Normal View History

2024-04-06 18:17:11 -04:00
# Cards For Humanity
2024-04-05 22:38:41 -04:00
2024-08-30 01:51:05 -04:00
Live at [https://cards.doordesk.net](https://cards.doordesk.net)
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
2024-08-05 00:08:29 -04:00
2024-07-20 23:00:19 -04:00
With auto-reload:
2024-08-05 00:08:29 -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-08-05 00:08:29 -04:00
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
2024-08-05 00:08:29 -04:00
- [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-08-05 00:08:29 -04:00
2024-07-20 23:40:07 -04:00
```sh
trunk build --release
```
2024-07-18 19:53:28 -04:00
### Server
2024-08-05 00:08:29 -04:00
2024-07-20 23:40:07 -04:00
```sh
2024-08-30 01:51:05 -04:00
cargo build --release
2024-07-20 23:40:07 -04:00
```
2024-07-18 19:53:28 -04:00
2024-08-05 00:08:29 -04:00
---
2024-04-27 02:34:28 -04:00
2024-08-30 01:51:05 -04:00
- The server automatically serves the built client from `/dist` at `127.0.0.1:3030`. When building for release the client automatically points to doordesk
2024-04-13 21:04:42 -04:00
2024-08-30 01:51:05 -04:00
- Configure any custom clients to connect to `ws://127.0.0.1:3030/websocket` for local testing or `wss://cards.doordesk.net/websocket` to use my server
2024-04-13 21:04:42 -04:00
2024-10-08 21:54:05 -04:00
## Tools:
There is a tool named socket_blaster used for stress testing the server.
Run
```sh
cargo run -p socket_blaster -- -h
```
to see available options.
2024-04-05 22:38:41 -04:00
## TODO:
2024-08-05 00:08:29 -04:00
- prevent zombie users after browser crash
- figure out proper auth - client's problem?
- use db
- test bincode and probably move away from json
- make typescript sdk
- support card text editing
- prevent import of cards that have been seen already and edited
- handle duplicates
- efficiency
- make demo clients for multiple platforms and screens