flame_multiplayer_dashwire 1.0.0-rc.2
flame_multiplayer_dashwire: ^1.0.0-rc.2 copied to clipboard
Outside the 1.0 semver promise. A dashwire connection as a flame_multiplayer wire: rooms, rollback, turns and ghosts over WebSocket, loopback or a simulated network.
flame_multiplayer_dashwire #
Outside the 1.0 semver promise. It carries the engine's number to say which engine it goes with, and a release of a package its signatures name may break it in a minor, labelled in its CHANGELOG (SUPPORT.md says which).
A dashwire connection as a
flame_multiplayer wire.
import 'package:dashwire/dashwire.dart';
import 'package:flame_multiplayer/flame_multiplayer.dart';
import 'package:flame_multiplayer_dashwire/flame_multiplayer_dashwire.dart';
final wire = DashwireWire(await connectWebSocket(roomUri));
final room = PeerRoom(wire, slot: 0);
A reliable message goes on dashwire's reliable channel and an unreliable one on its unreliable channel, so a rollback frame or a ghost's position is not held up behind a lost packet on a transport that has both. Messages travel as JSON in UTF-8.
dashwire's own LoopbackConnection and SimulatorConnection work too, and
the simulator — latency, jitter, loss and duplication — is a harder test than
flame_multiplayer's loopback: this package's tests run a rollback, a
handshake and a turn through it.
dashwire's WebSocket sends binary frames, and flutter3d_net's relay passes
them on as they are, so two games connected through dashwire meet in a room
of that relay. One test starts the relay and checks exactly that.
A package of its own so that flame_multiplayer keeps no dependencies, and
a game that talks through flutter3d_net does not carry dashwire as well.