~starkingdoms/starkingdoms

ref: 8dd63f01e9d8b239be1e3fb5f5c52d39b012371a starkingdoms/crates/client/src/networking/websocket.rs -rw-r--r-- 307 bytes
8dd63f01 — ghostly_zsh planets appear on the client again, also new SpawnPlanet packet 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
use starkingdoms_common::packet::{MsgFromError, Packet};

pub trait Websocket {
    fn new() -> Self;
    fn send_packet(&mut self, packet: Packet);
}

pub trait PacketMessageConvert {
    type M;

    fn from_message(value: &Self::M) -> Result<Packet, MsgFromError>;
    fn as_message(&self) -> Self::M;
}