DEMO IS READY BITCHES!! FUCK YEAH MOTHERFUCKERS

Signed-off-by: Sienna Meridian Satterwhite <sienna@r3t.io>
This commit is contained in:
2026-01-05 21:15:52 +00:00
parent ffe529852d
commit 5838b2dd6a
4 changed files with 21 additions and 9 deletions

View File

@@ -289,6 +289,9 @@ fn main() {
app.add_plugins(CubePlugin);
app.add_systems(Startup, initialize_offline_resources);
// Configure fixed timestep for deterministic game logic at 60fps
app.insert_resource(Time::<Fixed>::from_hz(60.0));
// Insert control socket path as resource
app.insert_resource(control::ControlSocketPath(args.control_socket.clone()));
app.add_systems(Startup, control::start_control_socket_system);

View File

@@ -185,10 +185,12 @@ impl NetworkingManager {
// Spawn background task to maintain DHT presence
let session_id_clone = session_id.clone();
let cancel_token_clone = cancel_token.clone();
tokio::spawn(crate::engine::peer_discovery::maintain_dht_presence(
session_id_clone,
endpoint_id,
pkarr_client,
cancel_token_clone,
));
let manager = Self {

View File

@@ -138,14 +138,21 @@ pub async fn maintain_dht_presence(
session_id: SessionId,
our_endpoint_id: EndpointId,
dht_client: pkarr::Client,
cancel_token: tokio_util::sync::CancellationToken,
) {
let mut interval = tokio::time::interval(Duration::from_secs(30 * 60)); // 30 minutes
loop {
interval.tick().await;
tokio::select! {
_ = cancel_token.cancelled() => {
tracing::info!("DHT maintenance task shutting down");
break;
}
_ = interval.tick() => {
if let Err(e) = publish_peer_to_dht(&session_id, our_endpoint_id, &dht_client).await {
tracing::warn!("Failed to republish to DHT: {}", e);
}
}
}
}
}

View File

@@ -417,9 +417,9 @@ impl Plugin for NetworkingPlugin {
.chain(),
);
// Update systems - handle local operations
// FixedUpdate systems - game logic at locked 60fps
app.add_systems(
Update,
FixedUpdate,
(
// Track Transform changes and mark NetworkedTransform as changed
auto_detect_transform_changes_system,
@@ -438,14 +438,14 @@ impl Plugin for NetworkingPlugin {
// Trigger anti-entropy sync when going online (separate from chain to allow conditional execution)
app.add_systems(
PostUpdate,
FixedPostUpdate,
trigger_sync_on_connect
.run_if(bevy::ecs::schedule::common_conditions::resource_exists::<GossipBridge>),
);
// PostUpdate systems - generate and send deltas
// FixedPostUpdate systems - generate and send deltas at locked 60fps
app.add_systems(
PostUpdate,
FixedPostUpdate,
(
// Generate deltas for changed entities, then cleanup markers
// CRITICAL: cleanup_skip_delta_markers_system must run immediately after