modify msg source to show actual source id as well as (character) source

This commit is contained in:
Rusty Striker 2024-10-04 14:45:53 +03:00
parent ac813064fd
commit 69baf79b8f
Signed by: RustyStriker
GPG key ID: 9DBDBC7C48FC3C31

View file

@ -41,8 +41,12 @@ impl GameServer {
continue;
}
if msg.source.is_empty() {
msg.source = id.clone();
msg.source = format!("({})", id.clone());
}
else {
msg.source = format!("{} ({})", msg.source, id.clone());
}
self.chat.push((id.clone(), msg.clone()));
_ = broadcast.send((None, api::Response::Message(msg)));
},
@ -70,4 +74,4 @@ impl GameServer {
}
_ = broadcast.send((None, api::Response::Shutdown));
}
}
}