diff --git a/rc_core/src/persist/multiplayer.rs b/rc_core/src/persist/multiplayer.rs index 907ab10..ee71339 100644 --- a/rc_core/src/persist/multiplayer.rs +++ b/rc_core/src/persist/multiplayer.rs @@ -39,8 +39,12 @@ impl super::config::SelfValidator for MultiplayerConfig { message: "Game match may be lonely with only one player".to_owned(), }); } - // TODO campaigns - // TODO vehicles + if ((self.players_per_game as f32) / (self.fakes.len() as f32)) > 1.0 { + info.warn(super::config::ValidationMessage { + path: vec!["fakes".to_owned()], + message: "Game match may have broken vehicle flipping functionality due to more than 1 ClientAI per player".to_owned(), + }); + } // TODO is_ok } @@ -134,7 +138,7 @@ pub(super) fn default_fake_users() -> Vec { }, implementation: ClientEmulation::ClientAI, }, - FakePlayerConf { + /*FakePlayerConf { team: None, vehicle: super::garage::PrefabVehicle { name: Some("fake3".to_owned()), @@ -157,7 +161,7 @@ pub(super) fn default_fake_users() -> Vec { }, }, implementation: ClientEmulation::ClientAI, - }, + },*/ ] } diff --git a/rc_multiplayer/src/matches/generic.rs b/rc_multiplayer/src/matches/generic.rs index dfda48b..b6b42d4 100644 --- a/rc_multiplayer/src/matches/generic.rs +++ b/rc_multiplayer/src/matches/generic.rs @@ -1068,8 +1068,9 @@ impl GenericGamemodeEngine { log::error!("Failed to serialize motion data from user {}: {}", user_id, e); } else { let data = bytes::Bytes::copy_from_slice(ser.as_slice()); - for conn in self.users.read().await.values() { - if conn.user.user_id() == user_id { continue; } // fun fact: the game hard crashes if you omit this + for (player_id, conn) in self.users.read().await.iter() { + if *player_id == motion.player_id || conn.aliases.contains(player_id) || conn.aliases.contains(&motion.player_id) { continue; } // don't re-send to client AIs + // fun fact: the game sometimes hard crashes if you send its own motion data back to it crate::events::log_lnl_send_failure(conn.connection.sender.send_data(crate::handler::EventData { message_ty: crate::data::MessageType::RobotMotion, variant: 0,