Skip to content

Commit

Permalink
somethign cancleiationtoken something
Browse files Browse the repository at this point in the history
  • Loading branch information
nothendev committed Oct 8, 2023
1 parent f21ec56 commit 674e9f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ fn listen(net: Res<NetNet>, rt: Res<TokioTasksRuntime>) {
.run_on_main_thread(|tcx| *tcx.world.resource::<CompressionThreshold>())
.await;

let player = PlayerNet::new(read, write, cancellator.clone(), compress);
let player = PlayerNet::new(read, write, cancellator.child_token(), compress);
let entity = t
.clone()
.run_on_main_thread(move |cx| {
Expand Down Expand Up @@ -349,6 +349,9 @@ fn on_login(rt: Res<TokioTasksRuntime>, mut ev: EventReader<PlayerLoginEvent>, q
}),
_ => Ok(()),
};

player.cancellator.cancel();

Ok(())
}
}
Expand Down

0 comments on commit 674e9f0

Please sign in to comment.