Rework avatars.

Now we have a concept of an avatar at the server, realm, and scene level
and we have the groundwork for a realm store. New uesrs no longer props,
they get a default avatar. New system supports gender
{male,female,neutral} and {child,adult}.
This commit is contained in:
Evan Carroll 2026-01-22 21:04:27 -06:00
parent e4abdb183f
commit 6fb90e42c3
55 changed files with 7392 additions and 512 deletions

View file

@ -5,7 +5,7 @@
use serde::{Deserialize, Serialize};
use uuid::Uuid;
use crate::models::{AvatarRenderData, ChannelMemberInfo, ChannelMemberWithAvatar, LooseProp};
use crate::models::{AvatarRenderData, ChannelMemberInfo, ChannelMemberWithAvatar, ForcedAvatarReason, LooseProp};
/// Default function for serde that returns true (for is_same_scene field).
/// Must be pub for serde derive macro to access via full path.
@ -274,4 +274,26 @@ pub enum ServerMessage {
/// Whether the member is still a guest.
is_guest: bool,
},
/// A user's avatar was forcibly changed (by moderator or scene entry).
AvatarForced {
/// User ID whose avatar was forced.
user_id: Uuid,
/// The forced avatar render data.
avatar: AvatarRenderData,
/// Why the avatar was forced.
reason: ForcedAvatarReason,
/// Display name of who forced the avatar (if mod command).
forced_by: Option<String>,
},
/// A user's forced avatar was cleared (returned to their chosen avatar).
AvatarCleared {
/// User ID whose forced avatar was cleared.
user_id: Uuid,
/// The user's original avatar render data (restored).
avatar: AvatarRenderData,
/// Display name of who cleared the forced avatar (if mod command).
cleared_by: Option<String>,
},
}