aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-03-22 13:34:57 +0000
committerFuwn <[email protected]>2021-03-22 13:34:57 +0000
commit02b068257a7c3e06bc5c7e84f70776a98dac5f13 (patch)
tree46c439a5c4a70c086b4461eb3b190b9669bf204c /src/server
parentchore: Exclude database development files (diff)
downloadwhirl-02b068257a7c3e06bc5c7e84f70776a98dac5f13.tar.xz
whirl-02b068257a7c3e06bc5c7e84f70776a98dac5f13.zip
fix: Only send to one client not all for certain commands
Diffstat (limited to 'src/server')
-rw-r--r--src/server/world.rs16
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