Merge branch 'UMR1352/fix#793' into 'master'

Fix #793: hide message for player coming online

Closes #793

See merge request veloren/veloren!1443
This commit is contained in:
Justin Shipsey 2020-10-18 21:04:23 +00:00
commit ab411406b0

View File

@ -269,8 +269,7 @@ impl StateExt for State {
}); });
match &msg.chat_type { match &msg.chat_type {
comp::ChatType::Online(_) comp::ChatType::Offline(_)
| comp::ChatType::Offline(_)
| comp::ChatType::CommandInfo | comp::ChatType::CommandInfo
| comp::ChatType::CommandError | comp::ChatType::CommandError
| comp::ChatType::Loot | comp::ChatType::Loot
@ -279,6 +278,18 @@ impl StateExt for State {
| comp::ChatType::World(_) => { | comp::ChatType::World(_) => {
self.notify_registered_clients(ServerGeneral::ChatMsg(resolved_msg)) self.notify_registered_clients(ServerGeneral::ChatMsg(resolved_msg))
}, },
comp::ChatType::Online(u) => {
for (client, uid) in (
&mut ecs.write_storage::<Client>(),
&ecs.read_storage::<Uid>(),
)
.join()
{
if uid != u {
client.send_msg(ServerGeneral::ChatMsg(resolved_msg.clone()));
}
}
},
comp::ChatType::Tell(u, t) => { comp::ChatType::Tell(u, t) => {
for (client, uid) in ( for (client, uid) in (
&mut ecs.write_storage::<Client>(), &mut ecs.write_storage::<Client>(),