skip non anchor prop in scene loader
This commit is contained in:
@@ -4,7 +4,7 @@ use tokio::sync::Mutex;
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
net::{
|
net::{
|
||||||
tools::{ AvatarJson, JsonData},
|
tools::{AvatarJson, JsonData},
|
||||||
tools_res::{PropState, GAME_RESOURCES},
|
tools_res::{PropState, GAME_RESOURCES},
|
||||||
},
|
},
|
||||||
util,
|
util,
|
||||||
@@ -131,7 +131,7 @@ pub async fn on_fkjoeabiioe(sesison: &mut PlayerSession, request: &Fkjoeabiioe)
|
|||||||
state: if prop.prop_state_list.contains(&PropState::CheckPointEnable) {
|
state: if prop.prop_state_list.contains(&PropState::CheckPointEnable) {
|
||||||
PropState::CheckPointEnable as u32
|
PropState::CheckPointEnable as u32
|
||||||
} else {
|
} else {
|
||||||
(prop.prop_state_list.first().unwrap_or(&PropState::Closed)).clone() as u32
|
prop.state.clone() as u32
|
||||||
},
|
},
|
||||||
ifjocipnpgd: prop.id as u32,
|
ifjocipnpgd: prop.id as u32,
|
||||||
});
|
});
|
||||||
@@ -201,7 +201,10 @@ pub async fn on_scene_entity_move_cs_req(
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub type GetEnteredSceneCsReq = Dummy;
|
pub type GetEnteredSceneCsReq = Dummy;
|
||||||
pub async fn on_get_entered_scene_cs_req(session: &mut PlayerSession, _: &GetEnteredSceneCsReq) -> Result<()> {
|
pub async fn on_get_entered_scene_cs_req(
|
||||||
|
session: &mut PlayerSession,
|
||||||
|
_: &GetEnteredSceneCsReq,
|
||||||
|
) -> Result<()> {
|
||||||
let scenes = GAME_RESOURCES
|
let scenes = GAME_RESOURCES
|
||||||
.map_entrance
|
.map_entrance
|
||||||
.iter()
|
.iter()
|
||||||
@@ -214,10 +217,15 @@ pub async fn on_get_entered_scene_cs_req(session: &mut PlayerSession, _: &GetEnt
|
|||||||
})
|
})
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
session.send(CMD_GET_ENTERED_SCENE_SC_RSP, Mkgidalegbd {
|
session
|
||||||
|
.send(
|
||||||
|
CMD_GET_ENTERED_SCENE_SC_RSP,
|
||||||
|
Mkgidalegbd {
|
||||||
lejonbbgdnn: scenes,
|
lejonbbgdnn: scenes,
|
||||||
retcode: 0
|
retcode: 0,
|
||||||
}).await?;
|
},
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,7 +234,6 @@ pub async fn on_kkbapmgmmcb(_session: &mut PlayerSession, _request: &Kkbapmgmmcb
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async fn load_scene(
|
async fn load_scene(
|
||||||
session: &mut PlayerSession,
|
session: &mut PlayerSession,
|
||||||
json: &mut JsonData,
|
json: &mut JsonData,
|
||||||
@@ -283,7 +290,8 @@ async fn load_scene(
|
|||||||
let prop_state = if prop.anchor_id.unwrap_or_default() > 0 {
|
let prop_state = if prop.anchor_id.unwrap_or_default() > 0 {
|
||||||
8
|
8
|
||||||
} else {
|
} else {
|
||||||
prop.state as u32
|
continue; // skip non anchor prop
|
||||||
|
// prop.state as u32
|
||||||
};
|
};
|
||||||
let info = SceneEntityInfo {
|
let info = SceneEntityInfo {
|
||||||
inst_id: prop.id as u32,
|
inst_id: prop.id as u32,
|
||||||
@@ -389,9 +397,9 @@ async fn load_scene(
|
|||||||
motion: Some(MotionInfo {
|
motion: Some(MotionInfo {
|
||||||
// pos
|
// pos
|
||||||
aomilajjmii: Some(Vector {
|
aomilajjmii: Some(Vector {
|
||||||
baimdminomk: json.position.x ,
|
baimdminomk: json.position.x,
|
||||||
bemlopmcgch: json.position.y ,
|
bemlopmcgch: json.position.y,
|
||||||
bagloppgnpb: json.position.z ,
|
bagloppgnpb: json.position.z,
|
||||||
}),
|
}),
|
||||||
// rot
|
// rot
|
||||||
eiaoiankefd: Some(Vector {
|
eiaoiankefd: Some(Vector {
|
||||||
@@ -404,7 +412,7 @@ async fn load_scene(
|
|||||||
avatar_type: AvatarType::AvatarFormalType.into(),
|
avatar_type: AvatarType::AvatarFormalType.into(),
|
||||||
base_avatar_id: *avatar_id,
|
base_avatar_id: *avatar_id,
|
||||||
map_layer: 0,
|
map_layer: 0,
|
||||||
uid: 0
|
uid: 0,
|
||||||
}),
|
}),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user