use OpenStateConfig excel

This commit is contained in:
xeon 2024-04-11 18:23:13 +03:00
parent dba609d124
commit b9631c1442
5 changed files with 2890 additions and 12 deletions

File diff suppressed because it is too large Load diff

View file

@ -37,6 +37,15 @@ pub struct AvatarExcelConfig {
pub lodpattern_name: String, pub lodpattern_name: String,
} }
#[derive(Deserialize, Default)]
#[serde(default)]
#[serde(rename_all = "camelCase")]
pub struct OpenStateConfig {
pub id: u32,
pub default_state: bool,
pub allow_client_open: bool,
}
#[derive(Deserialize)] #[derive(Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct PropGrowCurve { pub struct PropGrowCurve {

View file

@ -20,6 +20,7 @@ lazy_static! {
pub struct ExcelCollection { pub struct ExcelCollection {
pub avatar_configs: Vec<AvatarExcelConfig>, pub avatar_configs: Vec<AvatarExcelConfig>,
pub open_state_configs: Vec<OpenStateConfig>,
} }
pub struct GameConfigCollection { pub struct GameConfigCollection {
@ -33,11 +34,15 @@ impl ExcelCollection {
"assets/ExcelBinOutput/AvatarExcelConfigData.json", "assets/ExcelBinOutput/AvatarExcelConfigData.json",
)) ))
.unwrap(), .unwrap(),
open_state_configs: from_str(&load_asset(
"assets/ExcelBinOutput/OpenStateConfigData.json",
))
.unwrap(),
} }
} }
pub fn table_count(&self) -> usize { pub fn table_count(&self) -> usize {
1 2
} }
} }

View file

@ -1,11 +1,5 @@
use proto::Vector; use proto::Vector;
pub static OPEN_STATES: [u32; 58] = [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 27, 28, 29, 30, 31, 32, 33, 37, 38, 45, 47,
53, 54, 55, 59, 62, 65, 900, 901, 902, 903, 1001, 1002, 1003, 1004, 1005, 1007, 1008, 1009,
1010, 1100, 1103, 1300, 1401, 1403, 1700, 2100, 2101, 2103, 2400, 3701, 3702, 4100,
];
pub static INITIAL_POS: Vector = Vector { pub static INITIAL_POS: Vector = Vector {
x: 2336.789, x: 2336.789,
y: 249.98996, y: 249.98996,

View file

@ -5,8 +5,7 @@ use rand::RngCore;
use super::*; use super::*;
use crate::{ use crate::{
game::{constants, entity::Entity, prop_types::*}, data::EXCEL_COLLECTION, game::{constants, entity::Entity, prop_types::*}, util
util,
}; };
pub async fn on_get_player_token_req( pub async fn on_get_player_token_req(
@ -75,9 +74,9 @@ pub async fn on_player_login_req(session: &PlayerSession, _body: &PlayerLoginReq
.send( .send(
OPEN_STATE_UPDATE_NOTIFY, OPEN_STATE_UPDATE_NOTIFY,
OpenStateUpdateNotify { OpenStateUpdateNotify {
open_state_map: constants::OPEN_STATES open_state_map: EXCEL_COLLECTION.open_state_configs
.into_iter() .iter()
.map(|id| (id, 1)) .map(|op| (op.id, 1))
.collect(), .collect(),
}, },
) )