rust/hedgewars-server/src/protocol/messages.rs
changeset 14697 f64e21f164a5
parent 14457 98ef2913ec73
child 14779 f43ab2bd76ae
equal deleted inserted replaced
14696:8a45c90f4580 14697:f64e21f164a5
     1 use crate::server::coretypes::{GameCfg, HedgehogInfo, ServerVar, TeamInfo, VoteType};
     1 use crate::server::coretypes::{GameCfg, HedgehogInfo, ServerVar, TeamInfo, VoteType};
     2 use std::{convert::From, iter::once, ops};
     2 use std::{convert::From, iter::once, ops};
     3 
     3 
     4 #[derive(PartialEq, Eq, Clone, Debug)]
     4 #[derive(PartialEq, Eq, Clone, Debug)]
     5 pub enum HWProtocolMessage {
     5 pub enum HWProtocolMessage {
     6     // core
     6     // common messages
     7     Ping,
     7     Ping,
     8     Pong,
     8     Pong,
     9     Quit(Option<String>),
     9     Quit(Option<String>),
    10     //Cmd(String, Vec<String>),
       
    11     Global(String),
    10     Global(String),
    12     Watch(String),
    11     Watch(String),
    13     ToggleServerRegisteredOnly,
    12     ToggleServerRegisteredOnly,
    14     SuperPower,
    13     SuperPower,
    15     Info(String),
    14     Info(String),
    16     // not entered state
    15     // anteroom messages
    17     Nick(String),
    16     Nick(String),
    18     Proto(u16),
    17     Proto(u16),
    19     Password(String, String),
    18     Password(String, String),
    20     Checker(u16, String, String),
    19     Checker(u16, String, String),
    21     // lobby
    20     // lobby messages
    22     List,
    21     List,
    23     Chat(String),
    22     Chat(String),
    24     CreateRoom(String, Option<String>),
    23     CreateRoom(String, Option<String>),
    25     JoinRoom(String, Option<String>),
    24     JoinRoom(String, Option<String>),
    26     Follow(String),
    25     Follow(String),
    33     Unban(String),
    32     Unban(String),
    34     SetServerVar(ServerVar),
    33     SetServerVar(ServerVar),
    35     GetServerVar,
    34     GetServerVar,
    36     RestartServer,
    35     RestartServer,
    37     Stats,
    36     Stats,
    38     // in room
    37     // room messages
    39     Part(Option<String>),
    38     Part(Option<String>),
    40     Cfg(GameCfg),
    39     Cfg(GameCfg),
    41     AddTeam(Box<TeamInfo>),
    40     AddTeam(Box<TeamInfo>),
    42     RemoveTeam(String),
    41     RemoveTeam(String),
    43     SetHedgehogsNumber(String, u8),
    42     SetHedgehogsNumber(String, u8),