Skip to content

Commit

Permalink
Allow echoing messages back to sender if they're in the filter list f…
Browse files Browse the repository at this point in the history
…or relayed multiplayer matches.
  • Loading branch information
zyro committed Dec 9, 2019
1 parent 95647a9 commit 1d2b9c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
- Do not use absolute path for `tini` executable in default container entry point.
- Faster validation of JSON object input payloads.
- Update IAP validation example for Android Publisher v3 API.
- Relayed multiplayer matches allow echoing messages back to sender if they're in the filter list.

### Fixed
- Correctly read pagination cursor in notification listings.
Expand Down
12 changes: 6 additions & 6 deletions server/pipeline_match.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,16 +347,16 @@ func (p *Pipeline) matchDataSend(logger *zap.Logger, session Session, envelope *
for i := 0; i < len(presenceIDs); i++ {
presenceID := presenceIDs[i]
if presenceID.SessionID == session.ID() {
// Don't echo back to sender.
presenceIDs[i] = presenceIDs[len(presenceIDs)-1]
presenceIDs = presenceIDs[:len(presenceIDs)-1]
senderFound = true
if filters == nil {
// Don't echo back to sender unless they explicitly appear in the filter list.
presenceIDs[i] = presenceIDs[len(presenceIDs)-1]
presenceIDs = presenceIDs[:len(presenceIDs)-1]
break
} else {
i--
}
} else if filters != nil {
}

if filters != nil {
// Check if this presence is specified in the filters.
filterFound := false
for j := 0; j < len(filters); j++ {
Expand Down

0 comments on commit 1d2b9c9

Please sign in to comment.