diff options
| author | Fuwn <[email protected]> | 2021-07-04 04:09:12 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-07-04 04:09:12 -0700 |
| commit | 45395710cea28da4538afea785bedd2b6fad2395 (patch) | |
| tree | 7a088c6047b11146d2306a519833479ad309ca42 | |
| parent | feat(whirl_server): create REGOBJID and APPRACTR commands (diff) | |
| download | whirl-45395710cea28da4538afea785bedd2b6fad2395.tar.xz whirl-45395710cea28da4538afea785bedd2b6fad2395.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()); |