gameServer2/src/server/room.rs
author Wuzzy <Wuzzy2@mail.ru>
Tue, 24 Apr 2018 21:49:12 +0200
changeset 13349 4f9108f82879
parent 13124 1e39b8749072
child 13421 cdf69667593b
permissions -rw-r--r--
Pas2C: Add support for char + ansistring (for real this time)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13124
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
}