diff --git a/server/api_test.go b/server/api_test.go index f84d70fff5a98d9d1e72b61cc392c7ea2ab25649..7373499f5ef281a8946ac60173e7dcc40be212ae 100644 --- a/server/api_test.go +++ b/server/api_test.go @@ -24,6 +24,7 @@ import ( "github.com/golang/protobuf/jsonpb" "github.com/heroiclabs/nakama-common/api" "github.com/heroiclabs/nakama-common/rtapi" + "github.com/heroiclabs/nakama-common/runtime" "github.com/heroiclabs/nakama/v3/apigrpc" _ "github.com/jackc/pgx/stdlib" "go.uber.org/zap" @@ -108,7 +109,7 @@ func (d *DummySession) SendBytes(payload []byte, reliable bool) error { return nil } -func (d *DummySession) Close(reason string) {} +func (d *DummySession) Close(msg string, reason runtime.PresenceReason) {} type loggerEnabler struct{} @@ -167,7 +168,7 @@ func NewAPIServer(t *testing.T, runtime *Runtime) (*ApiServer, *Pipeline) { router := &DummyMessageRouter{} tracker := &LocalTracker{} pipeline := NewPipeline(logger, cfg, db, jsonpbMarshaler, jsonpbUnmarshaler, nil, nil, nil, nil, nil, tracker, router, runtime) - apiServer := StartApiServer(logger, logger, db, jsonpbMarshaler, jsonpbUnmarshaler, cfg, nil, nil, nil, nil, nil, nil, nil, tracker, router, metrics, pipeline, runtime) + apiServer := StartApiServer(logger, logger, db, jsonpbMarshaler, jsonpbUnmarshaler, cfg, nil, nil, nil, nil, nil, nil, nil, nil, tracker, router, metrics, pipeline, runtime) return apiServer, pipeline } diff --git a/server/core_wallet_test.go b/server/core_wallet_test.go index 9a4a537ee6e4252275e0ae702d8be1f25a80ba1f..e65dd74f291d55eda3640f3964217c58c01b6589 100644 --- a/server/core_wallet_test.go +++ b/server/core_wallet_test.go @@ -70,7 +70,7 @@ func TestUpdateWalletSingleUser(t *testing.T) { } db := NewDB(t) - nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil) + nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil) userID, _, _, err := AuthenticateCustom(context.Background(), logger, db, uuid.Must(uuid.NewV4()).String(), uuid.Must(uuid.NewV4()).String(), true) if err != nil { @@ -148,7 +148,7 @@ func TestUpdateWalletMultiUser(t *testing.T) { } db := NewDB(t) - nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil) + nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil) count := 5 userIDs := make([]string, 0, count) @@ -235,7 +235,7 @@ func TestUpdateWalletsMultiUser(t *testing.T) { } db := NewDB(t) - nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil) + nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil) count := 5 userIDs := make([]string, 0, count) @@ -327,7 +327,7 @@ func TestUpdateWalletsMultiUserSharedChangeset(t *testing.T) { } db := NewDB(t) - nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil) + nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil) count := 5 userIDs := make([]string, 0, count) @@ -423,7 +423,7 @@ func TestUpdateWalletsMultiUserSharedChangesetDeductions(t *testing.T) { } db := NewDB(t) - nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil) + nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil) count := 5 userIDs := make([]string, 0, count) @@ -478,7 +478,7 @@ func TestUpdateWalletsMultiUserSharedChangesetDeductions(t *testing.T) { func TestUpdateWalletsSingleUser(t *testing.T) { db := NewDB(t) - nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil) + nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil) userID, _, _, err := AuthenticateCustom(context.Background(), logger, db, uuid.Must(uuid.NewV4()).String(), uuid.Must(uuid.NewV4()).String(), true) if err != nil { @@ -525,7 +525,7 @@ func TestUpdateWalletsSingleUser(t *testing.T) { func TestUpdateWalletRepeatedSingleUser(t *testing.T) { db := NewDB(t) - nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil) + nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil) userID, _, _, err := AuthenticateCustom(context.Background(), logger, db, uuid.Must(uuid.NewV4()).String(), uuid.Must(uuid.NewV4()).String(), true) if err != nil { diff --git a/server/runtime_test.go b/server/runtime_test.go index 8cfd66110ab9e6cd700dbc8ebd7fe9353b257062..dac77f24c6170969023a5a0c3163e8c68f26872a 100644 --- a/server/runtime_test.go +++ b/server/runtime_test.go @@ -77,7 +77,7 @@ func runtimeWithModules(t *testing.T, modules map[string]string) (*Runtime, *Run cfg := NewConfig(logger) cfg.Runtime.Path = dir - return NewRuntime(logger, logger, NewDB(t), jsonpbMarshaler, jsonpbUnmarshaler, cfg, nil, nil, nil, nil, nil, nil, nil, metrics, nil, &DummyMessageRouter{}) + return NewRuntime(logger, logger, NewDB(t), jsonpbMarshaler, jsonpbUnmarshaler, cfg, nil, nil, nil, nil, nil, nil, nil, nil, metrics, nil, &DummyMessageRouter{}) } func TestRuntimeSampleScript(t *testing.T) { @@ -355,7 +355,7 @@ nakama.register_rpc(test.printWorld, "helloworld")`, db := NewDB(t) pipeline := NewPipeline(logger, cfg, db, jsonpbMarshaler, jsonpbUnmarshaler, nil, nil, nil, nil, nil, nil, nil, runtime) - apiServer := StartApiServer(logger, logger, db, jsonpbMarshaler, jsonpbUnmarshaler, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil, metrics, pipeline, runtime) + apiServer := StartApiServer(logger, logger, db, jsonpbMarshaler, jsonpbUnmarshaler, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, metrics, pipeline, runtime) defer apiServer.Stop() payload := "\"Hello World\"" diff --git a/social/social.go b/social/social.go index baaabc5944a70ce8b78672eef9084c52e2b90902..707a6b461fd8157e87cb02d4c3bb2fe88ce056b2 100644 --- a/social/social.go +++ b/social/social.go @@ -66,14 +66,14 @@ type JwksCerts struct { // JWK certificate data for an Apple Sign In verification key. type JwksCert struct { + key *rsa.PublicKey + Kty string `json:"kty"` Kid string `json:"kid"` Use string `json:"use"` Alg string `json:"alg"` N string `json:"n"` E string `json:"e"` - - key *rsa.PublicKey } // AppleProfile is an abbreviated version of a user authenticated through Apple Sign In. @@ -103,8 +103,8 @@ type facebookPaging struct { } type facebookFriends struct { - Data []FacebookProfile `json:"data"` Paging facebookPaging `json:"paging"` + Data []FacebookProfile `json:"data"` } // GoogleProfile is an abbreviated version of a Google profile extracted from in a verified ID token. @@ -141,8 +141,8 @@ type steamFriendsWrapper struct { // SteamError contains a possible error response from the Steam Web API. type SteamError struct { - ErrorCode int `json:"errorcode"` ErrorDesc string `json:"errordesc"` + ErrorCode int `json:"errorcode"` } // Unwrapping the SteamProfile @@ -276,9 +276,9 @@ func (c *Client) ExtractFacebookInstantGameID(signedPlayerInfo string, appSecret var payload struct { Algorithm string `json:"algorithm"` - IssuedAt int `json:"issued_at"` PlayerID string `json:"player_id"` RequestPayload string `json:"request_payload"` // discarded + IssuedAt int `json:"issued_at"` } err = json.Unmarshal(payloadRaw, &payload) if err != nil {