mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-03 12:32:46 +00:00
fix emoji exploit: sending emoji to self causes game to crash (#1889)
## Description:
When emoji is sent to oneself, it triggers: Cannot send emoji to
oneself: ${this}, because the canSendEmoji wasn't checking if it was
itself.
## Please complete the following:
- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
## Please put your Discord username so you can be contacted if a bug or
regression is found:
evan
This commit is contained in:
committed by
Scott Anderson
parent
86f8cc9f81
commit
eda49d1ad8
@@ -557,6 +557,9 @@ export class PlayerImpl implements Player {
|
||||
}
|
||||
|
||||
canSendEmoji(recipient: Player | typeof AllPlayers): boolean {
|
||||
if (recipient === this) {
|
||||
return false;
|
||||
}
|
||||
const recipientID =
|
||||
recipient === AllPlayers ? AllPlayers : recipient.smallID();
|
||||
const prevMsgs = this.outgoingEmojis_.filter(
|
||||
|
||||
Reference in New Issue
Block a user