Skip to content
Snippets Groups Projects
Commit bb2c43b3 authored by Mo Firouz's avatar Mo Firouz
Browse files

Set default matchmaker input query if none supplied with the request.

parent 7bd0cbc2
Branches
Tags
No related merge requests found
......@@ -10,6 +10,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
### Fixed
- Use leaderboard expires rather than end active IDs with leaderboard resets.
- Better validation of tournament duration when a reset schedule is set.
- Set default matchmaker input query if none supplied with the request.
## [2.1.0] - 2018-10-08
### Added
......
......@@ -16,11 +16,12 @@ package server
import (
"fmt"
"time"
"github.com/dgrijalva/jwt-go"
"github.com/gofrs/uuid"
"github.com/heroiclabs/nakama/rtapi"
"go.uber.org/zap"
"time"
)
func (p *Pipeline) matchmakerAdd(logger *zap.Logger, session Session, envelope *rtapi.Envelope) {
......@@ -46,8 +47,13 @@ func (p *Pipeline) matchmakerAdd(logger *zap.Logger, session Session, envelope *
return
}
query := incoming.Query
if query == "" {
query = "*"
}
// Run matchmaker add.
ticket, entries, err := p.matchmaker.Add(session, incoming.Query, minCount, maxCount, incoming.StringProperties, incoming.NumericProperties)
ticket, entries, err := p.matchmaker.Add(session, query, minCount, maxCount, incoming.StringProperties, incoming.NumericProperties)
if err != nil {
logger.Error("Error adding to matchmaker", zap.Error(err))
session.Send(false, 0, &rtapi.Envelope{Cid: envelope.Cid, Message: &rtapi.Envelope_Error{Error: &rtapi.Error{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment