gameServer2/src/protocol/messages.rs
author unc0rr
Thu, 05 Jan 2017 19:07:01 +0300
changeset 12130 6273f89ab13d
child 12131 a4d22f197bd2
permissions -rw-r--r--
Start on messages parser

use server::coretypes::{ServerVar, GameCfg, TeamInfo, HedgehogInfo};


pub enum HWProtocolMessage<'a> {
    // core
    Ping,
    Pong,
    Quit(Option<&'a str>),
    //Cmd(&'a str, Vec<&'a str>),
    Global(&'a str),
    Watch(&'a str),
    ToggleServerRegisteredOnly,
    SuperPower,
    Info(&'a str),
    // not entered state
    Nick(&'a str),
    Proto(u32),
    Password(&'a str, &'a str),
    Checker(&'a str),
    // lobby
    List,
    Chat(&'a str),
    CreateRoom(&'a str, Option<&'a str>),
    Join(&'a str, Option<&'a str>),
    Follow(&'a str),
    Rnd(Vec<&'a str>),
    Kick(&'a str),
    Ban(&'a str, &'a str, u32),
    BanIP(&'a str, &'a str, u32),
    BanNick(&'a str, &'a str, u32),
    BanList,
    Unban(&'a str),
    SetServerVar(ServerVar),
    GetServerVar,
    RestartServer,
    Stats,
    // in room
    Part(Option<&'a str>),
    Cfg(GameCfg),
    AddTeam(TeamInfo),
    RemoveTeam(&'a str),
    SetHedgehogsNumber(&'a str, u8),
    SetTeamColor(&'a str, u8),
    ToggleReady,
    StartGame,
    EngineMessage,
    RoundFinished,
    ToggleRestrictJoin,
    ToggleRestrictTeams,
    ToggleRegisteredOnly,
    RoomName(&'a str),
    Delegate(&'a str),
    TeamChat(&'a str),
    MaxTeams(u8),
    Fix,
    Unfix,
    Greeting(&'a str),
    CallVote(Option<(&'a str, Option<&'a str>)>),
    Vote(&'a str),
    ForceVote(&'a str),
    Save(&'a str, &'a str),
    Delete(&'a str, &'a str),
    SaveRoom(&'a str),
    LoadRoom(&'a str),
}