Ignore SceneGroups that shouldn't be loaded by server (fixes loading stuck for some maps)
This commit is contained in:
parent
7b4479b191
commit
6c3e82adec
2 changed files with 22 additions and 2 deletions
|
@ -27,11 +27,20 @@ pub struct RuntimeGroupInstanceInfo {
|
|||
#[serde(rename_all = "PascalCase")]
|
||||
#[serde(default)]
|
||||
pub struct RuntimeGroupInfo {
|
||||
pub load_on_initial: bool,
|
||||
pub load_side: GroupLoadSide,
|
||||
pub group_name: Option<String>,
|
||||
pub anchor_list: Option<Vec<LevelAnchorInfo>>,
|
||||
pub prop_list: Option<Vec<LevelPropInfo>>,
|
||||
}
|
||||
|
||||
#[derive(Default, Deserialize, PartialEq, Eq)]
|
||||
pub enum GroupLoadSide {
|
||||
#[default]
|
||||
Client,
|
||||
Server,
|
||||
}
|
||||
|
||||
#[derive(Default, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
#[serde(default)]
|
||||
|
|
|
@ -5,7 +5,10 @@ pub use group::SceneGroup;
|
|||
|
||||
use std::sync::atomic::{AtomicU32, Ordering};
|
||||
|
||||
use common::data::{level::LevelAnchorInfo, LEVEL_TABLE};
|
||||
use common::data::{
|
||||
level::{GroupLoadSide, LevelAnchorInfo},
|
||||
LEVEL_TABLE,
|
||||
};
|
||||
use proto::{AvatarType, VectorBin};
|
||||
|
||||
use self::entity::{EntityType, SceneActor, SceneEntity, SceneProp};
|
||||
|
@ -87,11 +90,19 @@ impl GameWorld {
|
|||
pub fn init_groups(&mut self) {
|
||||
let floor = LEVEL_TABLE.level_floors.get(&self.floor_id).unwrap();
|
||||
|
||||
for group_instance in &floor.group_instance_list {
|
||||
for group_instance in floor
|
||||
.group_instance_list
|
||||
.iter()
|
||||
.filter(|inst| !inst.is_delete)
|
||||
{
|
||||
let level_group = LEVEL_TABLE
|
||||
.get_level_group(self.floor_id, group_instance.id)
|
||||
.unwrap();
|
||||
|
||||
if !level_group.load_on_initial || level_group.load_side == GroupLoadSide::Client {
|
||||
continue;
|
||||
}
|
||||
|
||||
let mut prop_entity_list = Vec::new();
|
||||
if let Some(prop_list) = level_group.prop_list.as_ref() {
|
||||
for level_prop in prop_list {
|
||||
|
|
Loading…
Reference in a new issue