Skip to main content

nil_payload/request/cheat/
player.rs

1// Copyright (C) Call of Nil contributors
2// SPDX-License-Identifier: AGPL-3.0-only
3
4use nil_core::player::PlayerId;
5use nil_core::world::config::WorldId;
6use serde::{Deserialize, Serialize};
7
8#[cfg(feature = "typescript")]
9use ts_rs::TS;
10
11#[derive(Clone, Debug, Deserialize, Serialize)]
12#[serde(rename_all = "camelCase")]
13#[cfg_attr(feature = "typescript", derive(TS))]
14#[cfg_attr(feature = "typescript", ts(export, optional_fields = nullable))]
15pub struct CheatGetPlayerRequest {
16  pub world: WorldId,
17  #[serde(default)]
18  pub player: Option<PlayerId>,
19}
20
21#[derive(Clone, Debug, Deserialize, Serialize)]
22#[serde(rename_all = "camelCase")]
23#[cfg_attr(feature = "typescript", derive(TS))]
24#[cfg_attr(feature = "typescript", ts(export))]
25pub struct CheatGetPlayersRequest {
26  pub world: WorldId,
27}