diff options
| author | Fuwn <[email protected]> | 2021-07-04 04:09:12 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-07-04 04:09:12 +0000 |
| commit | ec90ee716bed862b38cc4660adf46fcbc4b4b867 (patch) | |
| tree | 77e19d343800fa883440a819f28c0c99c087c9db | |
| parent | feat(whirl_server): create REGOBJID and APPRACTR commands (diff) | |
| download | whirl-ec90ee716bed862b38cc4660adf46fcbc4b4b867.tar.xz whirl-ec90ee716bed862b38cc4660adf46fcbc4b4b867.zip | |
feat(whirl_server): implement a demo of the REGOBJID and APPRACTR commands
The following demo creates an actor named "fuwn" upon login at GroundZero.
| -rw-r--r-- | crates/whirl_server/src/hub.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/whirl_server/src/hub.rs b/crates/whirl_server/src/hub.rs index c695f93..848862d 100644 --- a/crates/whirl_server/src/hub.rs +++ b/crates/whirl_server/src/hub.rs @@ -20,8 +20,10 @@ use crate::{ cmd::{ commands::{ action::create, + appear_actor::AppearActor, buddy_list::BuddyList, property::create::{property_request_as_hub, property_update_as_hub}, + register_object_id::RegisterObjectId, session_exit::SessionExit, subscribe_distance::SubscribeDistance, subscribe_room::SubscribeRoom, @@ -209,6 +211,19 @@ impl Server for Hub { let subscribe_room = SubscribeRoom::parse(msg[3..].to_vec()); debug!("received subscribe room from {}: {:?}", username, subscribe_room); + + peer.bytes.get_mut().write_all(&RegisterObjectId { + long_object_id: "fuwn".to_string(), + short_object_id: 2, + }.create()).await?; + peer.bytes.get_mut().write_all(&AppearActor { + short_object_id: 2, + room_id: 1, + x: 191, + y: 173, + z: 0, + direction: 45, + }.create()).await?; } Some(Command::SubDist) => { let subscribe_distance = SubscribeDistance::parse(msg[3..].to_vec()); |