Skip to content

Commit bfad066

Browse files
committed
please frkn work
1 parent cc4ec33 commit bfad066

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

src/bin/src/game_loop.rs

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ use crate::systems::shutdown_systems::register_shutdown_systems;
77
use bevy_ecs::prelude::World;
88
use bevy_ecs::schedule::ExecutorKind;
99
use crossbeam_channel::Sender;
10-
use ferrumc_config::statics::get_global_config;
11-
use ferrumc_config::whitelist::flush_whitelist_to_disk;
10+
use ferrumc_config::server_config::get_global_config;
1211
use ferrumc_net::connection::{handle_connection, NewConnection};
1312
use ferrumc_net::server::create_server_listener;
1413
use ferrumc_net::PacketSender;
@@ -65,10 +64,7 @@ pub fn start_game_loop(global_state: GlobalState) -> Result<(), BinaryError> {
6564
format_duration(global_state.start_time.elapsed())
6665
);
6766

68-
let flush_interval_ticks = 5 * 60 * get_global_config().tps as u64; // 5 minutes, This really
69-
// should not be based on
70-
// tps
71-
let mut flush_tick_counter: u64 = 0;
67+
7268

7369
while !global_state
7470
.shut_down
@@ -78,15 +74,6 @@ pub fn start_game_loop(global_state: GlobalState) -> Result<(), BinaryError> {
7874
// Run the ECS schedule
7975
schedule.run(&mut ecs_world);
8076

81-
flush_tick_counter += 1;
82-
if flush_tick_counter >= flush_interval_ticks {
83-
info!("Periodically flushing whitelist to disk...");
84-
if let Err(e) = flush_whitelist_to_disk() {
85-
error!("Failed to flush whitelist to disk: {}", e);
86-
}
87-
flush_tick_counter = 0;
88-
}
89-
9077
// Sleep to maintain the tick rate
9178
let elapsed_time = tick_start.elapsed();
9279
let sleep_duration = time_per_tick.saturating_sub(elapsed_time);
@@ -105,10 +92,7 @@ pub fn start_game_loop(global_state: GlobalState) -> Result<(), BinaryError> {
10592
);
10693
}
10794
}
108-
info!("Server shutting down, flushing whitelist to disk...");
109-
if let Err(e) = flush_whitelist_to_disk() {
110-
error!("Failed to perform final whitelist flush: {}", e);
111-
}
95+
11296
shutdown_schedule.run(&mut ecs_world);
11397

11498
// tell the TCP connection acceptor to shut down

0 commit comments

Comments
 (0)