Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dns2utf8/shotgun
https://github.com/dns2utf8/shotgun
game network
Last synced: about 9 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/dns2utf8/shotgun
- Owner: dns2utf8
- License: apache-2.0
- Created: 2016-03-16T12:19:45.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-01-15T16:18:41.000Z (about 4 years ago)
- Last Synced: 2024-11-16T18:34:12.561Z (2 months ago)
- Topics: game, network
- Language: Rust
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Shotgun
Connect your bot and play a game.
Currently this repo is under heavy development.
It will be transfered to Github once it reaches a stable phase.# Protocol
The protocol is message oriented.
Each message is terminated with a `\n` newline.## Handshake
The handshake must be initialized from the client by sending a correct `ClientHello`.
After the server responds with the `ServerHello` the conversation enters the multiplexed phase.## Multiplexing
After the handshake each line is prefixed with a global game id.
Offcourse there is no rule without exception:
The `RequestNewGame` message does not need to be multiplexed.## Grammar
```
ClientHello := 'Nickname: >' "Nickname" '<>' "Programming Language"
ServerHello := 'Shotgun Arena Server v' ProtocolVersion ' :: max round length[ms]: ' u64
ProtocolVersion := '0'
RequestNewGame := 'RequestNewGame'
MultiplexedMessage := u64 ':' Action
Action := 'NewGame { player_name_a: ' String ', player_name_b: ' String ' }' | 'WinGame' | 'LoseGame' | RoundAction | 'RoundResult { a: ' RoundAction ', b: ' RoundAction ' }' | 'ErrorEnd'
RoundAction := 'Timeout' | 'Duck' | 'Load' | 'Shoot' | 'Klick'
```## Example communication
Client messages are prefixed with `< `, server messages with `> `.
All messages are terminated with `\n`:```
< ClientHello { nickname: "me" }
> ServerHello
< RequestNewGame
> '13:NewGame { player_name_a: "me", player_name_b: "some bot" }'
< '13:Load'
> '13:RoundResult { a: Load, b: Load }'
< '13:Shoot'
> '13:RoundResult { a: Shoot, b: Load }'
> '13:WinGame'
```# TODO
- [X] Define protocol
- [X] Handshake
- [X] Correct bot
- [ ] Server match-makeing
- [ ] Server releay communication / Arena mode