Did some code clean-up
Added TODOs for some changes that need to be made
This commit is contained in:
@@ -282,11 +282,38 @@ async fn handle_world_events(
|
||||
Some(crate::world_client::world::world_event::Event::NpcSpawn(npc_spawn)) => {
|
||||
debug!("Processing NPC spawn event: {:?}", npc_spawn);
|
||||
// Convert to the appropriate game packet and send to client
|
||||
// This would involve creating a spawn packet and sending it through the connection's writer
|
||||
let npc = WorldObject {
|
||||
id: npc_spawn.id,
|
||||
object_type: 2,
|
||||
x: npc_spawn.pos_x,
|
||||
y: npc_spawn.pos_y,
|
||||
z: 0.0,
|
||||
map_id: 0,
|
||||
name: "NPC".to_string(),
|
||||
hp: npc_spawn.hp,
|
||||
max_hp: npc_spawn.hp,
|
||||
};
|
||||
// if let Err(e) = spawn_npc(&npc, connection_service.clone(), session_id.clone()).await {
|
||||
// error!("Failed to spawn npc for session {}: {}", session_id, e);
|
||||
// }
|
||||
}
|
||||
Some(crate::world_client::world::world_event::Event::MobSpawn(mob_spawn)) => {
|
||||
debug!("Processing mob spawn event: {:?}", mob_spawn);
|
||||
// Convert to the appropriate game packet and send to client
|
||||
let mob = WorldObject {
|
||||
id: mob_spawn.id,
|
||||
object_type: 3,
|
||||
x: mob_spawn.pos_x,
|
||||
y: mob_spawn.pos_y,
|
||||
z: 0.0,
|
||||
map_id: 0,
|
||||
name: "Mob".to_string(),
|
||||
hp: mob_spawn.hp,
|
||||
max_hp: mob_spawn.hp,
|
||||
};
|
||||
if let Err(e) = spawn_mob(&mob, connection_service.clone(), session_id.clone()).await {
|
||||
error!("Failed to spawn mob for session {}: {}", session_id, e);
|
||||
}
|
||||
}
|
||||
Some(crate::world_client::world::world_event::Event::ObjectDespawn(despawn)) => {
|
||||
debug!("Processing object despawn event: {:?}", despawn);
|
||||
|
||||
Reference in New Issue
Block a user