From 1dfcf5efd599f41a169be5c252a3433dd7a67e63 Mon Sep 17 00:00:00 2001 From: core Date: Fri, 12 Jun 2026 18:17:21 -0400 Subject: [PATCH] netcode,thrust: replicate thrusters again --- crates/unified/src/shared/attachment.rs | 5 ++++- crates/unified/src/shared/ecs/thruster.rs | 2 ++ crates/xtask/src/unified.rs | 8 ++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/crates/unified/src/shared/attachment.rs b/crates/unified/src/shared/attachment.rs index dd08e965c0244780c35eeadf7f7db75072ef215a..898e04756e423497a5a23232cbba2a58a393edb1 100644 --- a/crates/unified/src/shared/attachment.rs +++ b/crates/unified/src/shared/attachment.rs @@ -18,8 +18,10 @@ use bevy::ecs::entity::MapEntities; use crate::prelude::*; use serde::{Deserialize, Serialize}; use std::ops::Deref; +use bevy_replicon::shared::replication::Replicated; #[derive(Component, Serialize, Deserialize)] +#[require(Replicated)] /// The primary component for a ship structure. Will be present on Hearty pub struct Ship; @@ -37,7 +39,7 @@ pub struct Parts(#[entities] Vec); pub struct PartInShip(#[entities] pub Entity); #[derive(Component, Serialize, Deserialize)] -#[require(Transform)] +#[require(Transform, Replicated)] /// A `Joint` is a separate entity (child of a part) that represents a single possible attachment /// point for that part. pub struct Joint { @@ -71,6 +73,7 @@ impl Deref for Joints { } #[derive(Component, Serialize, Deserialize, MapEntities)] +#[require(Replicated)] #[relationship(relationship_target = Snaps)] /// The `Part` that this Snap belongs to. A Snap is an internal entity used for snapping during /// the attachment routine. Managed automatically. diff --git a/crates/unified/src/shared/ecs/thruster.rs b/crates/unified/src/shared/ecs/thruster.rs index 7a98e6e8f68ccd8df3373dd28b674dbfe7fbfaf5..714dbe1b423bc28e790e983794f70327f65910fb 100644 --- a/crates/unified/src/shared/ecs/thruster.rs +++ b/crates/unified/src/shared/ecs/thruster.rs @@ -4,6 +4,7 @@ use bevy::math::Vec2; use bevy::prelude::Bundle; use serde::{Deserialize, Serialize}; use crate::prelude::{ChildOf, Component, Entity, Transform}; +use bevy_replicon::shared::replication::Replicated; #[derive(Serialize, Deserialize, PartialEq, Eq, Clone)] pub struct ThrusterId(pub String); @@ -30,6 +31,7 @@ impl Deref for PartThrusters { pub struct ThrusterOfPart(#[entities] pub Entity); #[derive(Component, Serialize, Deserialize)] +#[require(Replicated)] pub struct Thruster { pub id: ThrusterId, pub thrust_vector: Vec2, diff --git a/crates/xtask/src/unified.rs b/crates/xtask/src/unified.rs index e06c11655d334b8dc842b6e1d896d21c0823efc0..3d0ef2a9a975c3bac6cf307a26d48a962e8f9b17 100644 --- a/crates/xtask/src/unified.rs +++ b/crates/xtask/src/unified.rs @@ -14,12 +14,12 @@ impl Task for RunServerNative { fn run(&self, args: Vec) { let args = if args.is_empty() { - "-b [::]:5151 -r 60 -c 10".to_string() + "--management-bind [::]:5151 --native-bind [::]:5152 --wt-bind [::]:5153".to_string() } else { args.join(" ") }; set_current_dir(workspace_dir().join("crates/unified/")).unwrap(); - cargo(format!("run -F native -F native_dev -F server --package starkingdoms -- server {args}")); + cargo(format!("run -F native_dev --package starkingdoms -- server {args}")); } } @@ -56,11 +56,11 @@ impl Task for RunClientNative { fn run(&self, args: Vec) { let args = if args.is_empty() { - "-s [::]:5151".to_string() + "-s http://127.0.0.1:5151".to_string() } else { args.join(" ") }; set_current_dir(workspace_dir().join("crates/unified/")).unwrap(); - cargo(format!("run -F native -F native_dev -F client --package starkingdoms -- client {args}")); + cargo(format!("run -F native_dev --package starkingdoms -- client {args}")); } } \ No newline at end of file