Skip to content
Snippets Groups Projects
Commit 1d2b9c98 authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Allow echoing messages back to sender if they're in the filter list for...

Allow echoing messages back to sender if they're in the filter list for relayed multiplayer matches.
parent 95647a9b
Branches
Tags
No related merge requests found
...@@ -14,6 +14,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr ...@@ -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. - Do not use absolute path for `tini` executable in default container entry point.
- Faster validation of JSON object input payloads. - Faster validation of JSON object input payloads.
- Update IAP validation example for Android Publisher v3 API. - 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 ### Fixed
- Correctly read pagination cursor in notification listings. - Correctly read pagination cursor in notification listings.
......
...@@ -347,16 +347,16 @@ func (p *Pipeline) matchDataSend(logger *zap.Logger, session Session, envelope * ...@@ -347,16 +347,16 @@ func (p *Pipeline) matchDataSend(logger *zap.Logger, session Session, envelope *
for i := 0; i < len(presenceIDs); i++ { for i := 0; i < len(presenceIDs); i++ {
presenceID := presenceIDs[i] presenceID := presenceIDs[i]
if presenceID.SessionID == session.ID() { if presenceID.SessionID == session.ID() {
// Don't echo back to sender.
presenceIDs[i] = presenceIDs[len(presenceIDs)-1]
presenceIDs = presenceIDs[:len(presenceIDs)-1]
senderFound = true senderFound = true
if filters == nil { 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 break
} else {
i--
} }
} else if filters != nil { }
if filters != nil {
// Check if this presence is specified in the filters. // Check if this presence is specified in the filters.
filterFound := false filterFound := false
for j := 0; j < len(filters); j++ { for j := 0; j < len(filters); j++ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment