Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xide/bevy-websocket-adapter
Simple adapter to receive WebSocket messages in your bevy games as native Rust types.
https://github.com/xide/bevy-websocket-adapter
Last synced: 3 months ago
JSON representation
Simple adapter to receive WebSocket messages in your bevy games as native Rust types.
- Host: GitHub
- URL: https://github.com/xide/bevy-websocket-adapter
- Owner: Xide
- Created: 2021-10-07T00:58:21.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-10-10T22:17:11.000Z (over 3 years ago)
- Last Synced: 2024-10-14T14:21:24.602Z (3 months ago)
- Language: Rust
- Size: 35.2 KB
- Stars: 3
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bevy websocket adapter
> Simple adapter to receive WebSocket messages in your [bevy](https://bevyengine.org/) games as native Rust types.
:construction: | This is a work in progress, many major features are not implemented
:---: | :---It uses `tokio` as the async backend and `tungstenite` for websocket protocol implementation.
You can check the [`examples`](./examples) directory for more details on the usage of this crate.
### Table of content
- [Bevy websocket adapter](#bevy-websocket-adapter)
- [Table of content](#table-of-content)
- [Message format](#message-format)
- [Roadmap](#roadmap)#### Message format
All websocket messages must be JSON object in this format:
```json
{
"t": "MyMessageType",
"d": "..."
}
```:warning: | The `t` field MUST be unique across all your messages types, one value of `t` will always map to the same native rust type.
:---: | :---The contents of `d` can be any valid JSON value. Your native rust type must be able to serialize/deserialize the contents of `d` using the `serde_json` crate.
#### Roadmap
- [x] Receive message from clients
- [x] Deserialize messages to native Rust types
- [x] Connect / Disconnect EventReader
- [x] Send messages to clients
- [x] Broadcast message
- [ ] Client
- [ ] Raw message EventReader in Bevy
- [ ] Unmatched messages EventReader