gameServer2/src/server/room.rs
author Wuzzy <Wuzzy2@mail.ru>
Thu, 26 Jul 2018 14:18:23 +0200
branch0.9.24
changeset 13557 ea05d4b0b6b0
parent 13119 1e39b8749072
child 13416 cdf69667593b
permissions -rw-r--r--
Prevent saving weapon scheme if name was already taken This is case-insensitive.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13119
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
     1
pub type RoomId = usize;
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
     2
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
     3
pub struct HWRoom {
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
     4
    pub id: RoomId,
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
     5
    pub name: String,
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
     6
    pub password: Option<String>,
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
     7
    pub protocol_number: u32,
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
     8
    pub ready_players_number: u8,
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
     9
}
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    10
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    11
impl HWRoom {
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    12
    pub fn new(id: RoomId) -> HWRoom {
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    13
        HWRoom {
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    14
            id,
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    15
            name: String::new(),
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    16
            password: None,
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    17
            protocol_number: 0,
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    18
            ready_players_number: 0,
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    19
        }
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    20
    }
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    21
}