Skip to content

Commit

Permalink
feat: IC-138 - added back UpdatePlayer event (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergio-ivanuzzo authored Sep 9, 2024
1 parent 1f1f7e4 commit a9a05dd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ sha-1 = { version = "0.9.8", optional = true }
tentacli-crypto = "0.1.0"
tentacli-formatters = "0.1.0"
tentacli-packet = "7.0.0"
tentacli-traits = "8.1.0"
tentacli-traits = "9.0.0"
tentacli-utils = "2.1.0"
tokio = { version = "1", features = ["sync", "net", "io-util", "macros", "time", "rt-multi-thread"] }
#tokio-util = { version = "0.7.10", features = ["io"] }
Expand Down
4 changes: 4 additions & 0 deletions src/features/wotlk_realm/player/handle_update_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ impl PacketHandler for Handler {
let mut guard = input.session.lock().await;
let me = guard.me.as_mut().unwrap();
*me = object.clone();
response.push(HandlerOutput::UpdatePlayer(object.clone()));
}

let mut guard = input.data_storage.lock().unwrap();
Expand Down Expand Up @@ -263,6 +264,9 @@ impl PacketHandler for Handler {
guard.players_map.entry(guid).and_modify(|o| {
o.update_data.extend_or_clear_source(&mut block.update_data);
update_data = block.update_data.clone();
if o.guid == my_guid {
response.push(HandlerOutput::UpdatePlayer(o.clone()));
}
});
},
g if guard.units_map.contains_key(&g) => {
Expand Down
2 changes: 0 additions & 2 deletions src/features/wotlk_realm/player/player_login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ impl PacketHandler for Handler {
)
);

response.push(HandlerOutput::IdentifyMe(my_guid));

Ok(response)
}
}
2 changes: 1 addition & 1 deletion src/primary/traits/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tentacli-traits"
version = "8.1.0"
version = "9.0.0"
edition = "2021"
authors = ["Sergio Ivanuzzo <[email protected]>"]
description = "Traits and types for tentacli and related projects"
Expand Down
2 changes: 1 addition & 1 deletion src/primary/traits/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub enum HandlerOutput {
Data((u32, Vec<u8>, String)),
TransferCharactersList(Vec<Player>),
TransferRealmsList(Vec<Realm>),
IdentifyMe(u64),
UpdatePlayer(Player),

// commands
ConnectionRequest(String, u16),
Expand Down

0 comments on commit a9a05dd

Please sign in to comment.