Crate bevy_slinet

Crate bevy_slinet 

Source
Expand description

§bevy_slinet

A simple networking plugin for bevy.

docs.rs Crates.io Crates.io

§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 VersionBevy Version
0.90.13
0.100.13
0.110.14
0.120.14
0.130.15
0.140.16
0.150.17
0.160.17
main0.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 in ServerConfig or ClientConfig.
protocols
Implemented protocols are tcp and udp.
serializer
Implement the ReadOnlySerializer or MutableSerializer 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§

SystemSets
SystemSets in bevy 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 to client or server source code

Traits§

ClientConfig
A client plugin config.
ServerConfig
A server plugin config.