diff options
| author | Fuwn <[email protected]> | 2021-07-01 01:00:39 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-07-01 01:00:39 +0000 |
| commit | 1bde0e36add2407db32987189705a1b5f2c1678a (patch) | |
| tree | da0acd085e775455fb633750ffe45727ee92558b /crates/whirl_server/src/distributor.rs | |
| parent | feat(whirl_server): create the SESSEXIT command (diff) | |
| download | whirl-1bde0e36add2407db32987189705a1b5f2c1678a.tar.xz whirl-1bde0e36add2407db32987189705a1b5f2c1678a.zip | |
feat(whirl_server): implement SESSEXIT command
Diffstat (limited to 'crates/whirl_server/src/distributor.rs')
| -rw-r--r-- | crates/whirl_server/src/distributor.rs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/crates/whirl_server/src/distributor.rs b/crates/whirl_server/src/distributor.rs index 13b13e6..85d6e61 100644 --- a/crates/whirl_server/src/distributor.rs +++ b/crates/whirl_server/src/distributor.rs @@ -27,13 +27,18 @@ use crate::{ property::create::{property_request_as_distributor, property_update_as_distributor}, redirect_id::RedirectId, room_id_request::RoomIdRequest, + session_exit::SessionExit, text::Text, }, constants::Command, extendable::{Creatable, Parsable}, }, interaction::{peer::Peer, shared::Shared}, - net::constants::VAR_USERNAME, + net::{ + constants::{VAR_ERROR, VAR_USERNAME}, + network_property::NetworkProperty, + property_list::PropertyList, + }, packet_parser::parse_commands_from_packet, Server, }; @@ -120,7 +125,17 @@ impl Server for Distributor { trace!("sent redirect id to {}: {}", username, room.room_name); } Some(Command::SessExit) => { - debug!("received session exit from {}", username); break; + debug!("received session exit from {}", username); + + peer.bytes.get_mut().write_all(&SessionExit(PropertyList(vec![ + NetworkProperty { + prop_id: VAR_ERROR, + value: "0".to_string(), + } + ])).create()).await?; + trace!("sent session exit to {}", username); + + break; } _ => {}, } |