feat: add global & server leveling, quests, achievements, guilds land-claiming, social & toggleable configs
This commit is contained in:
1 parent
4b79f69c20
commit
b4cef85b1f
40 files changed
+10261
-27
No files matched your search
@@ -409,6 +409,206 @@ pub struct LaunchEvent {
|
||||
pub username: Option<String>,
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Leveling & Quests
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
|
||||
pub struct UserLevelInfo {
|
||||
pub uuid: String,
|
||||
pub global_xp: i64,
|
||||
pub global_level: i64,
|
||||
pub current_level_xp: i64,
|
||||
pub next_level_xp: i64,
|
||||
pub progress_pct: f64,
|
||||
pub title: Option<String>,
|
||||
pub badges: Vec<String>,
|
||||
pub server_levels: Vec<ServerLevelInfo>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
|
||||
pub struct ServerLevelInfo {
|
||||
pub server_id: i64,
|
||||
pub server_name: String,
|
||||
pub server_xp: i64,
|
||||
pub server_level: i64,
|
||||
pub current_level_xp: i64,
|
||||
pub next_level_xp: i64,
|
||||
pub progress_pct: f64,
|
||||
pub rank_name: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
|
||||
pub struct Quest {
|
||||
pub id: String,
|
||||
pub title: String,
|
||||
pub description: String,
|
||||
pub period: String, // "daily", "weekly"
|
||||
pub category: String, // "mining", "combat", "building", "farming", "social", "exploration"
|
||||
pub target_stat: String,
|
||||
pub target_count: i64,
|
||||
pub xp_reward: i64,
|
||||
pub icon: String,
|
||||
pub enabled: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
|
||||
pub struct UserQuest {
|
||||
#[serde(flatten)]
|
||||
pub quest: Quest,
|
||||
pub progress: i64,
|
||||
pub completed: bool,
|
||||
pub claimed: bool,
|
||||
pub period_key: String,
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Achievements
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
|
||||
pub struct Achievement {
|
||||
pub id: String,
|
||||
pub title: String,
|
||||
pub description: String,
|
||||
pub category: String,
|
||||
pub icon_frame: String, // "task", "goal", "challenge"
|
||||
pub icon_item: String,
|
||||
pub icon_bg: String,
|
||||
pub icon_border: String,
|
||||
pub xp_reward: i64,
|
||||
pub secret: bool,
|
||||
#[serde(default)]
|
||||
pub unlocked: bool,
|
||||
#[serde(default)]
|
||||
pub unlocked_at: Option<String>,
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Guilds & Land Claiming
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
|
||||
pub struct Guild {
|
||||
pub id: String,
|
||||
pub instance_id: String,
|
||||
pub name: String,
|
||||
pub tag: String,
|
||||
pub description: String,
|
||||
pub motd: String,
|
||||
pub leader_uuid: String,
|
||||
pub icon_url: Option<String>,
|
||||
pub banner_url: Option<String>,
|
||||
pub level: i64,
|
||||
pub xp: i64,
|
||||
pub max_claims: i64,
|
||||
pub member_count: i64,
|
||||
pub claims_count: i64,
|
||||
pub created_at: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
|
||||
pub struct GuildMember {
|
||||
pub uuid: String,
|
||||
pub name: String,
|
||||
pub role: String, // "leader", "officer", "member", "recruit"
|
||||
pub joined_at: String,
|
||||
#[serde(default)]
|
||||
pub online: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
|
||||
pub struct GuildPost {
|
||||
pub id: i64,
|
||||
pub guild_id: String,
|
||||
pub author_uuid: String,
|
||||
pub author_name: String,
|
||||
pub title: String,
|
||||
pub content: String,
|
||||
pub created_at: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
|
||||
pub struct GuildClaim {
|
||||
pub id: i64,
|
||||
pub guild_id: String,
|
||||
pub guild_name: String,
|
||||
pub guild_tag: String,
|
||||
pub server_id: i64,
|
||||
pub dimension: String,
|
||||
pub chunk_x: i32,
|
||||
pub chunk_z: i32,
|
||||
pub claimed_by_uuid: String,
|
||||
pub claimed_at: String,
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Social: Friends, DMs, Invites, Profiles & Posts
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
|
||||
pub struct FriendInfo {
|
||||
pub uuid: String,
|
||||
pub username: String,
|
||||
pub status: String, // "accepted", "pending_incoming", "pending_outgoing"
|
||||
pub online: bool,
|
||||
pub playing_on: Option<String>,
|
||||
pub last_seen: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
|
||||
pub struct DirectMessage {
|
||||
pub id: i64,
|
||||
pub sender_uuid: String,
|
||||
pub sender_name: String,
|
||||
pub recipient_uuid: String,
|
||||
pub content: String,
|
||||
pub is_read: bool,
|
||||
pub created_at: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
|
||||
pub struct GameInvite {
|
||||
pub id: String,
|
||||
pub sender_uuid: String,
|
||||
pub sender_name: String,
|
||||
pub recipient_uuid: String,
|
||||
pub instance_id: String,
|
||||
pub instance_name: String,
|
||||
pub server_id: Option<i64>,
|
||||
pub server_name: Option<String>,
|
||||
pub status: String,
|
||||
pub created_at: String,
|
||||
pub expires_at: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
|
||||
pub struct UserPost {
|
||||
pub id: i64,
|
||||
pub user_uuid: String,
|
||||
pub author_name: String,
|
||||
pub content: String,
|
||||
pub image_url: Option<String>,
|
||||
pub likes_count: i64,
|
||||
pub created_at: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
|
||||
pub struct UserProfileView {
|
||||
pub uuid: String,
|
||||
pub username: String,
|
||||
pub bio: String,
|
||||
pub banner_url: Option<String>,
|
||||
pub custom_badge: Option<String>,
|
||||
pub title: Option<String>,
|
||||
pub global_level: i64,
|
||||
pub global_xp: i64,
|
||||
pub server_levels: Vec<ServerLevelInfo>,
|
||||
pub featured_achievement: Option<Achievement>,
|
||||
pub achievements_count: usize,
|
||||
pub posts: Vec<UserPost>,
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Helpers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user