Loading Gopkg.lock +138 −1 Original line number Diff line number Diff line Loading @@ -12,17 +12,100 @@ revision = "4b98a6370e36d7a85192e7bad08a4ebd82eac2a8" version = "v0.20.0" [[projects]] name = "github.com/RoaringBitmap/roaring" packages = ["."] revision = "77b4f79fe76d21c3b5aa05d6971e6e5689d763d9" version = "v0.4.6" [[projects]] branch = "master" name = "github.com/Smerity/govarint" packages = ["."] revision = "7265e41f48f15fd61751e16da866af3c704bb3ab" [[projects]] branch = "master" name = "github.com/beorn7/perks" packages = ["quantile"] revision = "3a771d992973f24aa725d07868b467d1ddfceafb" [[projects]] name = "github.com/blevesearch/bleve" packages = [ ".", "analysis", "analysis/analyzer/standard", "analysis/datetime/flexible", "analysis/datetime/optional", "analysis/lang/en", "analysis/token/lowercase", "analysis/token/porter", "analysis/token/stop", "analysis/tokenizer/unicode", "document", "geo", "index", "index/scorch", "index/scorch/mergeplan", "index/scorch/segment", "index/scorch/segment/mem", "index/scorch/segment/zap", "index/store", "index/store/boltdb", "index/store/gtreap", "index/upsidedown", "mapping", "numeric", "registry", "search", "search/collector", "search/facet", "search/highlight", "search/highlight/format/html", "search/highlight/fragmenter/simple", "search/highlight/highlighter/html", "search/highlight/highlighter/simple", "search/query", "search/scorer", "search/searcher" ] revision = "1a319cdf5bf77dc8cee35a6b99f908792c2547ef" version = "v0.7.0" [[projects]] name = "github.com/blevesearch/go-porterstemmer" packages = ["."] revision = "b4dd94e38f29620fe0f97ae4b0f6994b0d5d75f0" version = "v1.0.1" [[projects]] branch = "master" name = "github.com/blevesearch/segment" packages = ["."] revision = "762005e7a34fd909a84586299f1dd457371d36ee" [[projects]] name = "github.com/boltdb/bolt" packages = ["."] revision = "2f1ce7a837dcb8da3ec595b1dac9d0632f0f99e8" version = "v1.3.1" [[projects]] name = "github.com/cockroachdb/cockroach-go" packages = ["crdb"] revision = "59c0560478b705bf9bd12f9252224a0fad7c87df" [[projects]] branch = "master" name = "github.com/couchbase/vellum" packages = [ ".", "regexp", "utf8" ] revision = "aae1f8c29833410f13233f68a021c938d6acd95f" [[projects]] name = "github.com/davecgh/go-spew" packages = ["spew"] Loading @@ -35,6 +118,18 @@ revision = "06ea1031745cb8b3dab3f6a236daf2b0aa468b7e" version = "v3.2.0" [[projects]] branch = "master" name = "github.com/edsrzf/mmap-go" packages = ["."] revision = "0bce6a6887123b67a60366d2c9fe2dfb74289d2e" [[projects]] branch = "master" name = "github.com/glycerine/go-unsnap-stream" packages = ["."] revision = "9f0cb55181dd3a0a4c168d3dbc72d4aca4853126" [[projects]] name = "github.com/go-yaml/yaml" packages = ["."] Loading Loading @@ -63,6 +158,12 @@ revision = "925541529c1fa6821df4e44ce2723319eb2be768" version = "v1.0.0" [[projects]] branch = "master" name = "github.com/golang/snappy" packages = ["."] revision = "553a641470496b2327abcac10b36396bd98e45c9" [[projects]] name = "github.com/googleapis/gax-go" packages = ["."] Loading Loading @@ -122,6 +223,18 @@ revision = "3247c84500bff8d9fb6d579d800f20b3e091582c" version = "v1.0.0" [[projects]] branch = "master" name = "github.com/mschoch/smat" packages = ["."] revision = "90eadee771aeab36e8bf796039b8c261bebebe4f" [[projects]] name = "github.com/philhofer/fwd" packages = ["."] revision = "bb6d471dc95d4fe11e432687f8b70ff496cf3136" version = "v1.0.0" [[projects]] name = "github.com/pkg/errors" packages = ["."] Loading Loading @@ -182,12 +295,30 @@ packages = ["."] revision = "36e9d2ebbde5e3f13ab2e25625fd453271d6522e" [[projects]] branch = "master" name = "github.com/steveyen/gtreap" packages = ["."] revision = "0abe01ef9be25c4aedc174758ec2d917314d6d70" [[projects]] name = "github.com/stretchr/testify" packages = ["assert"] revision = "12b6f73e6084dad08a7c6e575284b177ecafbc71" version = "v1.2.1" [[projects]] name = "github.com/tinylib/msgp" packages = ["msgp"] revision = "b2b6a672cf1e5b90748f79b8b81fc8c5cf0571a1" version = "1.0.2" [[projects]] name = "github.com/willf/bitset" packages = ["."] revision = "d860f346b89450988a379d7d705e83c58d1ea227" version = "v1.1.3" [[projects]] name = "github.com/yuin/gopher-lua" packages = [ Loading Loading @@ -285,6 +416,12 @@ packages = ["semaphore"] revision = "1d60e4601c6fd243af51cc01ddf169918a5407ca" [[projects]] branch = "master" name = "golang.org/x/sys" packages = ["unix"] revision = "79b0c6888797020a994db17c8510466c72fe75d9" [[projects]] name = "golang.org/x/text" packages = [ Loading Loading @@ -397,6 +534,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 inputs-digest = "2bfb07763f890649c350608b5262df72b50c5e2c8e8552d2d147d45b59c3e586" inputs-digest = "5a79210e8e95c30aba9a8e8d4b0b76c820bc5804aa2d0d7f461d2b3ca6280d37" solver-name = "gps-cdcl" solver-version = 1 Gopkg.toml +4 −0 Original line number Diff line number Diff line Loading @@ -65,3 +65,7 @@ [[constraint]] name = "github.com/cockroachdb/cockroach-go" revision = "59c0560478b705bf9bd12f9252224a0fad7c87df" [[constraint]] name = "github.com/blevesearch/bleve" version = "~0.7.0" data/modules/match_init.lua +47 −0 Original line number Diff line number Diff line Loading @@ -15,3 +15,50 @@ --]] --require("nakama").match_create("match", {debug = true}) local nk = require("nakama") --[[ Called when the matchmaker has found a match for some set of users. Context represents information about the match and server, for information purposes. Format: { env = {}, -- key-value data set in the runtime.env server configuration. execution_mode = "Matchmaker", } Matchmaker users will contain a table array of the users that have matched together and their properties. Format: { { presence: { user_id: "user unique ID", session_id: "session ID of the user's current connection", username: "user's unique username", node: "name of the Nakama node the user is connected to" }, properties: { foo: "any properties the client set when it started its matchmaking process", baz: 1.5 } }, ... } Expected to return an authoritative match ID for a match ready to receive these users, or `nil` if the match should proceed through the peer-to-peer relayed mode. --]] local function matchmaker_matched(context, matchmaker_users) if #matchmaker_users ~= 2 then return nil end if matchmaker_users[1].properties["mode"] ~= "authoritative" then return nil end if matchmaker_users[2].properties["mode"] ~= "authoritative" then return nil end return nk.match_create("match", {debug = true, expected_users = matchmaker_users}) end nk.register_matchmaker_matched(matchmaker_matched) main.go +3 −2 Original line number Diff line number Diff line Loading @@ -98,6 +98,7 @@ func main() { once := &sync.Once{} // Start up server components. matchmaker := server.NewLocalMatchmaker(multiLogger, config.GetName()) sessionRegistry := server.NewSessionRegistry() tracker := server.StartLocalTracker(jsonLogger, sessionRegistry, jsonpbMarshaler, config.GetName()) router := server.NewLocalMessageRouter(sessionRegistry, tracker, jsonpbMarshaler) Loading @@ -115,11 +116,11 @@ func main() { multiLogger.Fatal("Failed initializing runtime modules", zap.Error(err)) } runtimePool := server.NewRuntimePool(jsonLogger, multiLogger, db, config, socialClient, leaderboardCache, sessionRegistry, matchRegistry, tracker, router, stdLibs, modules, regCallbacks, once) pipeline := server.NewPipeline(config, db, jsonpbMarshaler, jsonpbUnmarshaler, sessionRegistry, matchRegistry, tracker, router, runtimePool) pipeline := server.NewPipeline(config, db, jsonpbMarshaler, jsonpbUnmarshaler, sessionRegistry, matchRegistry, matchmaker, tracker, router, runtimePool) metrics := server.NewMetrics(multiLogger, config) consoleServer := server.StartConsoleServer(jsonLogger, multiLogger, config, db) apiServer := server.StartApiServer(jsonLogger, multiLogger, db, jsonpbMarshaler, jsonpbUnmarshaler, config, socialClient, leaderboardCache, sessionRegistry, matchRegistry, tracker, router, pipeline, runtimePool) apiServer := server.StartApiServer(jsonLogger, multiLogger, db, jsonpbMarshaler, jsonpbUnmarshaler, config, socialClient, leaderboardCache, sessionRegistry, matchRegistry, matchmaker, tracker, router, pipeline, runtimePool) gaenabled := len(os.Getenv("NAKAMA_TELEMETRY")) < 1 cookie := newOrLoadCookie(config) Loading rtapi/realtime.pb.go +546 −122 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
Gopkg.lock +138 −1 Original line number Diff line number Diff line Loading @@ -12,17 +12,100 @@ revision = "4b98a6370e36d7a85192e7bad08a4ebd82eac2a8" version = "v0.20.0" [[projects]] name = "github.com/RoaringBitmap/roaring" packages = ["."] revision = "77b4f79fe76d21c3b5aa05d6971e6e5689d763d9" version = "v0.4.6" [[projects]] branch = "master" name = "github.com/Smerity/govarint" packages = ["."] revision = "7265e41f48f15fd61751e16da866af3c704bb3ab" [[projects]] branch = "master" name = "github.com/beorn7/perks" packages = ["quantile"] revision = "3a771d992973f24aa725d07868b467d1ddfceafb" [[projects]] name = "github.com/blevesearch/bleve" packages = [ ".", "analysis", "analysis/analyzer/standard", "analysis/datetime/flexible", "analysis/datetime/optional", "analysis/lang/en", "analysis/token/lowercase", "analysis/token/porter", "analysis/token/stop", "analysis/tokenizer/unicode", "document", "geo", "index", "index/scorch", "index/scorch/mergeplan", "index/scorch/segment", "index/scorch/segment/mem", "index/scorch/segment/zap", "index/store", "index/store/boltdb", "index/store/gtreap", "index/upsidedown", "mapping", "numeric", "registry", "search", "search/collector", "search/facet", "search/highlight", "search/highlight/format/html", "search/highlight/fragmenter/simple", "search/highlight/highlighter/html", "search/highlight/highlighter/simple", "search/query", "search/scorer", "search/searcher" ] revision = "1a319cdf5bf77dc8cee35a6b99f908792c2547ef" version = "v0.7.0" [[projects]] name = "github.com/blevesearch/go-porterstemmer" packages = ["."] revision = "b4dd94e38f29620fe0f97ae4b0f6994b0d5d75f0" version = "v1.0.1" [[projects]] branch = "master" name = "github.com/blevesearch/segment" packages = ["."] revision = "762005e7a34fd909a84586299f1dd457371d36ee" [[projects]] name = "github.com/boltdb/bolt" packages = ["."] revision = "2f1ce7a837dcb8da3ec595b1dac9d0632f0f99e8" version = "v1.3.1" [[projects]] name = "github.com/cockroachdb/cockroach-go" packages = ["crdb"] revision = "59c0560478b705bf9bd12f9252224a0fad7c87df" [[projects]] branch = "master" name = "github.com/couchbase/vellum" packages = [ ".", "regexp", "utf8" ] revision = "aae1f8c29833410f13233f68a021c938d6acd95f" [[projects]] name = "github.com/davecgh/go-spew" packages = ["spew"] Loading @@ -35,6 +118,18 @@ revision = "06ea1031745cb8b3dab3f6a236daf2b0aa468b7e" version = "v3.2.0" [[projects]] branch = "master" name = "github.com/edsrzf/mmap-go" packages = ["."] revision = "0bce6a6887123b67a60366d2c9fe2dfb74289d2e" [[projects]] branch = "master" name = "github.com/glycerine/go-unsnap-stream" packages = ["."] revision = "9f0cb55181dd3a0a4c168d3dbc72d4aca4853126" [[projects]] name = "github.com/go-yaml/yaml" packages = ["."] Loading Loading @@ -63,6 +158,12 @@ revision = "925541529c1fa6821df4e44ce2723319eb2be768" version = "v1.0.0" [[projects]] branch = "master" name = "github.com/golang/snappy" packages = ["."] revision = "553a641470496b2327abcac10b36396bd98e45c9" [[projects]] name = "github.com/googleapis/gax-go" packages = ["."] Loading Loading @@ -122,6 +223,18 @@ revision = "3247c84500bff8d9fb6d579d800f20b3e091582c" version = "v1.0.0" [[projects]] branch = "master" name = "github.com/mschoch/smat" packages = ["."] revision = "90eadee771aeab36e8bf796039b8c261bebebe4f" [[projects]] name = "github.com/philhofer/fwd" packages = ["."] revision = "bb6d471dc95d4fe11e432687f8b70ff496cf3136" version = "v1.0.0" [[projects]] name = "github.com/pkg/errors" packages = ["."] Loading Loading @@ -182,12 +295,30 @@ packages = ["."] revision = "36e9d2ebbde5e3f13ab2e25625fd453271d6522e" [[projects]] branch = "master" name = "github.com/steveyen/gtreap" packages = ["."] revision = "0abe01ef9be25c4aedc174758ec2d917314d6d70" [[projects]] name = "github.com/stretchr/testify" packages = ["assert"] revision = "12b6f73e6084dad08a7c6e575284b177ecafbc71" version = "v1.2.1" [[projects]] name = "github.com/tinylib/msgp" packages = ["msgp"] revision = "b2b6a672cf1e5b90748f79b8b81fc8c5cf0571a1" version = "1.0.2" [[projects]] name = "github.com/willf/bitset" packages = ["."] revision = "d860f346b89450988a379d7d705e83c58d1ea227" version = "v1.1.3" [[projects]] name = "github.com/yuin/gopher-lua" packages = [ Loading Loading @@ -285,6 +416,12 @@ packages = ["semaphore"] revision = "1d60e4601c6fd243af51cc01ddf169918a5407ca" [[projects]] branch = "master" name = "golang.org/x/sys" packages = ["unix"] revision = "79b0c6888797020a994db17c8510466c72fe75d9" [[projects]] name = "golang.org/x/text" packages = [ Loading Loading @@ -397,6 +534,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 inputs-digest = "2bfb07763f890649c350608b5262df72b50c5e2c8e8552d2d147d45b59c3e586" inputs-digest = "5a79210e8e95c30aba9a8e8d4b0b76c820bc5804aa2d0d7f461d2b3ca6280d37" solver-name = "gps-cdcl" solver-version = 1
Gopkg.toml +4 −0 Original line number Diff line number Diff line Loading @@ -65,3 +65,7 @@ [[constraint]] name = "github.com/cockroachdb/cockroach-go" revision = "59c0560478b705bf9bd12f9252224a0fad7c87df" [[constraint]] name = "github.com/blevesearch/bleve" version = "~0.7.0"
data/modules/match_init.lua +47 −0 Original line number Diff line number Diff line Loading @@ -15,3 +15,50 @@ --]] --require("nakama").match_create("match", {debug = true}) local nk = require("nakama") --[[ Called when the matchmaker has found a match for some set of users. Context represents information about the match and server, for information purposes. Format: { env = {}, -- key-value data set in the runtime.env server configuration. execution_mode = "Matchmaker", } Matchmaker users will contain a table array of the users that have matched together and their properties. Format: { { presence: { user_id: "user unique ID", session_id: "session ID of the user's current connection", username: "user's unique username", node: "name of the Nakama node the user is connected to" }, properties: { foo: "any properties the client set when it started its matchmaking process", baz: 1.5 } }, ... } Expected to return an authoritative match ID for a match ready to receive these users, or `nil` if the match should proceed through the peer-to-peer relayed mode. --]] local function matchmaker_matched(context, matchmaker_users) if #matchmaker_users ~= 2 then return nil end if matchmaker_users[1].properties["mode"] ~= "authoritative" then return nil end if matchmaker_users[2].properties["mode"] ~= "authoritative" then return nil end return nk.match_create("match", {debug = true, expected_users = matchmaker_users}) end nk.register_matchmaker_matched(matchmaker_matched)
main.go +3 −2 Original line number Diff line number Diff line Loading @@ -98,6 +98,7 @@ func main() { once := &sync.Once{} // Start up server components. matchmaker := server.NewLocalMatchmaker(multiLogger, config.GetName()) sessionRegistry := server.NewSessionRegistry() tracker := server.StartLocalTracker(jsonLogger, sessionRegistry, jsonpbMarshaler, config.GetName()) router := server.NewLocalMessageRouter(sessionRegistry, tracker, jsonpbMarshaler) Loading @@ -115,11 +116,11 @@ func main() { multiLogger.Fatal("Failed initializing runtime modules", zap.Error(err)) } runtimePool := server.NewRuntimePool(jsonLogger, multiLogger, db, config, socialClient, leaderboardCache, sessionRegistry, matchRegistry, tracker, router, stdLibs, modules, regCallbacks, once) pipeline := server.NewPipeline(config, db, jsonpbMarshaler, jsonpbUnmarshaler, sessionRegistry, matchRegistry, tracker, router, runtimePool) pipeline := server.NewPipeline(config, db, jsonpbMarshaler, jsonpbUnmarshaler, sessionRegistry, matchRegistry, matchmaker, tracker, router, runtimePool) metrics := server.NewMetrics(multiLogger, config) consoleServer := server.StartConsoleServer(jsonLogger, multiLogger, config, db) apiServer := server.StartApiServer(jsonLogger, multiLogger, db, jsonpbMarshaler, jsonpbUnmarshaler, config, socialClient, leaderboardCache, sessionRegistry, matchRegistry, tracker, router, pipeline, runtimePool) apiServer := server.StartApiServer(jsonLogger, multiLogger, db, jsonpbMarshaler, jsonpbUnmarshaler, config, socialClient, leaderboardCache, sessionRegistry, matchRegistry, matchmaker, tracker, router, pipeline, runtimePool) gaenabled := len(os.Getenv("NAKAMA_TELEMETRY")) < 1 cookie := newOrLoadCookie(config) Loading
rtapi/realtime.pb.go +546 −122 File changed.Preview size limit exceeded, changes collapsed. Show changes