--- a/rust/hedgewars-server/src/core/server.rs Thu Sep 29 16:29:23 2022 +0200
+++ b/rust/hedgewars-server/src/core/server.rs Thu Sep 29 16:30:02 2022 +0200
@@ -3,11 +3,13 @@
client::HwClient,
indexslab::IndexSlab,
room::HwRoom,
- types::{ClientId, RoomId, Voting},
+ types::{CheckerId, ClientId, RoomId, Voting},
};
use crate::utils;
use hedgewars_network_protocol::types::{GameCfg, ServerVar, TeamInfo, Vote, VoteType};
+use crate::server::replaystorage::ReplayStorage;
+
use bitflags::*;
use log::*;
use slab::Slab;
@@ -157,7 +159,7 @@
}
}
-struct HwChecker {
+pub struct HwChecker {
pub id: ClientId,
pub is_ready: bool,
}
@@ -169,6 +171,10 @@
is_ready: false,
}
}
+
+ pub fn set_is_ready(&mut self, ready: bool) {
+ self.is_ready = ready
+ }
}
pub struct HwServer {
@@ -178,6 +184,7 @@
latest_protocol: u16,
flags: ServerFlags,
greetings: ServerGreetings,
+ replay_storage: Option<ReplayStorage>,
}
impl HwServer {
@@ -192,6 +199,7 @@
greetings: ServerGreetings::new(),
latest_protocol: 58,
flags: ServerFlags::empty(),
+ replay_storage: None,
}
}
@@ -201,6 +209,11 @@
}
#[inline]
+ pub fn get_checker_mut(&mut self, checker_id: CheckerId) -> Option<&mut HwChecker> {
+ self.checkers.get_mut(checker_id)
+ }
+
+ #[inline]
pub fn has_client(&self, client_id: ClientId) -> bool {
self.clients.contains(client_id)
}