|
|
@ -224,7 +224,7 @@ async fn state_client_loop<STATE, S, R, E>(state: Arc<Mutex<STATE>>, |
|
|
|
match action {
|
|
|
|
ClientAction::NewClient(client_id, sender) => {
|
|
|
|
clients.insert(client_id, sender.clone());
|
|
|
|
for action in state.on_connect(client_id) {
|
|
|
|
for action in state.on_connect(client_id).await {
|
|
|
|
match action {
|
|
|
|
OnConnect::Cipher((inc, outc)) => {
|
|
|
|
sender.send(ServerStateAction::Cipher(inc, outc)).await;
|
|
|
@ -251,7 +251,7 @@ async fn state_client_loop<STATE, S, R, E>(state: Arc<Mutex<STATE>>, |
|
|
|
}
|
|
|
|
},
|
|
|
|
ClientAction::Disconnect(client_id) => {
|
|
|
|
let pkts = state.on_disconnect(client_id);
|
|
|
|
let pkts = state.on_disconnect(client_id).await;
|
|
|
|
for (client_id, pkt) in pkts {
|
|
|
|
if let Some(client) = clients.get_mut(&client_id) {
|
|
|
|
client.send(ServerStateAction::Packet(pkt)).await;
|
|
|
|