gameServer2/src/protocol/test.rs
changeset 13801 5fb40c8e5542
parent 13798 4664da990556
child 13805 0463a4221327
equal deleted inserted replaced
13800:0118b7412570 13801:5fb40c8e5542
    19     }
    19     }
    20 }
    20 }
    21 impl Into2<String> for Ascii { fn into2(self) -> String { self.0 } }
    21 impl Into2<String> for Ascii { fn into2(self) -> String { self.0 } }
    22 impl Into2<Option<String>> for Option<Ascii>{
    22 impl Into2<Option<String>> for Option<Ascii>{
    23     fn into2(self) -> Option<String> { self.map(|x| {x.0}) }
    23     fn into2(self) -> Option<String> { self.map(|x| {x.0}) }
    24 }
       
    25 impl Into2<Option<Vec<String>>> for Option<Vec<Ascii>>{
       
    26     fn into2(self) -> Option<Vec<String>> { self.map(|x| {x.into2()}) }
       
    27 }
    24 }
    28 
    25 
    29 macro_rules! proto_msg_case {
    26 macro_rules! proto_msg_case {
    30     ($val: ident()) =>
    27     ($val: ident()) =>
    31         (Just($val));
    28         (Just($val));
    72             2 => MapGenerator(u32),
    69             2 => MapGenerator(u32),
    73             3 => MazeSize(u32),
    70             3 => MazeSize(u32),
    74             4 => Seed(Ascii),
    71             4 => Seed(Ascii),
    75             5 => Template(u32),
    72             5 => Template(u32),
    76             6 => Ammo(Ascii, Option<Ascii>),
    73             6 => Ammo(Ascii, Option<Ascii>),
    77             7 => Scheme(Ascii, Option<Vec<Ascii>>),
    74             7 => Scheme(Ascii, Vec<Ascii>),
    78             8 => Script(Ascii),
    75             8 => Script(Ascii),
    79             9 => Theme(Ascii),
    76             9 => Theme(Ascii),
    80             10 => DrawnMap(Ascii))
    77             10 => DrawnMap(Ascii))
    81         }).boxed()
    78         }).boxed()
    82     }
    79     }