mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
5a13b54cbf
- Make the character screen load with an empty character list from the server, send event to the server for character creation with data, but not yet saving them to the DB. - Working but messy character saving to DB - Add the character_data to the client, rather than keep it in the GLobalState.
21 lines
599 B
Rust
21 lines
599 B
Rust
use crate::comp;
|
|
use serde_derive::{Deserialize, Serialize};
|
|
|
|
/// The limit on how many characters that a player can have
|
|
pub const MAX_CHARACTERS_PER_PLAYER: usize = 8;
|
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
|
pub struct Character {
|
|
pub id: Option<i32>,
|
|
pub alias: String,
|
|
pub tool: Option<String>, // TODO: Remove once we start persisting inventories
|
|
}
|
|
|
|
/// Represents the character data sent by the server after loading from the
|
|
/// database.
|
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
|
pub struct CharacterItem {
|
|
pub character: Character,
|
|
pub body: comp::Body,
|
|
}
|