diff options
| author | Fuwn <[email protected]> | 2021-03-22 13:34:57 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-03-22 13:34:57 -0700 |
| commit | 8d6af9cf8a669009d6657dc19e3d4282d8fb5565 (patch) | |
| tree | 7ebcc9a67b096240d99a874c972df5afa5692efb /src | |
| parent | chore: Exclude database development files (diff) | |
| download | whirl-8d6af9cf8a669009d6657dc19e3d4282d8fb5565.tar.xz whirl-8d6af9cf8a669009d6657dc19e3d4282d8fb5565.zip | |
fix: Only send to one client not all for certain commands
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/world.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/server/world.rs b/src/server/world.rs index 4764b36..d0a47f7 100644 --- a/src/server/world.rs +++ b/src/server/world.rs @@ -1,5 +1,5 @@ use mio::net::{TcpListener, TcpStream}; -use std::io::Read; +use std::io::{Read, Write}; use mio::{Poll, Token, Ready, PollOpt, Events}; use std::collections::HashMap; use std::str::from_utf8; @@ -83,13 +83,15 @@ impl WorldServer { // PROPREQ 10 => { info!("received property request command"); - broadcast_to_all_clients(&sockets, &create_property_update_command()); + sockets.get_mut(&token).unwrap() + .write_all(&create_property_update_command()).unwrap(); info!("sent property update"); } // SESSINIT 6 => { info!("received session initialization command"); - broadcast_to_all_clients(&sockets, &create_property_request_command()); + sockets.get_mut(&token).unwrap() + .write_all(&create_property_request_command()).unwrap(); info!("sent session initialization command") } // PROPSET @@ -97,11 +99,9 @@ impl WorldServer { // BUDDYLISTUPDATE 29 => { info!("received buddy list update command"); - - broadcast_to_all_clients( - &sockets, - &create_buddy_list_notify_command("Wirlaburla") - ); + sockets.get_mut(&token).unwrap() + .write_all(&create_buddy_list_notify_command("Wirlaburla")) + .unwrap(); info!("sent buddy notify update command") } // ROOMIDRQ |