mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-26 19:24:36 +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:
@@ -551,6 +551,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