Expand description
§bevy_slinet
A simple networking plugin for bevy.
§Features
- You can choose TCP or UDP protocol. Adding your own protocols is as easy as implementing a few traits.
- Multiple clients/servers with different configs (specifies a protocol, packet types, serializer, etc.)
- De/serialization. You choose a serialization format, packet type (you probably want it to be
enum
), and receive events with deserialized packets.
Note: Everything in bevy_slinet is feature-gated. Make sure to enable features you need (
client
,server
,protocol_tcp
,protocol_udp
,serializer_bincode
,serializer_bincode_serde
).
Note: you should implement keep-alive and disconnection systems yourself, or look at lobby_and_battle_servers example
§More Examples
§Compatibility table
Plugin Version | Bevy Version |
---|---|
0.9 | 0.13 |
0.10 | 0.13 |
0.11 | 0.14 |
0.12 | 0.14 |
0.13 | 0.15 |
0.14 | 0.16 |
0.15 | 0.17 |
0.16 | 0.17 |
main | 0.17 |
Modules§
- client
- Client part of the plugin. You can enable it by adding
client
feature. - connection
- This module contains structs that are used connection handling.
- packet_
length_ serializer - In bevy_slinet all packets are prefixed by their length.
- protocol
- Implement
Protocol
to create your own protocol implementation and use it inServerConfig
orClientConfig
. - protocols
- Implemented protocols are
tcp
andudp
. - serializer
- Implement the
ReadOnlySerializer
orMutableSerializer
trait for serialzer and build it in config refer BincodeSerializer to check how to do this. - serializers
- Implemented serializers:
- server
- Server part of the plugin. You can enable it by adding
server
feature.
Enums§
- System
Sets SystemSets
inbevy
are used for system ordering. See [System Order of Execution][cheatbook_order] on unofficial bevy cheatbook for details. For more details on what each SystemSet means, refer toclient
orserver
source code
Traits§
- Client
Config - A client plugin config.
- Server
Config - A server plugin config.