Skip to main content

nil_server_types/
world.rs

1// Copyright (C) Call of Nil contributors
2// SPDX-License-Identifier: AGPL-3.0-only
3
4use crate::round::RoundDuration;
5use jiff::Zoned;
6use nil_core::continent::ContinentSize;
7use nil_core::player::PlayerId;
8use nil_core::round::RoundId;
9use nil_core::world::config::WorldConfig;
10use serde::{Deserialize, Serialize};
11
12#[derive(Clone, Debug, Deserialize, Serialize)]
13#[serde(rename_all = "camelCase")]
14#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
15pub struct RemoteWorld {
16  pub config: WorldConfig,
17  pub description: Option<String>,
18  pub created_by: PlayerId,
19  pub created_at: Zoned,
20  pub updated_at: Zoned,
21  pub has_password: bool,
22  pub current_round: RoundId,
23  pub round_duration: Option<RoundDuration>,
24  pub active_players: u32,
25  pub total_players: u32,
26  pub continent_size: ContinentSize,
27}