Feat: join/left message#263
Conversation
| fn broadcast_system_chat(&self, message: &TextComponent) { | ||
| self.broadcast_to_online_with(|player| CSystemChat::new(message, false, player)); | ||
| } |
There was a problem hiding this comment.
The function broadcast_sprint_report is also using broadcast_to_online_with and can be abstracted with that function, maybe search also for other occasions (don't have a good global search on github :/ )
There was a problem hiding this comment.
You can reuse your method again in the code. Because otherwise some places we use broadcast_to direct and in your code we use your helper function. And I like to have it consistent. Better?
There was a problem hiding this comment.
hmm ok, i just do it the way vanilla does
| } | ||
|
|
||
| fn broadcast_player_join_message(&self, player: &Player, previous_name: Option<&str>) { | ||
| use steel_utils::translations; |
There was a problem hiding this comment.
I'm also a fan of having all use on top of the file because you have in two functions the same use. @4lve what is your thought about that?
There was a problem hiding this comment.
Yea, always put our imports at the top. Exception for feature flagged functions
| } | ||
|
|
||
| fn broadcast_player_leave_message(&self, player: &Player) { | ||
| use steel_utils::translations; |
implement join and leave message. The join message look for cached player name, then change it if need, then send it. The leave message is sent on disconnect so theoretically they are online.