1use nil_client::{Client, ServerAddr};
5use nil_core::player::PlayerId;
6use nil_core::world::config::WorldId;
7use nil_crypto::password::Password;
8use nil_server_types::auth::Token;
9use serde::{Deserialize, Serialize};
10use std::sync::LazyLock;
11use tokio::sync::RwLock;
12
13pub(crate) static CLIENT: LazyLock<RwLock<Client>> = LazyLock::new(RwLock::default);
14
15#[derive(Clone, Debug, Default, Serialize, Deserialize)]
16#[serde(default)]
17#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
18#[cfg_attr(feature = "typescript", ts(export, optional_fields = nullable))]
19#[cfg_attr(feature = "typescript", ts(rename = "ffi_UpdateClient"))]
20pub struct UpdateClient {
21 pub server: ServerAddr,
22 pub world_id: Option<WorldId>,
23 pub world_password: Option<Password>,
24 pub player_id: Option<PlayerId>,
25 pub player_password: Option<Password>,
26 pub authorization_token: Option<Token>,
27}