register server info system

This commit is contained in:
crabman 2024-05-09 14:19:43 +00:00
parent 23003b48df
commit e8a89b52bc
No known key found for this signature in database
2 changed files with 2 additions and 0 deletions

View File

@ -45,6 +45,7 @@ pub fn add_server_systems(dispatch_builder: &mut DispatcherBuilder) {
// don't depend on chunk_serialize, as we assume everything is done in a SlowJow
dispatch::<chunk_send::Sys>(dispatch_builder, &[]);
dispatch::<item::Sys>(dispatch_builder, &[]);
dispatch::<server_info::Sys>(dispatch_builder, &[]);
}
pub fn run_sync_systems(ecs: &mut specs::World) {

View File

@ -34,6 +34,7 @@ impl<'a> System<'a> for Sys {
if let Some(sender) = sender.as_ref()
&& tick.0 % INFO_SEND_INTERVAL == 0
{
tracing::trace!("Updating server info");
let count = players.count().try_into().unwrap_or(u16::MAX);
if let Err(error) = sender.send(ServerInfo {
git_hash: *GIT_HASH,