Skip to content

Commit ce9d0ff

Browse files
committed
fix: fixup warnings
1 parent 5d74298 commit ce9d0ff

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

src/yourcontrols/src/definitions.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use indexmap::IndexMap;
2-
use log::info;
32
use serde::Deserialize;
43
use serde_yaml::{self, Value};
54
use simconnect::SimConnector;

src/yourcontrols/src/program/network.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,14 @@ impl NetworkHandler {
204204
ctx.sim.definitions.reset_sync();
205205
if to == client.get_server_name() {
206206
info!("[CONTROL] Taking control from {}", from);
207-
ctx.sim.definitions.on_control_change(&ctx.sim.conn, true);
207+
ctx.sim.take_control();
208208
ctx.app.gain_control();
209209
state.clients.set_no_control();
210210
// Someone else has controls, if we have controls we let go and listen for their messages
211211
} else {
212212
if from == client.get_server_name() {
213213
ctx.app.lose_control();
214-
ctx.sim.definitions.on_control_change(&ctx.sim.conn, false);
214+
ctx.sim.lose_control();
215215
}
216216
info!("[CONTROL] {} is now in control.", to);
217217
ctx.app.set_incontrol(&to);
@@ -275,8 +275,7 @@ impl NetworkHandler {
275275
if client.is_host() {
276276
info!("[CONTROL] {} had control, taking control back.", name);
277277
ctx.app.gain_control();
278-
279-
ctx.sim.definitions.on_control_change(&ctx.sim.conn, true);
278+
ctx.sim.take_control();
280279
client.transfer_control(client.get_server_name().to_string());
281280
}
282281
}
@@ -331,7 +330,7 @@ impl NetworkHandler {
331330
)
332331
}
333332
// Freeze aircraft
334-
ctx.sim.definitions.on_control_change(&ctx.sim.conn, false);
333+
ctx.sim.lose_control();
335334
}
336335
Err(e) => {
337336
error!(

src/yourcontrols/src/program/sync.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl SyncHandler {
8484
ProgramAction::TakeControls => {
8585
if !sim.has_control() && !network.observing {
8686
if let Some(in_control) = network.clients.get_client_in_control() {
87-
sim.definitions.on_control_change(&sim.conn, true);
87+
sim.take_control();
8888
client.take_control(in_control.clone());
8989
}
9090
}
@@ -95,7 +95,7 @@ impl SyncHandler {
9595
client.transfer_control(next_control.clone())
9696
}
9797
} else if let Some(in_control) = network.clients.get_client_in_control() {
98-
sim.definitions.on_control_change(&sim.conn, false);
98+
sim.lose_control();
9999
client.take_control(in_control.clone());
100100
}
101101
}

0 commit comments

Comments
 (0)