gameServer2/src/protocol/messages.rs
author unc0rr
Thu, 05 Jan 2017 19:07:01 +0300
changeset 12135 6273f89ab13d
child 12136 a4d22f197bd2
permissions -rw-r--r--
Start on messages parser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12135
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
     1
use server::coretypes::{ServerVar, GameCfg, TeamInfo, HedgehogInfo};
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
     2
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
     3
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
     4
pub enum HWProtocolMessage<'a> {
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
     5
    // core
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
     6
    Ping,
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
     7
    Pong,
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
     8
    Quit(Option<&'a str>),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
     9
    //Cmd(&'a str, Vec<&'a str>),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    10
    Global(&'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    11
    Watch(&'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    12
    ToggleServerRegisteredOnly,
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    13
    SuperPower,
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    14
    Info(&'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    15
    // not entered state
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    16
    Nick(&'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    17
    Proto(u32),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    18
    Password(&'a str, &'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    19
    Checker(&'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    20
    // lobby
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    21
    List,
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    22
    Chat(&'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    23
    CreateRoom(&'a str, Option<&'a str>),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    24
    Join(&'a str, Option<&'a str>),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    25
    Follow(&'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    26
    Rnd(Vec<&'a str>),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    27
    Kick(&'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    28
    Ban(&'a str, &'a str, u32),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    29
    BanIP(&'a str, &'a str, u32),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    30
    BanNick(&'a str, &'a str, u32),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    31
    BanList,
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    32
    Unban(&'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    33
    SetServerVar(ServerVar),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    34
    GetServerVar,
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    35
    RestartServer,
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    36
    Stats,
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    37
    // in room
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    38
    Part(Option<&'a str>),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    39
    Cfg(GameCfg),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    40
    AddTeam(TeamInfo),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    41
    RemoveTeam(&'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    42
    SetHedgehogsNumber(&'a str, u8),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    43
    SetTeamColor(&'a str, u8),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    44
    ToggleReady,
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    45
    StartGame,
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    46
    EngineMessage,
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    47
    RoundFinished,
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    48
    ToggleRestrictJoin,
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    49
    ToggleRestrictTeams,
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    50
    ToggleRegisteredOnly,
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    51
    RoomName(&'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    52
    Delegate(&'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    53
    TeamChat(&'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    54
    MaxTeams(u8),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    55
    Fix,
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    56
    Unfix,
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    57
    Greeting(&'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    58
    CallVote(Option<(&'a str, Option<&'a str>)>),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    59
    Vote(&'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    60
    ForceVote(&'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    61
    Save(&'a str, &'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    62
    Delete(&'a str, &'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    63
    SaveRoom(&'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    64
    LoadRoom(&'a str),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    65
}