From d53a19e0428aef4cb2eba1a8cf7a2cf7a51655f1 Mon Sep 17 00:00:00 2001 From: Caleb Foust Date: Wed, 30 Oct 2024 19:13:18 +0800 Subject: [PATCH] feat: get server building again --- cmd/cs/main.go | 2 +- cmd/demo/main.go | 2 +- cmd/server/auth/module.go | 6 +++--- cmd/server/ingress/enet.go | 2 +- cmd/server/ingress/module.go | 2 +- cmd/server/ingress/ws.go | 8 ++++---- cmd/server/main.go | 10 +++++----- cmd/server/servers/module.go | 4 ++-- cmd/server/service/auth.go | 4 ++-- cmd/server/service/commands.go | 6 +++--- cmd/server/service/cs.go | 4 ++-- cmd/server/service/elo.go | 4 ++-- cmd/server/service/events.go | 4 ++-- cmd/server/service/matchmaking.go | 6 +++--- cmd/server/service/module.go | 10 +++++----- cmd/server/service/users.go | 10 +++++----- cmd/server/state/module.go | 2 +- cmd/server/stores/module.go | 6 +++--- cmd/server/verse/editing.go | 2 +- cmd/server/verse/module.go | 4 ++-- cmd/server/verse/spaces.go | 6 +++--- cmd/server/watcher/module.go | 4 ++-- 22 files changed, 54 insertions(+), 54 deletions(-) diff --git a/cmd/cs/main.go b/cmd/cs/main.go index 6921ba050..9e62cde6e 100644 --- a/cmd/cs/main.go +++ b/cmd/cs/main.go @@ -1,8 +1,8 @@ package main import ( - "log" "github.com/cfoust/sour/pkg/cs" + "log" ) func Test(a int) { diff --git a/cmd/demo/main.go b/cmd/demo/main.go index 98e1cc29f..dd3377748 100644 --- a/cmd/demo/main.go +++ b/cmd/demo/main.go @@ -4,8 +4,8 @@ import ( "compress/gzip" "flag" "io" - "os" "log" + "os" "time" I "github.com/cfoust/sour/pkg/game/io" diff --git a/cmd/server/auth/module.go b/cmd/server/auth/module.go index a8824f1d4..29ea10ecd 100644 --- a/cmd/server/auth/module.go +++ b/cmd/server/auth/module.go @@ -14,9 +14,9 @@ import ( "time" "unsafe" - "github.com/cfoust/sour/svc/server/auth/crypto" - "github.com/cfoust/sour/svc/server/config" - "github.com/cfoust/sour/svc/server/state" + "github.com/cfoust/sour/cmd/server/auth/crypto" + "github.com/cfoust/sour/cmd/server/config" + "github.com/cfoust/sour/cmd/server/state" "gorm.io/gorm" ) diff --git a/cmd/server/ingress/enet.go b/cmd/server/ingress/enet.go index 288efa313..4321c8cd2 100644 --- a/cmd/server/ingress/enet.go +++ b/cmd/server/ingress/enet.go @@ -6,10 +6,10 @@ import ( "sync" "time" + "github.com/cfoust/sour/cmd/server/state" "github.com/cfoust/sour/pkg/enet" "github.com/cfoust/sour/pkg/game/io" "github.com/cfoust/sour/pkg/utils" - "github.com/cfoust/sour/svc/server/state" ) type PacketACK struct { diff --git a/cmd/server/ingress/module.go b/cmd/server/ingress/module.go index 074d28de5..f94122aac 100644 --- a/cmd/server/ingress/module.go +++ b/cmd/server/ingress/module.go @@ -1,9 +1,9 @@ package ingress import ( + "github.com/cfoust/sour/cmd/server/state" "github.com/cfoust/sour/pkg/game/io" "github.com/cfoust/sour/pkg/utils" - "github.com/cfoust/sour/svc/server/state" ) // A unique identifier for this client for the lifetime of their session. diff --git a/cmd/server/ingress/ws.go b/cmd/server/ingress/ws.go index 3efb1528c..acfb227ee 100644 --- a/cmd/server/ingress/ws.go +++ b/cmd/server/ingress/ws.go @@ -8,16 +8,16 @@ import ( "sync" "time" + "github.com/cfoust/sour/cmd/server/auth" + "github.com/cfoust/sour/cmd/server/state" + "github.com/cfoust/sour/cmd/server/watcher" "github.com/cfoust/sour/pkg/game/io" "github.com/cfoust/sour/pkg/utils" - "github.com/cfoust/sour/svc/server/auth" - "github.com/cfoust/sour/svc/server/state" - "github.com/cfoust/sour/svc/server/watcher" "github.com/fxamacker/cbor/v2" "github.com/mileusna/useragent" - "nhooyr.io/websocket" "github.com/rs/zerolog/log" + "nhooyr.io/websocket" ) const ( diff --git a/cmd/server/main.go b/cmd/server/main.go index 358141c09..cc9f60663 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -9,12 +9,12 @@ import ( "os/signal" "time" + "github.com/cfoust/sour/cmd/server/config" + "github.com/cfoust/sour/cmd/server/ingress" + "github.com/cfoust/sour/cmd/server/servers" + "github.com/cfoust/sour/cmd/server/service" + "github.com/cfoust/sour/cmd/server/static" "github.com/cfoust/sour/pkg/assets" - "github.com/cfoust/sour/svc/server/config" - "github.com/cfoust/sour/svc/server/ingress" - "github.com/cfoust/sour/svc/server/servers" - "github.com/cfoust/sour/svc/server/service" - "github.com/cfoust/sour/svc/server/static" "github.com/rs/zerolog" "github.com/rs/zerolog/log" diff --git a/cmd/server/servers/module.go b/cmd/server/servers/module.go index 00d997be6..ed046ff52 100644 --- a/cmd/server/servers/module.go +++ b/cmd/server/servers/module.go @@ -11,13 +11,13 @@ import ( "sync" "time" + "github.com/cfoust/sour/cmd/server/config" + "github.com/cfoust/sour/cmd/server/ingress" "github.com/cfoust/sour/pkg/assets" C "github.com/cfoust/sour/pkg/game/constants" P "github.com/cfoust/sour/pkg/game/protocol" "github.com/cfoust/sour/pkg/maps" "github.com/cfoust/sour/pkg/server" - "github.com/cfoust/sour/svc/server/config" - "github.com/cfoust/sour/svc/server/ingress" "github.com/repeale/fp-go" "github.com/repeale/fp-go/option" diff --git a/cmd/server/service/auth.go b/cmd/server/service/auth.go index 86fc38639..cc6b6ae86 100644 --- a/cmd/server/service/auth.go +++ b/cmd/server/service/auth.go @@ -5,10 +5,10 @@ import ( "fmt" "time" + "github.com/cfoust/sour/cmd/server/auth" + "github.com/cfoust/sour/cmd/server/state" "github.com/cfoust/sour/pkg/game" P "github.com/cfoust/sour/pkg/game/protocol" - "github.com/cfoust/sour/svc/server/auth" - "github.com/cfoust/sour/svc/server/state" ) func (c *Cluster) DoAuthChallenge(ctx context.Context, user *User, id string) (*state.User, error) { diff --git a/cmd/server/service/commands.go b/cmd/server/service/commands.go index 514c63522..3a2e40f2f 100644 --- a/cmd/server/service/commands.go +++ b/cmd/server/service/commands.go @@ -7,13 +7,13 @@ import ( "strings" "time" + "github.com/cfoust/sour/cmd/server/ingress" + "github.com/cfoust/sour/cmd/server/servers" + "github.com/cfoust/sour/cmd/server/verse" "github.com/cfoust/sour/pkg/game" "github.com/cfoust/sour/pkg/game/commands" "github.com/cfoust/sour/pkg/game/constants" "github.com/cfoust/sour/pkg/server/protocol/gamemode" - "github.com/cfoust/sour/svc/server/ingress" - "github.com/cfoust/sour/svc/server/servers" - "github.com/cfoust/sour/svc/server/verse" "github.com/repeale/fp-go/option" "github.com/rs/zerolog/log" diff --git a/cmd/server/service/cs.go b/cmd/server/service/cs.go index f6de7f233..5dc937e43 100644 --- a/cmd/server/service/cs.go +++ b/cmd/server/service/cs.go @@ -7,9 +7,9 @@ import ( "time" "github.com/cfoust/sour/pkg/game" - "github.com/cfoust/sour/pkg/utils" C "github.com/cfoust/sour/pkg/game/constants" P "github.com/cfoust/sour/pkg/game/protocol" + "github.com/cfoust/sour/pkg/utils" ) //go:embed purgatory.ogz @@ -25,7 +25,7 @@ func sendServerInfo(ctx context.Context, u *User, domain string) (P.Connect, err info, ) if err != nil { - return P.Connect{}, err + return P.Connect{}, err } connect := msg.(P.Connect) diff --git a/cmd/server/service/elo.go b/cmd/server/service/elo.go index 3c97d77f0..785f78bf0 100644 --- a/cmd/server/service/elo.go +++ b/cmd/server/service/elo.go @@ -4,8 +4,8 @@ import ( "context" "sync" - "github.com/cfoust/sour/svc/server/config" - "github.com/cfoust/sour/svc/server/state" + "github.com/cfoust/sour/cmd/server/config" + "github.com/cfoust/sour/cmd/server/state" "gorm.io/gorm" ) diff --git a/cmd/server/service/events.go b/cmd/server/service/events.go index 40d81cf09..e91fc9f47 100644 --- a/cmd/server/service/events.go +++ b/cmd/server/service/events.go @@ -6,14 +6,14 @@ import ( "strings" "time" + "github.com/cfoust/sour/cmd/server/ingress" + "github.com/cfoust/sour/cmd/server/servers" "github.com/cfoust/sour/pkg/chanlock" "github.com/cfoust/sour/pkg/game" "github.com/cfoust/sour/pkg/game/constants" "github.com/cfoust/sour/pkg/game/io" P "github.com/cfoust/sour/pkg/game/protocol" S "github.com/cfoust/sour/pkg/server" - "github.com/cfoust/sour/svc/server/ingress" - "github.com/cfoust/sour/svc/server/servers" "github.com/rs/zerolog/log" ) diff --git a/cmd/server/service/matchmaking.go b/cmd/server/service/matchmaking.go index 1892c423e..36258cecf 100644 --- a/cmd/server/service/matchmaking.go +++ b/cmd/server/service/matchmaking.go @@ -6,12 +6,12 @@ import ( "sync" "time" + "github.com/cfoust/sour/cmd/server/config" + "github.com/cfoust/sour/cmd/server/ingress" + "github.com/cfoust/sour/cmd/server/servers" "github.com/cfoust/sour/pkg/game" P "github.com/cfoust/sour/pkg/game/protocol" "github.com/cfoust/sour/pkg/mmr" - "github.com/cfoust/sour/svc/server/config" - "github.com/cfoust/sour/svc/server/ingress" - "github.com/cfoust/sour/svc/server/servers" "github.com/repeale/fp-go/option" "github.com/rs/zerolog" diff --git a/cmd/server/service/module.go b/cmd/server/service/module.go index e331c625e..c3d5149c0 100644 --- a/cmd/server/service/module.go +++ b/cmd/server/service/module.go @@ -5,16 +5,16 @@ import ( "sync" "time" + "github.com/cfoust/sour/cmd/server/auth" + "github.com/cfoust/sour/cmd/server/config" + "github.com/cfoust/sour/cmd/server/ingress" + "github.com/cfoust/sour/cmd/server/servers" + "github.com/cfoust/sour/cmd/server/verse" "github.com/cfoust/sour/pkg/assets" "github.com/cfoust/sour/pkg/chanlock" "github.com/cfoust/sour/pkg/game" "github.com/cfoust/sour/pkg/game/commands" P "github.com/cfoust/sour/pkg/game/protocol" - "github.com/cfoust/sour/svc/server/auth" - "github.com/cfoust/sour/svc/server/config" - "github.com/cfoust/sour/svc/server/ingress" - "github.com/cfoust/sour/svc/server/servers" - "github.com/cfoust/sour/svc/server/verse" "github.com/go-redis/redis/v9" "github.com/rs/zerolog/log" diff --git a/cmd/server/service/users.go b/cmd/server/service/users.go index 0466028c4..362e3bce2 100644 --- a/cmd/server/service/users.go +++ b/cmd/server/service/users.go @@ -14,11 +14,11 @@ import ( "github.com/cfoust/sour/pkg/server" "github.com/cfoust/sour/pkg/utils" - "github.com/cfoust/sour/svc/server/config" - "github.com/cfoust/sour/svc/server/ingress" - "github.com/cfoust/sour/svc/server/servers" - "github.com/cfoust/sour/svc/server/state" - "github.com/cfoust/sour/svc/server/verse" + "github.com/cfoust/sour/cmd/server/config" + "github.com/cfoust/sour/cmd/server/ingress" + "github.com/cfoust/sour/cmd/server/servers" + "github.com/cfoust/sour/cmd/server/state" + "github.com/cfoust/sour/cmd/server/verse" "github.com/rs/zerolog" "github.com/rs/zerolog/log" diff --git a/cmd/server/state/module.go b/cmd/server/state/module.go index 0e10bf72f..32409d085 100644 --- a/cmd/server/state/module.go +++ b/cmd/server/state/module.go @@ -1,7 +1,7 @@ package state import ( - "github.com/cfoust/sour/svc/server/config" + "github.com/cfoust/sour/cmd/server/config" "github.com/go-redis/redis/v9" ) diff --git a/cmd/server/stores/module.go b/cmd/server/stores/module.go index 1f37b9063..d7e0070cf 100644 --- a/cmd/server/stores/module.go +++ b/cmd/server/stores/module.go @@ -6,10 +6,10 @@ import ( "os" "time" + "github.com/cfoust/sour/cmd/server/config" + "github.com/cfoust/sour/cmd/server/state" "github.com/cfoust/sour/pkg/assets" "github.com/cfoust/sour/pkg/utils" - "github.com/cfoust/sour/svc/server/config" - "github.com/cfoust/sour/svc/server/state" "gorm.io/gorm" ) @@ -30,7 +30,7 @@ func (s *AssetStorage) Get(ctx context.Context, asset *state.Asset) ([]byte, err asset.Accessed = time.Now() err := s.db.WithContext(ctx).Save(asset).Error if err != nil { - return nil, err + return nil, err } return store.Get(ctx, asset.Hash) diff --git a/cmd/server/verse/editing.go b/cmd/server/verse/editing.go index 28b2eb0e9..42825c91c 100644 --- a/cmd/server/verse/editing.go +++ b/cmd/server/verse/editing.go @@ -7,11 +7,11 @@ import ( "time" "unsafe" + "github.com/cfoust/sour/cmd/server/ingress" C "github.com/cfoust/sour/pkg/game/constants" P "github.com/cfoust/sour/pkg/game/protocol" "github.com/cfoust/sour/pkg/maps" "github.com/cfoust/sour/pkg/maps/worldio" - "github.com/cfoust/sour/svc/server/ingress" "github.com/rs/zerolog/log" ) diff --git a/cmd/server/verse/module.go b/cmd/server/verse/module.go index f19d5713f..9e5f00113 100644 --- a/cmd/server/verse/module.go +++ b/cmd/server/verse/module.go @@ -9,10 +9,10 @@ import ( "regexp" "time" + "github.com/cfoust/sour/cmd/server/state" + "github.com/cfoust/sour/cmd/server/stores" "github.com/cfoust/sour/pkg/maps" "github.com/cfoust/sour/pkg/utils" - "github.com/cfoust/sour/svc/server/state" - "github.com/cfoust/sour/svc/server/stores" "gorm.io/gorm" ) diff --git a/cmd/server/verse/spaces.go b/cmd/server/verse/spaces.go index 27dbd09b3..2050aece8 100644 --- a/cmd/server/verse/spaces.go +++ b/cmd/server/verse/spaces.go @@ -8,14 +8,14 @@ import ( "strings" "time" + "github.com/cfoust/sour/cmd/server/config" + "github.com/cfoust/sour/cmd/server/ingress" + gameServers "github.com/cfoust/sour/cmd/server/servers" "github.com/cfoust/sour/pkg/assets" "github.com/cfoust/sour/pkg/game/commands" C "github.com/cfoust/sour/pkg/game/constants" "github.com/cfoust/sour/pkg/server" "github.com/cfoust/sour/pkg/utils" - "github.com/cfoust/sour/svc/server/config" - "github.com/cfoust/sour/svc/server/ingress" - gameServers "github.com/cfoust/sour/svc/server/servers" "github.com/rs/zerolog" "github.com/rs/zerolog/log" diff --git a/cmd/server/watcher/module.go b/cmd/server/watcher/module.go index 0ab18fdad..e9c4b668a 100644 --- a/cmd/server/watcher/module.go +++ b/cmd/server/watcher/module.go @@ -91,8 +91,8 @@ type Server struct { type Servers map[Address]Server type Watcher struct { - serverMutex sync.Mutex - servers Servers + serverMutex sync.Mutex + servers Servers } func NewWatcher() *Watcher {