Skip to content

Commit

Permalink
Rebase changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sesposito committed Nov 28, 2023
1 parent 574904a commit 76bda02
Show file tree
Hide file tree
Showing 144 changed files with 2,861 additions and 18,143 deletions.
26 changes: 7 additions & 19 deletions go.mod
Expand Up @@ -3,28 +3,21 @@ module github.com/heroiclabs/nakama/v3
go 1.21

require (
github.com/bits-and-blooms/bitset v1.5.0
github.com/blugelabs/bluge v0.2.2
github.com/blugelabs/bluge_segment_api v0.2.0
github.com/blugelabs/query_string v0.3.0
github.com/dop251/goja v0.0.0-20231014103939-873a1496dc8e
github.com/go-gorp/gorp/v3 v3.1.0
github.com/gofrs/uuid/v5 v5.0.0
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/golang/snappy v0.0.4
github.com/gorilla/handlers v1.5.1
github.com/gorilla/mux v1.8.0
github.com/gorilla/websocket v1.5.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0
github.com/heroiclabs/nakama-common v1.30.0
github.com/jackc/pgconn v1.14.0
github.com/heroiclabs/sql-migrate v0.0.0-20230615133120-fb3ad977aaaf
github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa
github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59
github.com/jackc/pgx/v5 v5.4.3
github.com/prometheus/client_golang v1.16.0
github.com/jackc/pgx/v5 v5.5.0
github.com/stretchr/testify v1.8.4
github.com/twmb/murmur3 v1.1.8
github.com/uber-go/tally/v4 v4.1.7
go.uber.org/atomic v1.11.0
go.uber.org/zap v1.24.0
Expand All @@ -44,6 +37,7 @@ require (
github.com/RoaringBitmap/roaring v0.9.4 // indirect
github.com/axiomhq/hyperloglog v0.0.0-20191112132149-a4c4c47bc57f // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.5.0 // indirect
github.com/blevesearch/go-porterstemmer v1.0.3 // indirect
github.com/blevesearch/mmap-go v1.0.4 // indirect
github.com/blevesearch/segment v0.9.0 // indirect
Expand All @@ -58,34 +52,28 @@ require (
github.com/dlclark/regexp2 v1.7.0 // indirect
github.com/felixge/httpsnoop v1.0.1 // indirect
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/gofrs/uuid v4.3.0+incompatible // indirect
github.com/golang/glog v1.1.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
<<<<<<< HEAD
github.com/golang/snappy v0.0.4 // indirect
github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
=======
github.com/jackc/pgconn v1.14.0 // indirect
>>>>>>> bf0c798f (Upgrade pgx to v5)
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.2 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/klauspost/compress v1.15.2 // indirect
github.com/lib/pq v1.10.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mschoch/smat v0.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/rogpeppe/go-internal v1.8.0 // indirect
github.com/twmb/murmur3 v1.1.8 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/sync v0.2.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
Expand Down
237 changes: 8 additions & 229 deletions go.sum

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions main.go
Expand Up @@ -39,12 +39,6 @@ import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"google.golang.org/protobuf/encoding/protojson"

_ "github.com/bits-and-blooms/bitset"
_ "github.com/go-gorp/gorp/v3"
_ "github.com/golang/snappy"
_ "github.com/prometheus/client_golang/prometheus"
_ "github.com/twmb/murmur3"
)

const cookieFilename = ".cookie"
Expand Down Expand Up @@ -96,9 +90,10 @@ func main() {

return nil
}); err != nil {
conn.Close()
tmpLogger.Fatal("Failed to acquire pgx conn for migration", zap.Error(err))
}

conn.Close()
return
case "check":
// Parse any command line args to look up runtime path.
Expand Down
13 changes: 5 additions & 8 deletions server/config.go
Expand Up @@ -280,17 +280,14 @@ func (c *config) Validate(logger *zap.Logger) map[string]string {
if c.GetMatchmaker().MaxIntervals < 1 {
logger.Fatal("Matchmaker max intervals must be >= 1", zap.Int("matchmaker.max_intervals", c.GetMatchmaker().MaxIntervals))
}
if c.GetMatchmaker().BatchPoolSize < 1 {
logger.Fatal("Matchmaker batch pool size must be >= 1", zap.Int("matchmaker.batch_pool_size", c.GetMatchmaker().BatchPoolSize))
}
if c.GetMatchmaker().RevThreshold < 0 {
logger.Fatal("Matchmaker reverse matching threshold must be >= 0", zap.Int("matchmaker.rev_threshold", c.GetMatchmaker().RevThreshold))
}
if config.GetMatchmaker().MaxIntervals < 1 {
logger.Fatal("Matchmaker max intervals must be >= 1", zap.Int("matchmaker.max_intervals", config.GetMatchmaker().MaxIntervals))
if c.GetMatchmaker().MaxIntervals < 1 {
logger.Fatal("Matchmaker max intervals must be >= 1", zap.Int("matchmaker.max_intervals", c.GetMatchmaker().MaxIntervals))
}
if config.GetMatchmaker().RevThreshold < 0 {
logger.Fatal("Matchmaker reverse matching threshold must be >= 0", zap.Int("matchmaker.rev_threshold", config.GetMatchmaker().RevThreshold))
if c.GetMatchmaker().RevThreshold < 0 {
logger.Fatal("Matchmaker reverse matching threshold must be >= 0", zap.Int("matchmaker.rev_threshold", c.GetMatchmaker().RevThreshold))
}
if c.Limit != -1 {
logger.Warn("WARNING: 'limit' is only valid if used with the migrate command", zap.String("param", "limit"))
Expand Down Expand Up @@ -368,7 +365,7 @@ func (c *config) Validate(logger *zap.Logger) map[string]string {
logger.Warn("WARNING: deprecated configuration parameter", zap.String("deprecated", "runtime.registry_size"), zap.String("param", "runtime.lua_registry_size"))
configWarnings["runtime.registry_size"] = "Deprecated configuration parameter"
}
if !config.GetRuntime().ReadOnlyGlobals {
if !c.GetRuntime().ReadOnlyGlobals {
logger.Warn("WARNING: deprecated configuration parameter", zap.String("deprecated", "runtime.read_only_globals"), zap.String("param", "runtime.lua_read_only_globals"))
configWarnings["runtime.read_only_globals"] = "Deprecated configuration parameter"
}
Expand Down
22 changes: 12 additions & 10 deletions server/core_notification.go
Expand Up @@ -70,20 +70,22 @@ func NotificationSend(ctx context.Context, logger *zap.Logger, db *sql.DB, messa
}

// Deliver live notifications to connected users.
for userID, ns := range notifications {
messageRouter.SendToStream(logger, PresenceStream{Mode: StreamModeNotifications, Subject: userID}, &rtapi.Envelope{
Message: &rtapi.Envelope_Notifications{
Notifications: &rtapi.Notifications{
Notifications: ns,
go func() {
for userID, ns := range notifications {
messageRouter.SendToStream(logger, PresenceStream{Mode: StreamModeNotifications, Subject: userID}, &rtapi.Envelope{
Message: &rtapi.Envelope_Notifications{
Notifications: &rtapi.Notifications{
Notifications: ns,
},
},
},
}, true)
}
}, true)
}
}()

return nil
}

func NotificationSendAll(ctx context.Context, logger *zap.Logger, db *sql.DB, tracker Tracker, messageRouter MessageRouter, notification *api.Notification) error {
func NotificationSendAll(ctx context.Context, logger *zap.Logger, db *sql.DB, gotracker Tracker, messageRouter MessageRouter, notification *api.Notification) error {
// Non-persistent notifications don't need to work through all database users, just use currently connected notification streams.
if !notification.Persistent {
env := &rtapi.Envelope{
Expand Down Expand Up @@ -194,7 +196,7 @@ func NotificationList(ctx context.Context, logger *zap.Logger, db *sql.DB, userI
cursorQuery := " "
if nc != nil && nc.NotificationID != nil {
cursorQuery = " AND (user_id, create_time, id) > ($1::UUID, $3::TIMESTAMPTZ, $4::UUID)"
params = append(params, time.Unix(0, nc.CreateTime).UTC(), uuid.FromBytesOrNil(nc.NotificationID))
params = append(params, &pgtype.Timestamptz{Time: time.Unix(0, nc.CreateTime).UTC(), Valid: true}, uuid.FromBytesOrNil(nc.NotificationID))
}

rows, err := db.QueryContext(ctx, `
Expand Down
9 changes: 0 additions & 9 deletions vendor/github.com/jackc/pgio/.travis.yml

This file was deleted.

11 changes: 0 additions & 11 deletions vendor/github.com/jackc/pgio/README.md

This file was deleted.

6 changes: 0 additions & 6 deletions vendor/github.com/jackc/pgio/doc.go

This file was deleted.

40 changes: 0 additions & 40 deletions vendor/github.com/jackc/pgio/write.go

This file was deleted.

127 changes: 0 additions & 127 deletions vendor/github.com/jackc/pgtype/aclitem.go

This file was deleted.

0 comments on commit 76bda02

Please sign in to comment.