Improve messages formatting
This commit is contained in:
parent
481f36752d
commit
36a573e563
@ -1,7 +1,7 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use actix::prelude::*;
|
|
||||||
use actix::{Actor, Handler, StreamHandler};
|
use actix::{Actor, Handler, StreamHandler};
|
||||||
|
use actix::prelude::*;
|
||||||
use actix_web_actors::ws;
|
use actix_web_actors::ws;
|
||||||
use actix_web_actors::ws::{CloseCode, CloseReason, Message, ProtocolError, WebsocketContext};
|
use actix_web_actors::ws::{CloseCode, CloseReason, Message, ProtocolError, WebsocketContext};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
@ -20,6 +20,7 @@ pub enum StartMode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(serde::Deserialize, Debug)]
|
#[derive(serde::Deserialize, Debug)]
|
||||||
|
#[serde(tag = "type")]
|
||||||
pub enum ClientMessage {
|
pub enum ClientMessage {
|
||||||
StopGame,
|
StopGame,
|
||||||
}
|
}
|
||||||
@ -27,6 +28,7 @@ pub enum ClientMessage {
|
|||||||
#[derive(Message)]
|
#[derive(Message)]
|
||||||
#[rtype(result = "()")]
|
#[rtype(result = "()")]
|
||||||
#[derive(serde::Serialize, Debug)]
|
#[derive(serde::Serialize, Debug)]
|
||||||
|
#[serde(tag = "type")]
|
||||||
pub enum ServerMessage {
|
pub enum ServerMessage {
|
||||||
WaitingForOtherPlayer,
|
WaitingForOtherPlayer,
|
||||||
QueryBoatsLayout(GameRules),
|
QueryBoatsLayout(GameRules),
|
||||||
|
Loading…
Reference in New Issue
Block a user