@@ -7,8 +7,7 @@ use crate::systems::shutdown_systems::register_shutdown_systems;
7
7
use bevy_ecs:: prelude:: World ;
8
8
use bevy_ecs:: schedule:: ExecutorKind ;
9
9
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;
12
11
use ferrumc_net:: connection:: { handle_connection, NewConnection } ;
13
12
use ferrumc_net:: server:: create_server_listener;
14
13
use ferrumc_net:: PacketSender ;
@@ -65,10 +64,7 @@ pub fn start_game_loop(global_state: GlobalState) -> Result<(), BinaryError> {
65
64
format_duration( global_state. start_time. elapsed( ) )
66
65
) ;
67
66
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
+
72
68
73
69
while !global_state
74
70
. shut_down
@@ -78,15 +74,6 @@ pub fn start_game_loop(global_state: GlobalState) -> Result<(), BinaryError> {
78
74
// Run the ECS schedule
79
75
schedule. run ( & mut ecs_world) ;
80
76
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
-
90
77
// Sleep to maintain the tick rate
91
78
let elapsed_time = tick_start. elapsed ( ) ;
92
79
let sleep_duration = time_per_tick. saturating_sub ( elapsed_time) ;
@@ -105,10 +92,7 @@ pub fn start_game_loop(global_state: GlobalState) -> Result<(), BinaryError> {
105
92
) ;
106
93
}
107
94
}
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
+
112
96
shutdown_schedule. run ( & mut ecs_world) ;
113
97
114
98
// tell the TCP connection acceptor to shut down
0 commit comments