Closed ctm closed 1 week ago
I'm moving ShareablePlayers
from mb2_text
to mb2_commands
and making inner
private. Then I'm passing &ShareablePlayers around instead of Ref<HashMap<PlayerId, Nick>>
. ShareablePlayers
already had a player_name
method that returns "UNKNOWN"
instead of panicking. The esoteric uses of inner
will be moved into ShareablePlayers
itself.
This is tedious.
Done. Deploying now.
Make it so that the code that accesses
ShareablePlayers
returns something like "UNKNOWN" rather than doing anything that could panic.Although it hasn't ever bitten us (as far as I remember), it is unacceptable to panic if there's not an entry in
players
. While looking for the "pop-in chat bug" (#1443), I noticed thatLogLine::chat_or_action
containslet nick = players.get(&player_id).unwrap().as_ref();
, which is super embarrassing.