diff --git a/assets/voxygen/i18n/de_DE/_manifest.ron b/assets/voxygen/i18n/de_DE/_manifest.ron index f351c8a52d..08ef6db554 100644 --- a/assets/voxygen/i18n/de_DE/_manifest.ron +++ b/assets/voxygen/i18n/de_DE/_manifest.ron @@ -179,7 +179,7 @@ https://veloren.net/account/. // Chat outputs "hud.chat.online_msg": "[{name}] ist jetzt online.", - "hud.chat.offline_msg": "{name} ist jetzt offline.", + "hud.chat.offline_msg": "[{name}] ist jetzt offline.", "hud.chat.loot_msg": "Ihr erhaltet [{item}]", "hud.chat.loot_fail": "Euer Inventar ist voll!", "hud.chat.goodbye": "Verbindung getrennt.", @@ -200,8 +200,8 @@ https://veloren.net/account/. "hud.chat.npc_melee_kill_msg": "{attacker} tötete [{victim}]", "hud.chat.npc_ranged_kill_msg": "{attacker} tötete [{victim}]", "hud.chat.npc_explosion_kill_msg": "{attacker} hat [{victim}] hochgejagt", - "hud.chat.npc_energy_kill_msg": "[{attacker}] hat [{victim}] mit Magie erledigt", - "hud.chat.npc_other_kill_msg": "[{attacker}] tötete [{victim}]", + "hud.chat.npc_energy_kill_msg": "{attacker} hat [{victim}] mit Magie erledigt", + "hud.chat.npc_other_kill_msg": "{attacker} tötete [{victim}]", // SCT outputs "hud.sct.experience": "{amount} Erf", @@ -392,7 +392,7 @@ magischen Gegenstände ergattern?"#, "hud.social.zone" : "Gebiet", "hud.group": "Gruppe", - "hud.group.invite_to_join": "{name} lädt euch in seine Gruppe ein!", + "hud.group.invite_to_join": "[{name}] lädt euch in seine Gruppe ein!", "hud.group.invite": "Einladen", "hud.group.kick": "Kicken", "hud.group.assign_leader": "Anführer", diff --git a/assets/voxygen/i18n/en/hud/chat.ron b/assets/voxygen/i18n/en/hud/chat.ron index 6cbf90cd15..91feeeda4e 100644 --- a/assets/voxygen/i18n/en/hud/chat.ron +++ b/assets/voxygen/i18n/en/hud/chat.ron @@ -5,7 +5,7 @@ string_map: { // Chat outputs "hud.chat.online_msg": "[{name}] is online now", - "hud.chat.offline_msg": "{name} went offline", + "hud.chat.offline_msg": "[{name}] went offline", "hud.chat.default_death_msg": "[{name}] died", "hud.chat.environmental_kill_msg": "[{name}] died in {environment}", @@ -20,12 +20,12 @@ "hud.chat.nonexistent_buff_kill_msg": "[{victim}] died of {buff}", - "hud.chat.npc_buff_kill_msg": "[{victim}] died of {buff} caused by [{attacker}]", + "hud.chat.npc_buff_kill_msg": "[{victim}] died of {buff} caused by {attacker}", "hud.chat.npc_melee_kill_msg": "{attacker} killed [{victim}]", "hud.chat.npc_ranged_kill_msg": "{attacker} shot [{victim}]", "hud.chat.npc_explosion_kill_msg": "{attacker} blew up [{victim}]", - "hud.chat.npc_energy_kill_msg": "[{attacker}] killed [{victim}] with magic", - "hud.chat.npc_other_kill_msg": "[{attacker}] killed [{victim}]", + "hud.chat.npc_energy_kill_msg": "{attacker} killed [{victim}] with magic", + "hud.chat.npc_other_kill_msg": "{attacker} killed [{victim}]", "hud.chat.loot_msg": "You picked up [{item}]", "hud.chat.loot_fail": "Your Inventory is full!", diff --git a/assets/voxygen/i18n/en/hud/group.ron b/assets/voxygen/i18n/en/hud/group.ron index a24b65ed99..a2290b7b33 100644 --- a/assets/voxygen/i18n/en/hud/group.ron +++ b/assets/voxygen/i18n/en/hud/group.ron @@ -4,8 +4,8 @@ ( string_map: { "hud.group": "Group", - "hud.group.invite_to_join": "{name} invited you to their group!", - "hud.group.invite_to_trade": "{name} would like to trade with you.", + "hud.group.invite_to_join": "[{name}] invited you to their group!", + "hud.group.invite_to_trade": "[{name}] would like to trade with you.", "hud.group.invite": "Invite", "hud.group.kick": "Kick", "hud.group.assign_leader": "Assign Leader", diff --git a/assets/voxygen/i18n/es_la/_manifest.ron b/assets/voxygen/i18n/es_la/_manifest.ron index 26eb3c3078..31104e3192 100644 --- a/assets/voxygen/i18n/es_la/_manifest.ron +++ b/assets/voxygen/i18n/es_la/_manifest.ron @@ -197,8 +197,8 @@ https://veloren.net/account/."#, "hud.chat.npc_melee_kill_msg": "{attacker} mató a [{victim}]", "hud.chat.npc_ranged_kill_msg": "{attacker} le disparó a [{victim}]", "hud.chat.npc_explosion_kill_msg": "{attacker} hizo explotar a [{victim}]", - "hud.chat.npc_energy_kill_msg": "[{attacker}] usó magia para matar a [{victim}]", - "hud.chat.npc_other_kill_msg": "[{attacker}] mató a [{victim}]", + "hud.chat.npc_energy_kill_msg": "{attacker} usó magia para matar a [{victim}]", + "hud.chat.npc_other_kill_msg": "{attacker} mató a [{victim}]", "hud.chat.loot_msg": "Recogiste [{item}]", "hud.chat.loot_fail": "Tu inventario está lleno!", @@ -397,7 +397,7 @@ objetos infundidos con magia?"#, "hud.crafting.tool_cata": "Requisitos:", "hud.group": "Grupo", - "hud.group.invite_to_join": "{name} Te invito a su Grupo!", + "hud.group.invite_to_join": "[{name}] Te invito a su Grupo!", "hud.group.invite": "Invitar", "hud.group.kick": "Echar", "hud.group.assign_leader": "Asignar Lider", diff --git a/assets/voxygen/i18n/fr_FR/_manifest.ron b/assets/voxygen/i18n/fr_FR/_manifest.ron index 8fe307b634..ab8b149da9 100644 --- a/assets/voxygen/i18n/fr_FR/_manifest.ron +++ b/assets/voxygen/i18n/fr_FR/_manifest.ron @@ -180,8 +180,8 @@ https://veloren.net/account/."#, "hud.chat.npc_melee_kill_msg": "{attacker} a tué [{victim}]", "hud.chat.npc_ranged_kill_msg": "{attacker} a tiré sur [{victim}]", "hud.chat.npc_explosion_kill_msg": "{attacker} a explosé [{victim}]", - "hud.chat.npc_energy_kill_msg": "[{attacker}] a tué [{victim}] avec de la magie", - "hud.chat.npc_other_kill_msg": "[{attacker}] a tué [{victim}]", + "hud.chat.npc_energy_kill_msg": "{attacker} a tué [{victim}] avec de la magie", + "hud.chat.npc_other_kill_msg": "{attacker} a tué [{victim}]", "hud.chat.loot_msg": "Vous avez ramassé [{item}]", "hud.chat.loot_fail": "Votre inventaire est plein!", @@ -377,7 +377,7 @@ objets magiques ?"#, "hud.crafting.tool_cata": "Nécessite:", "hud.group": "Groupe", - "hud.group.invite_to_join": "{name} vous a invité dans son groupe!", + "hud.group.invite_to_join": "[{name}] vous a invité dans son groupe!", "hud.group.invite": "Inviter", "hud.group.kick": "Exclure", // <- need confirmation "hud.group.assign_leader": "Assigner Chef", diff --git a/assets/voxygen/i18n/nl/_manifest.ron b/assets/voxygen/i18n/nl/_manifest.ron index c8b0611d08..7997dc1fdb 100644 --- a/assets/voxygen/i18n/nl/_manifest.ron +++ b/assets/voxygen/i18n/nl/_manifest.ron @@ -175,7 +175,7 @@ https://veloren.net/account/."#, // Chat outputs "hud.chat.online_msg": "[{name}] is nu online", - "hud.chat.offline_msg": "{name} is offline gegaan", + "hud.chat.offline_msg": "[{name}] is offline gegaan", "hud.chat.default_death_msg": "[{name}] is gestorven", "hud.chat.environmental_kill_msg": "[{name}] is gestorven in {environment}", @@ -382,7 +382,7 @@ herstellen", "hud.crafting.tool_cata": "Vereisten:", "hud.group": "Groep", - "hud.group.invite_to_join": "{name} heeft je voor zijn/haar groep uitgenodigd!", + "hud.group.invite_to_join": "[{name}] heeft je voor zijn/haar groep uitgenodigd!", "hud.group.invite": "Uitnodigen", "hud.group.kick": "Kick", "hud.group.assign_leader": "Maak Leider", diff --git a/assets/voxygen/i18n/no/_manifest.ron b/assets/voxygen/i18n/no/_manifest.ron index a2c7c1f520..fa9fc1de15 100644 --- a/assets/voxygen/i18n/no/_manifest.ron +++ b/assets/voxygen/i18n/no/_manifest.ron @@ -180,7 +180,7 @@ https://veloren.net/account/."#, // Chat outputs "hud.chat.online_msg": "[{name}] logget på", - "hud.chat.offline_msg": "{name} logget av", + "hud.chat.offline_msg": "[{name}] logget av", "hud.chat.default_death_msg": "[{name}] døde", "hud.chat.environmental_kill_msg": "[{name}] døde i {environment}", @@ -197,8 +197,8 @@ https://veloren.net/account/."#, "hud.chat.npc_melee_kill_msg": "{attacker} drepte [{victim}]", "hud.chat.npc_ranged_kill_msg": "{attacker} skjøt [{victim}]", "hud.chat.npc_explosion_kill_msg": "{attacker} sprengte [{victim}]", - "hud.chat.npc_energy_kill_msg": "[{attacker}] drepte [{victim}] med magi", - "hud.chat.npc_other_kill_msg": "[{attacker}] drepte [{victim}]", + "hud.chat.npc_energy_kill_msg": "{attacker} drepte [{victim}] med magi", + "hud.chat.npc_other_kill_msg": "{attacker} drepte [{victim}]", "hud.chat.loot_msg": "Du plukket opp [{item}]", "hud.chat.loot_fail": "Ditt inventar er fullt!", @@ -394,7 +394,7 @@ magisk infunderte gjenstandene?"#, "hud.crafting.tool_cata": "Krever:", "hud.group": "Gruppe", - "hud.group.invite_to_join": "{name} inviterte deg til gruppen deres!", + "hud.group.invite_to_join": "[{name}] inviterte deg til gruppen deres!", "hud.group.invite": "Inviter", "hud.group.kick": "Spark", "hud.group.assign_leader": "Tilordne leder", diff --git a/assets/voxygen/i18n/pt_BR/_manifest.ron b/assets/voxygen/i18n/pt_BR/_manifest.ron index dd791304cc..9ca1fe8558 100644 --- a/assets/voxygen/i18n/pt_BR/_manifest.ron +++ b/assets/voxygen/i18n/pt_BR/_manifest.ron @@ -184,8 +184,8 @@ https://veloren.net/account/."#, "hud.chat.npc_melee_kill_msg": "{attacker} matou [{victim}]", "hud.chat.npc_ranged_kill_msg": "{attacker} acertou [{victim}]", "hud.chat.npc_explosion_kill_msg": "{attacker} exoplodiu [{victim}]", - "hud.chat.npc_energy_kill_msg": "[{attacker}] matou [{victim}] com magia", - "hud.chat.npc_buff_kill_msg": "[{attacker}] matou [{victim}]", + "hud.chat.npc_energy_kill_msg": "{attacker} matou [{victim}] com magia", + "hud.chat.npc_buff_kill_msg": "{attacker} matou [{victim}]", "hud.chat.loot_msg": "Você pegou [{item}]", "hud.chat.loot_fail": "Seu inventário está cheio!", @@ -383,7 +383,7 @@ itens magicamente modificados?"#, "hud.crafting.tool_cata": "Precisa de:", "hud.group": "Grupo", - "hud.group.invite_to_join": "{name} convidou você para o grupo!", + "hud.group.invite_to_join": "[{name}] convidou você para o grupo!", "hud.group.invite": "Convidar", "hud.group.kick": "Expulsar", "hud.group.assign_leader": "Atribuír líder", diff --git a/assets/voxygen/i18n/ru_RU/_manifest.ron b/assets/voxygen/i18n/ru_RU/_manifest.ron index 1931b3bdc6..d5effe23ef 100644 --- a/assets/voxygen/i18n/ru_RU/_manifest.ron +++ b/assets/voxygen/i18n/ru_RU/_manifest.ron @@ -196,8 +196,8 @@ https://veloren.net/account/."#, "hud.chat.npc_melee_kill_msg": "{attacker} убил [{victim}]", "hud.chat.npc_ranged_kill_msg": "{attacker} подстрелил [{victim}]", "hud.chat.npc_explosion_kill_msg": "{attacker} взорвал [{victim}]", - "hud.chat.npc_energy_kill_msg": "[{attacker}] убил [{victim}] с помощью магии", - "hud.chat.npc_other_kill_msg": "[{attacker}] убил [{victim}]", + "hud.chat.npc_energy_kill_msg": "{attacker} убил [{victim}] с помощью магии", + "hud.chat.npc_other_kill_msg": "{attacker} убил [{victim}]", "hud.chat.loot_msg": "Вы подобрали [{item}]", "hud.chat.loot_fail": "Ваш инвентарь полон!", @@ -395,7 +395,7 @@ https://veloren.net/account/."#, "hud.crafting.tool_cata": "Требуется:", "hud.group": "Группа", - "hud.group.invite_to_join": "{name} пригласил вас в свою группу!", + "hud.group.invite_to_join": "[{name}] пригласил вас в свою группу!", "hud.group.invite": "Пригласить", "hud.group.kick": "Кикнуть", "hud.group.assign_leader": "Назначить лидером", diff --git a/assets/voxygen/i18n/tr_TR/hud/chat.ron b/assets/voxygen/i18n/tr_TR/hud/chat.ron index 4f12f65886..bb3451c758 100644 --- a/assets/voxygen/i18n/tr_TR/hud/chat.ron +++ b/assets/voxygen/i18n/tr_TR/hud/chat.ron @@ -19,11 +19,11 @@ "hud.chat.pvp_buff_kill_msg": "[{victim}], [{attacker}] tarafından öldürüldü.", - "hud.chat.npc_melee_kill_msg": "[{victim}], [{attacker}] tarafından mağlup edildi.", - "hud.chat.npc_ranged_kill_msg": "[{victim}], [{attacker}] tarafından vuruldu.", - "hud.chat.npc_explosion_kill_msg": "[{victim}], [{attacker}] tarafından havaya uçuruldu.", - "hud.chat.npc_energy_kill_msg": "[{victim}], [{attacker}] tarafından büyü ile mağlup edildi.", - "hud.chat.npc_other_kill_msg": "[{victim}], [{attacker}] tarafından öldürüldü.", + "hud.chat.npc_melee_kill_msg": "[{victim}], {attacker} tarafından mağlup edildi.", + "hud.chat.npc_ranged_kill_msg": "[{victim}], {attacker} tarafından vuruldu.", + "hud.chat.npc_explosion_kill_msg": "[{victim}], {attacker} tarafından havaya uçuruldu.", + "hud.chat.npc_energy_kill_msg": "[{victim}], {attacker} tarafından büyü ile mağlup edildi.", + "hud.chat.npc_other_kill_msg": "[{victim}], {attacker} tarafından öldürüldü.", "hud.chat.loot_msg": "[{item}] topladın.", "hud.chat.loot_fail": "Envanterin dolu!", diff --git a/assets/voxygen/i18n/tr_TR/hud/group.ron b/assets/voxygen/i18n/tr_TR/hud/group.ron index 6bc5858b8c..5fa2eed351 100644 --- a/assets/voxygen/i18n/tr_TR/hud/group.ron +++ b/assets/voxygen/i18n/tr_TR/hud/group.ron @@ -4,7 +4,7 @@ ( string_map: { "hud.group": "Grup", - "hud.group.invite_to_join": "{name} seni grubuna davet etti!", + "hud.group.invite_to_join": "[{name}] seni grubuna davet etti!", "hud.group.invite": "Davet Et", "hud.group.kick": "Gruptan At", "hud.group.assign_leader": "Lider Seç", diff --git a/assets/voxygen/i18n/uk_UA/hud/chat.ron b/assets/voxygen/i18n/uk_UA/hud/chat.ron index b16351c15c..9fcca7a03f 100644 --- a/assets/voxygen/i18n/uk_UA/hud/chat.ron +++ b/assets/voxygen/i18n/uk_UA/hud/chat.ron @@ -5,7 +5,7 @@ string_map: { // Chat outputs "hud.chat.online_msg": "[{name}] в мережі", - "hud.chat.offline_msg": "{name} не в мережі", + "hud.chat.offline_msg": "[{name}] не в мережі", "hud.chat.default_death_msg": "[{name}] помер(ла)", "hud.chat.environmental_kill_msg": "[{name}] помер(ла) в {environment}", @@ -20,12 +20,12 @@ "hud.chat.nonexistent_buff_kill_msg": "[{victim}] помер(ла) від: {buff}", - "hud.chat.npc_buff_kill_msg": "[{victim}] помер(ла) від: {buff} через: [{attacker}]", + "hud.chat.npc_buff_kill_msg": "[{victim}] помер(ла) від: {buff} через: {attacker}", "hud.chat.npc_melee_kill_msg": "{attacker} вбив(ла) [{victim}]", "hud.chat.npc_ranged_kill_msg": "{attacker} застрелив(ла) [{victim}]", "hud.chat.npc_explosion_kill_msg": "{attacker} підірвав(ла) [{victim}]", - "hud.chat.npc_energy_kill_msg": "[{attacker}] вбив(ла) [{victim}] магією", - "hud.chat.npc_other_kill_msg": "[{attacker}] вбив(ла) [{victim}]", + "hud.chat.npc_energy_kill_msg": "{attacker} вбив(ла) [{victim}] магією", + "hud.chat.npc_other_kill_msg": "{attacker} вбив(ла) [{victim}]", "hud.chat.loot_msg": "Ви підібрали [{item}]", "hud.chat.loot_fail": "Ваш інвентар переповнено!", diff --git a/assets/voxygen/i18n/uk_UA/hud/group.ron b/assets/voxygen/i18n/uk_UA/hud/group.ron index 1765532205..7a8f056e5d 100644 --- a/assets/voxygen/i18n/uk_UA/hud/group.ron +++ b/assets/voxygen/i18n/uk_UA/hud/group.ron @@ -4,7 +4,7 @@ ( string_map: { "hud.group": "Група", - "hud.group.invite_to_join": "{name} запросив(ла) Вас до їхньої групи!", + "hud.group.invite_to_join": "[{name}] запросив(ла) Вас до їхньої групи!", "hud.group.invite": "Запросити", "hud.group.kick": "Викинути", "hud.group.assign_leader": "Призначити лідером", diff --git a/assets/voxygen/i18n/zh_CN/_manifest.ron b/assets/voxygen/i18n/zh_CN/_manifest.ron index b0ae3c75f4..417dd56411 100644 --- a/assets/voxygen/i18n/zh_CN/_manifest.ron +++ b/assets/voxygen/i18n/zh_CN/_manifest.ron @@ -332,7 +332,7 @@ Veloren 的夜晚会变得非常的黑. "hud.crafting.tool_cata": "需要:", "hud.group": "队伍", - "hud.group.invite_to_join": "{name} 邀请你加入它们的队伍!", + "hud.group.invite_to_join": "[{name}] 邀请你加入它们的队伍!", "hud.group.invite": "邀请", "hud.group.kick": "踢出", "hud.group.assign_leader": "指定队长", diff --git a/client/src/lib.rs b/client/src/lib.rs index 9d011ebfb5..1f15a66bfe 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -1909,7 +1909,7 @@ impl Client { format!("{:?}", buff_kind).to_lowercase().as_str() ), KillSource::NonPlayer(attacker_name, KillType::Buff(buff_kind)) => format!( - "[{}] died of {} caused by [{}]", + "[{}] died of {} caused by {}", alias_of_uid(victim), format!("{:?}", buff_kind).to_lowercase().as_str(), attacker_name diff --git a/server/src/events/interaction.rs b/server/src/events/interaction.rs index bf69e76cd1..ddfdc50261 100644 --- a/server/src/events/interaction.rs +++ b/server/src/events/interaction.rs @@ -11,6 +11,7 @@ use common_net::{msg::ServerGeneral, sync::WorldSyncExt}; use crate::{ client::Client, presence::{Presence, RegionSubscription}, + state_ext::StateExt, Server, }; @@ -133,16 +134,56 @@ pub fn handle_possess(server: &Server, possessor_uid: Uid, possesse_uid: Uid) { return; } - let mut clients = ecs.write_storage::(); - - if clients.get_mut(possesse).is_some() { + if ecs.read_storage::().get(possesse).is_some() { error!("can't possess other players"); return; } match (|| -> Option> { + let mut clients = ecs.write_storage::(); let c = clients.remove(possessor)?; clients.insert(possesse, c).ok()?; + let playerlist_messages = if let Some(client) = clients.get(possesse) { + client.send_fallible(ServerGeneral::SetPlayerEntity(possesse_uid)); + // If a player is posessing non player, add possesse to playerlist as player and + // remove old player + if let Some(possessor_player) = ecs.read_storage::().get(possessor) { + let admins = ecs.read_storage::(); + let entity_possession_msg = ServerGeneral::PlayerListUpdate( + common_net::msg::server::PlayerListUpdate::Add( + possesse_uid, + common_net::msg::server::PlayerInfo { + player_alias: possessor_player.alias.clone(), + is_online: true, + is_admin: admins.get(possessor).is_some(), + character: ecs.read_storage::().get(possesse).map( + |s| common_net::msg::CharacterInfo { + name: s.name.clone(), + }, + ), + }, + ), + ); + let remove_old_player_msg = ServerGeneral::PlayerListUpdate( + common_net::msg::server::PlayerListUpdate::Remove(possessor_uid), + ); + + // Send msg to new possesse client now because it is not yet considered a player + // and will be missed by notify_players + client.send_fallible(entity_possession_msg.clone()); + client.send_fallible(remove_old_player_msg.clone()); + Some((remove_old_player_msg, entity_possession_msg)) + } else { + None + } + } else { + None + }; + drop(clients); + if let Some((remove_player, possess_entity)) = playerlist_messages { + server.state().notify_players(possess_entity); + server.state().notify_players(remove_player); + } //optional entities let mut players = ecs.write_storage::(); let mut presence = ecs.write_storage::(); @@ -178,10 +219,6 @@ pub fn handle_possess(server: &Server, possessor_uid: Uid, possesse_uid: Uid) { }, } - clients - .get_mut(possesse) - .map(|c| c.send_fallible(ServerGeneral::SetPlayerEntity(possesse_uid))); - // Put possess item into loadout let mut inventories = ecs.write_storage::(); let mut inventory = inventories