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
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+8 −2
Original line number Diff line number Diff line
@@ -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{