diff -r 42776184fc39 -r e335b3120f59 gameServer2/src/server/core.rs --- a/gameServer2/src/server/core.rs Sun Dec 09 00:53:05 2018 +0100 +++ b/gameServer2/src/server/core.rs Sun Dec 09 04:09:38 2018 +0300 @@ -1,6 +1,7 @@ use slab; use crate::utils; use super::{ + io::HWServerIO, client::HWClient, room::HWRoom, actions, handlers, coretypes::{ClientId, RoomId}, actions::{Destination, PendingMessage} @@ -12,24 +13,25 @@ type Slab = slab::Slab; - pub struct HWServer { pub clients: Slab, pub rooms: Slab, pub lobby_id: RoomId, pub output: Vec<(Vec, HWServerMessage)>, pub removed_clients: Vec, + pub io: Box } impl HWServer { - pub fn new(clients_limit: usize, rooms_limit: usize) -> HWServer { + pub fn new(clients_limit: usize, rooms_limit: usize, io: Box) -> HWServer { let rooms = Slab::with_capacity(rooms_limit); let clients = Slab::with_capacity(clients_limit); let mut server = HWServer { clients, rooms, lobby_id: 0, output: vec![], - removed_clients: vec![] + removed_clients: vec![], + io }; server.lobby_id = server.add_room(); server