equal
deleted
inserted
replaced
|
1 pub type ClientId = usize; |
|
2 pub type RoomId = usize; |
|
3 |
1 #[derive(PartialEq, Eq, Clone, Debug)] |
4 #[derive(PartialEq, Eq, Clone, Debug)] |
2 pub enum ServerVar { |
5 pub enum ServerVar { |
3 MOTDNew(String), |
6 MOTDNew(String), |
4 MOTDOld(String), |
7 MOTDOld(String), |
5 LatestProto(u32), |
8 LatestProto(u32), |
37 #[derive(PartialEq, Eq, Clone, Debug)] |
40 #[derive(PartialEq, Eq, Clone, Debug)] |
38 pub struct HedgehogInfo { |
41 pub struct HedgehogInfo { |
39 pub name: String, |
42 pub name: String, |
40 pub hat: String, |
43 pub hat: String, |
41 } |
44 } |
|
45 |
|
46 #[derive(PartialEq, Eq, Clone, Debug)] |
|
47 pub enum VoteType { |
|
48 Kick(String), |
|
49 Map(Option<String>), |
|
50 Pause, |
|
51 NewSeed, |
|
52 HedgehogsPerTeam(u8) |
|
53 } |
|
54 |
|
55 #[derive(Clone, Debug)] |
|
56 pub struct Voting { |
|
57 pub ttl: u32, |
|
58 pub voters: Vec<ClientId>, |
|
59 pub votes: Vec<(ClientId, bool)>, |
|
60 pub kind: VoteType |
|
61 } |
|
62 |
|
63 impl Voting { |
|
64 pub fn new(kind: VoteType, voters: Vec<ClientId>) -> Voting { |
|
65 Voting { |
|
66 kind, voters, ttl: 2, |
|
67 votes: Vec::new() |
|
68 } |
|
69 } |
|
70 } |