Update Readme.md

This commit is contained in:
Christoph Hagen 2022-11-24 21:31:10 +01:00
parent 1c36d8c480
commit 73be9ae283

125
Readme.md
View File

@ -1,100 +1,55 @@
# Game process # Schafkopf Server
1. Register user This package provides a simple server to play the Bavarian game *Schafkopf* via a browser.
- Store name, password
- Create session token
2. Create table
- Store name
- Create id
- Add player to table
3. Wait for all players
4. Deal first 4 cards
- Store all hand cards, show only 4
5. Collect leger
- Consecutive choice for each player
6. Deal last 4 cards
- Start bidding
7. Bidding
- Choice for each player to match/increase bid
8. Select game
- Highest bidder selects game
- Move to playing
9. Play cards
- Allow shots until certain trick
- Collect completed tricks
- Determine winning card
- End game on last card
10. Finish game
- Count points
- Determine winner
- Back to 4
# Architecture ## Setup
## Messages to clients over the websocket #### Configuration
### Table info Create a `config.json` file in the `Resources` directory, and fill in all required information. You can have a look at the `config_example.json` file for the required fields.
Contains the general information about the table: ```json
- Player names, Table name {
"serverPort": 8000,
"production": false,
"mail": {
"serverDomain": "https://example.com/schafkopf",
"emailHostname": "example.com",
"email": "schafkopf@example.com",
"password": "some-secret-string",
"tokenExpiryDuration": 15,
}
}
```
### ConnectionState If `production` is set to `false´, then the database will only be created in memory, and deleted when the server is terminated.
The `mail` configuration is optional, and used to send the password recovery emails.
Indicates which players are currently online You also need to set the API path in the `Public/api.js` file to the path where the server is run.
```js
const apiPath = "/schafkopf"
```
### GameState The server can be then be run like any other executable swift package:
```bash
- Current player (either to play a card, state game intention, ) swift run
- First player in the round ```
- Game type (either game, or negotiation stage)
# TODOs
## Make UI for table
- Show players (+ connection state)
- Show played cards
- Show own cards
- Game negotiation
## Updates from server
- Players at table (+ connection state, first/current player)
- Played cards
- Current player
- Game negotiation data
- Remaining cards
- Game results
## API
- Leave table
- Start game
- Send negotiation input
- Send played card
- Send
## Logic
- Shuffle cards
- Cards, Card sets
- Determine playable cards
- Determine win of round
- Rank game types, negotiation
# Roadmap # Roadmap
Version 2: There are a few features still missing from this implementation:
- Configure game options
- Switch player positions
- Set first player
- Add game costs and player scores
- Introduce "legen" and "schießen"
Version 3: - Global rankings of players by their points
- Private tables - Point penalties for players leaving a running game
- Add simple computer player - Computer players
- Global statistics for players - Automatically playing a card after a timeout
- Save data persistently - Table options to allow/disallow games and change other settings
- Table administrator can remove players - iOS App
# Bugs ## Improvements
- Layout improvements for mobile devices in landscape mode
- Complete German/English localization
- Add last online date to user data
- Correctly show available games