Commit 68f81008 authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Realtime parties feature. (#524)

parent b3085c6a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr

## [Unreleased]
### Added
- New realtime parties feature allowing users to group together, exchange data, and matchmake.
- Add party matching support to matchmaker.
- Add options to matchmaker to control how long tickets are allowed to wait for their preferred match.

+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ require (
	github.com/gorilla/mux v1.7.4
	github.com/gorilla/websocket v1.4.2
	github.com/grpc-ecosystem/grpc-gateway/v2 v2.0.1
	github.com/heroiclabs/nakama-common v1.10.1-0.20210112124918-da701a0f7020
	github.com/heroiclabs/nakama-common v1.10.1-0.20210115155535-0ee8f4a14e69
	github.com/jackc/fake v0.0.0-20150926172116-812a484cc733 // indirect
	github.com/jackc/pgx v3.5.0+incompatible
	github.com/jmhodges/levigo v1.0.0 // indirect
+2 −0
Original line number Diff line number Diff line
@@ -207,6 +207,8 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/heroiclabs/nakama-common v1.10.1-0.20210112124918-da701a0f7020 h1:6jaVk2j7QSdSb4APKMQjDDa/s6FgxcZF+vAKszoCbkg=
github.com/heroiclabs/nakama-common v1.10.1-0.20210112124918-da701a0f7020/go.mod h1:li7bMQwOYA0NjT3DM4NKQBNruULPa2hrqdiSaaTwui4=
github.com/heroiclabs/nakama-common v1.10.1-0.20210115155535-0ee8f4a14e69 h1:cc2lLXw3Zy3kTa61n5b+7GTmL33/yhlp6yILaIi0DFY=
github.com/heroiclabs/nakama-common v1.10.1-0.20210115155535-0ee8f4a14e69/go.mod h1:li7bMQwOYA0NjT3DM4NKQBNruULPa2hrqdiSaaTwui4=
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
+4 −1
Original line number Diff line number Diff line
@@ -143,10 +143,13 @@ func main() {
		startupLogger.Fatal("Failed initializing runtime modules", zap.Error(err))
	}
	matchmaker := server.NewLocalMatchmaker(logger, startupLogger, config, router, runtime)
	partyRegistry := server.NewLocalPartyRegistry(logger, matchmaker, tracker, streamManager, router, config.GetName())
	tracker.SetPartyJoinListener(partyRegistry.Join)
	tracker.SetPartyLeaveListener(partyRegistry.Leave)

	leaderboardScheduler.Start(runtime)

	pipeline := server.NewPipeline(logger, config, db, jsonpbMarshaler, jsonpbUnmarshaler, sessionRegistry, matchRegistry, matchmaker, tracker, router, runtime)
	pipeline := server.NewPipeline(logger, config, db, jsonpbMarshaler, jsonpbUnmarshaler, sessionRegistry, matchRegistry, partyRegistry, matchmaker, tracker, router, runtime)
	statusHandler := server.NewLocalStatusHandler(logger, sessionRegistry, matchRegistry, tracker, metrics, config.GetName())

	apiServer := server.StartApiServer(logger, startupLogger, db, jsonpbMarshaler, jsonpbUnmarshaler, config, socialClient, leaderboardCache, leaderboardRankCache, sessionRegistry, matchRegistry, matchmaker, tracker, router, metrics, pipeline, runtime)
+1 −1
Original line number Diff line number Diff line
@@ -843,7 +843,7 @@ func NewLeaderboardConfig() *LeaderboardConfig {
}

type MatchmakerConfig struct {
	MaxTickets   int `yaml:"max_tickets" json:"max_tickets" usage:"Maximum number of concurrent matchmaking tickets allowed per session. Default 3."`
	MaxTickets   int `yaml:"max_tickets" json:"max_tickets" usage:"Maximum number of concurrent matchmaking tickets allowed per session or party. Default 3."`
	IntervalSec  int `yaml:"interval_sec" json:"interval_sec" usage:"How quickly the matchmaker attempts to form matches, in seconds. Default 15."`
	MaxIntervals int `yaml:"max_intervals" json:"max_intervals" usage:"How many intervals the matchmaker attempts to find matches at the max player count, before allowing min count. Default 2."`
}
Loading