From 6cd073198c6167f96a0a80b3f727e0b0d03c0815 Mon Sep 17 00:00:00 2001 From: Wil Simpson Date: Wed, 20 Mar 2024 20:46:57 -0400 Subject: [PATCH] Adding test coverage with agones --- cmd/gamebackend/app/server.go | 15 +- coverage.out | 973 ++++++++++++----------- go.mod | 28 +- go.sum | 44 ++ pkg/srv/servermanager.go | 116 ++- pkg/srv/servermanager_test.go | 1402 ++++++++++++++++++++++++--------- 6 files changed, 1618 insertions(+), 960 deletions(-) diff --git a/cmd/gamebackend/app/server.go b/cmd/gamebackend/app/server.go index 3d1ff52..2446dc3 100644 --- a/cmd/gamebackend/app/server.go +++ b/cmd/gamebackend/app/server.go @@ -7,7 +7,7 @@ import ( "errors" "os" - aapb "agones.dev/agones/pkg/allocation/go" + "agones.dev/agones/pkg/client/clientset/versioned" "github.com/Nerzal/gocloak/v13" "github.com/ShatteredRealms/go-backend/pkg/config" "github.com/ShatteredRealms/go-backend/pkg/helpers" @@ -18,6 +18,7 @@ import ( "go.opentelemetry.io/otel/trace" "google.golang.org/grpc" "google.golang.org/grpc/credentials" + "k8s.io/client-go/rest" ) var ( @@ -29,8 +30,8 @@ type GameBackendServerContext struct { CharacterClient pb.CharacterServiceClient ChatClient pb.ChatServiceClient GamebackendService service.GamebackendService - AgonesClient aapb.AllocationServiceClient KeycloakClient *gocloak.GoCloak + AgonesClient versioned.Interface Tracer trace.Tracer } @@ -49,10 +50,12 @@ func NewServerContext(ctx context.Context, conf *config.GlobalConfig) *GameBacke helpers.Check(ctx, err, "connecting to chat") server.ChatClient = pb.NewChatServiceClient(chatService) - if conf.GameBackend.Mode != config.LocalMode { - ac, err := helpers.GrpcClientWithOtel(conf.Agones.Allocator.Address()) - helpers.Check(ctx, err, "connecting to agones") - server.AgonesClient = aapb.NewAllocationServiceClient(ac) + if server.GlobalConfig.GameBackend.Mode != config.LocalMode { + conf, err := rest.InClusterConfig() + helpers.Check(ctx, err, "creating config") + + server.AgonesClient, err = versioned.NewForConfig(conf) + helpers.Check(ctx, err, "creating agones connection") } db, err := repository.ConnectDB(conf.GameBackend.Postgres) diff --git a/coverage.out b/coverage.out index 989bde7..dfa7e0b 100644 --- a/coverage.out +++ b/coverage.out @@ -1,307 +1,307 @@ mode: atomic github.com/ShatteredRealms/go-backend/pkg/srv/character.go:50.62,53.2 2 124 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:59.33,61.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:61.16,64.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:67.2,67.81 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:67.81,69.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:71.2,72.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:72.16,74.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:77.2,78.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:78.16,80.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:82.2,82.46 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:89.33,91.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:91.16,94.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:97.2,97.80 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:97.80,99.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:101.2,102.16 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:59.33,61.16 2 6 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:61.16,64.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:67.2,67.81 1 5 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:67.81,69.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:71.2,72.16 2 4 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:72.16,74.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:77.2,78.16 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:78.16,80.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:82.2,82.46 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:89.33,91.16 2 12 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:91.16,94.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:97.2,97.80 1 11 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:97.80,99.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:101.2,102.16 2 10 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:102.16,104.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:107.2,107.114 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:107.114,109.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:112.2,113.31 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:113.31,116.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:118.2,126.8 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:133.27,135.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:135.16,138.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:141.2,141.80 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:141.80,143.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:145.2,146.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:146.16,148.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:150.2,150.22 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:107.2,107.114 1 10 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:107.114,109.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:112.2,113.31 2 8 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:113.31,116.3 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:118.2,126.8 1 6 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:133.27,135.16 2 7 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:135.16,138.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:141.2,141.80 1 6 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:141.80,143.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:145.2,146.16 2 5 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:146.16,148.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:150.2,150.22 1 3 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:150.22,152.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:155.2,155.124 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:155.124,157.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:159.2,160.16 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:155.2,155.124 1 3 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:155.124,157.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:159.2,160.16 2 2 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:160.16,163.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:165.2,165.30 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:172.27,174.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:174.16,177.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:180.2,180.85 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:180.85,182.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:185.2,185.81 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:165.2,165.30 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:172.27,174.16 2 6 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:174.16,177.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:180.2,180.85 1 5 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:180.85,182.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:185.2,185.81 1 3 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:185.81,187.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:189.2,190.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:190.16,193.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:195.2,195.30 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:202.33,204.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:204.16,207.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:210.2,210.80 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:189.2,190.16 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:190.16,193.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:195.2,195.30 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:202.33,204.16 2 8 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:204.16,207.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:210.2,210.80 1 7 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:210.80,213.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:215.2,216.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:216.16,219.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:221.2,221.22 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:215.2,216.16 2 7 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:216.16,219.3 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:221.2,221.22 1 5 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:221.22,223.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:225.2,225.124 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:225.124,228.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:230.2,230.30 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:237.34,239.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:239.16,242.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:245.2,245.80 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:245.80,247.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:249.2,250.16 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:225.2,225.124 1 5 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:225.124,228.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:230.2,230.30 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:237.34,239.16 2 8 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:239.16,242.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:245.2,245.80 1 7 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:245.80,247.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:249.2,250.16 2 6 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:250.16,253.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:256.2,257.83 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:257.83,259.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:261.2,262.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:262.16,265.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:267.2,267.26 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:274.34,276.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:276.16,279.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:282.2,282.85 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:282.85,284.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:286.2,287.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:287.16,290.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:292.2,292.26 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:299.26,301.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:301.16,304.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:307.2,307.80 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:307.80,309.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:311.2,312.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:312.16,314.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:316.2,316.22 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:256.2,257.83 1 6 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:257.83,259.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:261.2,262.16 2 5 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:262.16,265.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:267.2,267.26 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:274.34,276.16 2 5 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:276.16,279.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:282.2,282.85 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:282.85,284.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:286.2,287.16 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:287.16,290.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:292.2,292.26 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:299.26,301.16 2 8 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:301.16,304.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:307.2,307.80 1 7 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:307.80,309.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:311.2,312.16 2 5 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:312.16,314.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:316.2,316.22 1 3 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:316.22,318.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:320.2,321.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:321.16,322.34 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:322.34,324.4 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:320.2,321.16 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:321.16,322.34 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:322.34,324.4 1 1 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:326.3,326.101 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:329.2,329.24 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:336.27,338.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:338.16,341.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:344.2,344.80 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:344.80,346.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:348.2,349.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:349.16,351.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:353.2,353.22 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:329.2,329.24 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:336.27,338.16 2 9 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:338.16,341.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:344.2,344.80 1 8 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:344.80,346.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:348.2,349.16 2 6 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:349.16,351.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:353.2,353.22 1 4 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:353.22,355.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:357.2,363.16 3 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:363.16,364.34 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:364.34,366.4 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:368.3,368.101 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:371.2,371.30 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:377.38,384.16 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:357.2,363.16 3 4 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:363.16,364.34 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:364.34,366.4 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:368.3,368.101 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:371.2,371.30 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:377.38,384.16 2 64 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:384.16,386.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:388.2,395.16 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:388.2,395.16 2 64 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:395.16,397.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:399.2,401.8 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:399.2,401.8 1 64 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:404.94,411.16 2 0 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:411.16,413.3 1 0 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:415.2,418.8 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:424.17,426.39 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:427.30,428.32 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:429.32,431.17 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:431.17,434.4 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:435.3,435.18 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:424.17,426.39 2 4 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:427.30,428.32 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:429.32,431.17 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:431.17,434.4 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:435.3,435.18 1 1 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:435.18,437.4 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:439.3,439.24 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:439.3,439.24 1 1 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:440.10,442.35 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:445.2,445.25 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:451.29,455.43 3 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:445.2,445.25 1 3 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:451.29,455.43 3 23 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:455.43,457.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:459.2,459.39 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:460.30,461.76 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:463.32,464.74 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:459.2,459.39 1 23 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:460.30,461.76 1 19 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:463.32,464.74 1 4 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:466.10,468.37 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:471.2,471.16 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:471.16,474.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:476.2,476.22 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:476.22,479.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:481.2,481.23 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:487.19,494.16 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:471.2,471.16 1 23 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:471.16,474.3 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:476.2,476.22 1 20 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:476.22,479.3 2 5 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:481.2,481.23 1 15 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:487.19,494.16 2 16 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:494.16,497.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:499.2,500.61 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:500.61,510.17 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:499.2,500.61 2 16 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:500.61,510.17 2 4 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:510.17,513.4 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:514.3,514.38 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:514.3,514.38 1 4 github.com/ShatteredRealms/go-backend/pkg/srv/character.go:514.38,516.4 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:518.3,518.24 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/character.go:521.2,521.21 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:518.3,518.24 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/character.go:521.2,521.21 1 16 github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:39.57,42.2 2 62 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:47.9,49.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:49.16,52.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:55.2,55.59 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:55.59,57.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:60.2,60.72 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:60.72,62.17 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:62.17,65.4 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:68.2,70.6 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:70.6,72.17 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:47.9,49.16 2 7 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:49.16,52.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:55.2,55.59 1 6 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:55.59,57.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:60.2,60.72 1 5 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:60.72,62.17 2 4 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:62.17,65.4 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:68.2,70.6 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:70.6,72.17 2 2 github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:72.17,75.4 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:77.3,82.17 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:82.17,85.4 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:92.9,94.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:94.16,97.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:100.2,100.59 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:100.59,102.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:104.2,105.30 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:105.30,106.73 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:106.73,108.4 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:109.8,109.23 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:109.23,111.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:113.2,114.6 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:114.6,116.17 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:77.3,82.17 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:82.17,85.4 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:92.9,94.16 2 8 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:94.16,97.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:100.2,100.59 1 7 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:100.59,102.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:104.2,105.30 2 6 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:105.30,106.73 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:106.73,108.4 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:109.8,109.23 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:109.23,111.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:113.2,114.6 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:114.6,116.17 2 3 github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:116.17,119.4 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:121.3,126.17 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:126.17,129.4 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:136.27,138.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:138.16,141.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:144.2,144.59 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:144.59,147.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:148.2,152.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:152.16,155.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:159.2,159.72 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:159.72,161.17 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:121.3,126.17 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:126.17,129.4 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:136.27,138.16 2 11 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:138.16,141.3 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:144.2,144.59 1 9 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:144.59,147.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:148.2,152.16 2 8 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:152.16,155.3 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:159.2,159.72 1 5 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:159.72,161.17 2 4 github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:161.17,164.4 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:166.3,167.17 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:167.17,170.4 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:172.3,173.36 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:173.36,174.45 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:174.45,176.10 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:179.3,179.15 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:179.15,182.4 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:185.2,191.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:191.16,194.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:196.2,196.30 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:202.27,204.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:204.16,207.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:210.2,210.59 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:210.59,212.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:214.2,217.16 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:217.16,219.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:221.2,222.16 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:166.3,167.17 2 4 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:167.17,170.4 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:172.3,173.36 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:173.36,174.45 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:174.45,176.10 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:179.3,179.15 1 3 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:179.15,182.4 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:185.2,191.16 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:191.16,194.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:196.2,196.30 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:202.27,204.16 2 9 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:204.16,207.3 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:210.2,210.59 1 7 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:210.59,212.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:214.2,217.16 1 6 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:217.16,219.3 1 3 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:221.2,222.16 2 3 github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:222.16,225.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:226.2,227.16 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:226.2,227.16 2 3 github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:227.16,229.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:231.2,236.16 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:236.16,239.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:241.2,241.30 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:247.28,249.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:249.16,252.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:255.2,255.72 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:255.72,257.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:259.2,260.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:260.16,263.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:265.2,265.14 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:265.14,267.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:269.2,269.22 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:275.27,277.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:277.16,280.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:283.2,283.72 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:283.72,285.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:287.2,295.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:295.16,296.44 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:296.44,298.4 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:300.3,301.76 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:304.2,304.30 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:310.27,312.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:312.16,315.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:318.2,318.72 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:318.72,320.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:322.2,325.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:325.16,326.45 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:326.45,328.4 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:330.3,331.71 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:334.2,334.30 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:340.27,342.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:342.16,345.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:348.2,348.72 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:348.72,350.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:352.2,353.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:353.16,354.45 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:354.45,356.4 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:358.3,359.69 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:362.2,362.30 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:368.29,370.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:370.16,373.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:376.2,376.72 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:376.72,378.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:380.2,381.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:381.16,384.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:386.2,386.29 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:392.29,394.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:394.16,397.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:400.2,400.59 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:400.59,402.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:404.2,405.30 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:405.30,406.73 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:231.2,236.16 1 3 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:236.16,239.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:241.2,241.30 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:247.28,249.16 2 7 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:249.16,252.3 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:255.2,255.72 1 5 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:255.72,257.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:259.2,260.16 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:260.16,263.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:265.2,265.14 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:265.14,267.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:269.2,269.22 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:275.27,277.16 2 7 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:277.16,280.3 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:283.2,283.72 1 5 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:283.72,285.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:287.2,295.16 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:295.16,296.44 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:296.44,298.4 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:300.3,301.76 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:304.2,304.30 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:310.27,312.16 2 7 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:312.16,315.3 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:318.2,318.72 1 5 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:318.72,320.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:322.2,325.16 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:325.16,326.45 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:326.45,328.4 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:330.3,331.71 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:334.2,334.30 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:340.27,342.16 2 7 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:342.16,345.3 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:348.2,348.72 1 5 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:348.72,350.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:352.2,353.16 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:353.16,354.45 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:354.45,356.4 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:358.3,359.69 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:362.2,362.30 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:368.29,370.16 2 6 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:370.16,373.3 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:376.2,376.72 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:376.72,378.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:380.2,381.16 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:381.16,384.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:386.2,386.29 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:392.29,394.16 2 9 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:394.16,397.3 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:400.2,400.59 1 7 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:400.59,402.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:404.2,405.30 2 6 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:405.30,406.73 1 1 github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:406.73,408.4 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:409.8,409.43 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:409.43,412.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:414.2,415.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:415.16,418.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:420.2,420.29 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:426.27,428.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:428.16,431.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:434.2,434.72 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:434.72,436.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:438.2,439.16 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:409.8,409.43 1 5 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:409.43,412.3 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:414.2,415.16 2 4 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:415.16,418.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:420.2,420.29 1 3 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:426.27,428.16 2 8 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:428.16,431.3 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:434.2,434.72 1 6 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:434.72,436.3 1 3 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:438.2,439.16 2 3 github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:439.16,442.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:443.2,444.16 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:443.2,444.16 2 3 github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:444.16,446.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:448.2,454.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:454.16,455.44 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:455.44,457.4 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:459.3,460.77 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:463.2,463.30 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:469.33,476.16 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:448.2,454.16 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:454.16,455.44 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:455.44,457.4 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:459.3,460.77 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:463.2,463.30 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:469.33,476.16 2 84 github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:476.16,478.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:480.2,487.16 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:480.2,487.16 2 84 github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:487.16,489.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:491.2,493.8 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:497.88,504.16 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:491.2,493.8 1 84 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:497.88,504.16 2 40 github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:504.16,507.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:509.2,512.8 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:515.132,517.16 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:509.2,512.8 1 40 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:515.132,517.16 2 26 github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:517.16,520.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:522.2,523.16 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:522.2,523.16 2 26 github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:523.16,526.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:528.2,529.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:529.16,532.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:534.2,534.22 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:534.22,536.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:538.2,538.39 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:538.39,540.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:542.2,542.23 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:545.107,547.16 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:528.2,529.16 2 26 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:529.16,532.3 2 5 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:534.2,534.22 1 21 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:534.22,536.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:538.2,538.39 1 20 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:538.39,540.3 1 7 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:542.2,542.23 1 13 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:545.107,547.16 2 4 github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:547.16,549.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:551.2,553.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:553.16,556.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:558.2,558.50 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:558.50,560.17 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:560.17,563.4 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:565.3,565.36 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:565.36,566.31 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:566.31,568.5 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:572.2,572.30 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:551.2,553.16 2 4 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:553.16,556.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:558.2,558.50 1 3 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:558.50,560.17 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:560.17,563.4 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:565.3,565.36 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:565.36,566.31 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:566.31,568.5 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/chat.go:572.2,572.30 1 1 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:39.63,42.2 2 62 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:53.42,55.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:55.16,58.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:61.2,61.69 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:61.69,63.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:66.2,70.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:70.16,73.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:74.2,74.22 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:74.22,77.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:79.2,79.64 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:79.64,81.3 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:53.42,55.16 2 8 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:55.16,58.3 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:61.2,61.69 1 6 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:61.69,63.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:66.2,70.16 2 5 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:70.16,73.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:74.2,74.22 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:74.22,77.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:79.2,79.64 1 3 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:79.64,81.3 1 3 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:84.2,85.31 2 0 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:85.31,86.45 1 0 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:86.45,87.35 1 0 @@ -311,31 +311,31 @@ github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:95.31,99.3 1 0 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:99.8,99.43 1 0 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:99.43,101.3 1 0 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:103.2,103.71 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:109.33,111.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:111.16,114.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:117.2,117.79 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:117.79,119.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:121.2,122.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:122.16,124.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:126.2,127.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:127.16,129.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:132.2,140.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:140.16,143.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:144.2,144.22 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:144.22,147.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:149.2,149.23 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:155.42,157.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:157.16,160.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:163.2,163.79 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:163.79,165.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:167.2,175.36 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:175.36,178.3 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:180.2,180.64 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:180.64,182.3 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:109.33,111.16 2 9 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:111.16,114.3 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:117.2,117.79 1 7 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:117.79,119.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:121.2,122.16 2 5 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:122.16,124.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:126.2,127.16 2 4 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:127.16,129.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:132.2,140.16 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:140.16,143.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:144.2,144.22 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:144.22,147.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:149.2,149.23 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:155.42,157.16 2 8 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:157.16,160.3 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:163.2,163.79 1 6 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:163.79,165.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:167.2,175.36 2 4 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:175.36,178.3 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:180.2,180.64 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:180.64,182.3 1 2 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:184.2,184.68 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:190.42,192.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:192.16,194.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:196.2,201.8 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:190.42,192.16 2 5 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:192.16,194.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:196.2,201.8 2 3 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:209.42,213.16 3 0 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:213.16,216.3 2 0 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:218.2,256.16 4 0 @@ -346,218 +346,209 @@ github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:274.17,277.4 2 0 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:282.2,283.16 2 0 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:283.16,285.3 1 0 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:287.2,291.8 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:298.39,305.16 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:298.39,305.16 2 25 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:305.16,307.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:309.2,316.16 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:309.2,316.16 2 25 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:316.16,318.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:320.2,320.62 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:320.2,320.62 1 25 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:320.62,322.17 2 0 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:322.17,325.4 2 0 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:327.3,328.17 2 0 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:328.17,331.4 2 0 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:333.3,336.9 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:339.2,341.8 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:339.2,341.8 1 25 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:344.94,351.16 2 0 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:351.16,353.3 1 0 github.com/ShatteredRealms/go-backend/pkg/srv/connection.go:355.2,358.8 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/health.go:13.54,15.2 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/health.go:17.92,19.2 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/health.go:13.54,15.2 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/health.go:17.92,19.2 1 1 github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:46.66,49.2 2 62 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:61.26,63.16 2 7 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:63.16,65.3 1 4 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:67.2,68.16 2 3 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:68.16,70.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:72.2,79.16 2 2 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:79.16,81.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:83.2,83.64 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:83.64,85.17 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:85.17,87.4 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:88.8,90.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:92.2,92.30 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:99.20,101.16 2 6 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:101.16,103.3 1 4 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:105.2,112.16 2 2 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:112.16,114.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:116.2,116.22 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:123.27,125.16 2 10 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:125.16,127.3 1 4 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:129.2,130.16 2 6 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:130.16,132.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:133.2,133.22 1 5 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:133.22,135.3 1 2 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:137.2,138.16 2 3 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:138.16,140.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:141.2,144.64 3 2 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:144.64,145.36 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:145.36,148.18 3 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:148.18,150.5 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:152.8,154.3 1 2 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:156.2,156.19 1 2 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:156.19,158.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:160.2,160.30 1 2 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:167.27,169.16 2 13 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:169.16,171.3 1 4 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:173.2,174.16 2 9 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:174.16,176.3 1 6 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:178.2,179.16 2 3 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:179.16,182.3 2 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:183.2,186.64 3 2 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:186.64,188.40 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:188.40,191.18 3 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:191.18,193.5 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:195.8,197.3 1 2 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:199.2,199.31 1 2 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:206.26,208.16 2 7 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:208.16,210.3 1 4 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:212.2,213.16 2 3 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:213.16,215.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:216.2,216.25 1 2 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:216.25,218.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:220.2,220.64 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:220.64,222.17 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:222.17,224.4 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:225.8,227.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:229.2,229.33 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:236.26,238.16 2 8 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:238.16,240.3 1 4 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:242.2,243.16 2 4 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:243.16,245.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:246.2,246.30 1 3 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:246.30,248.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:250.2,251.16 2 2 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:251.16,253.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:255.2,256.64 2 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:256.64,257.34 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:257.34,259.45 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:259.45,261.19 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:261.19,264.6 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:267.4,268.18 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:268.18,270.5 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:271.9,273.24 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:273.24,275.44 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:275.44,277.6 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:279.5,279.46 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:279.46,280.41 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:280.41,282.21 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:282.21,284.8 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:285.12,288.41 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:288.41,290.22 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:290.22,292.9 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:298.5,298.40 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:298.40,300.20 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:300.20,302.7 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:304.10,304.45 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:304.45,306.44 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:306.44,308.20 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:308.20,310.7 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:314.8,316.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:318.2,318.37 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:325.20,327.16 2 8 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:327.16,329.3 1 4 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:331.2,332.16 2 4 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:332.16,334.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:335.2,335.24 1 3 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:335.24,337.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:339.2,340.16 2 2 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:340.16,342.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:344.2,345.64 2 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:345.64,346.34 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:346.34,348.53 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:348.53,350.19 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:350.19,353.6 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:355.5,356.19 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:356.19,358.6 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:360.9,362.48 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:362.48,364.19 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:364.19,366.6 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:369.8,371.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:373.2,373.28 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:380.27,382.16 2 6 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:382.16,384.3 1 4 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:386.2,387.16 2 2 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:387.16,389.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:391.2,391.24 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:398.21,400.16 2 6 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:400.16,402.3 1 4 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:404.2,405.16 2 2 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:405.16,407.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:409.2,409.40 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:416.26,418.16 2 7 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:418.16,420.3 1 4 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:422.2,424.16 2 3 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:424.16,426.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:428.2,428.22 1 2 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:428.22,430.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:432.2,432.30 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:439.20,441.16 2 7 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:441.16,443.3 1 4 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:445.2,447.16 2 3 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:447.16,449.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:451.2,451.14 1 2 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:451.14,453.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:455.2,455.22 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:461.42,468.16 2 85 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:468.16,470.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:472.2,479.16 2 85 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:479.16,481.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:483.2,483.62 1 85 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:483.62,485.17 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:485.17,488.4 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:490.3,491.17 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:491.17,494.4 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:496.3,499.9 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:502.2,504.8 1 85 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:507.97,514.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:514.16,516.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:518.2,521.8 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:524.85,526.16 2 85 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:526.16,529.3 2 22 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:532.2,532.75 1 63 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:532.75,534.3 1 22 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:536.2,536.12 1 41 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:543.9,544.21 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:544.21,546.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:549.2,554.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:554.16,556.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:559.2,564.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:564.16,566.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:568.2,568.12 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:575.9,576.21 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:576.21,578.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:580.2,590.29 3 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:590.29,592.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:595.2,601.29 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:601.29,603.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:605.2,605.12 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:612.9,613.21 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:613.21,615.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:618.2,623.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:623.16,625.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:628.2,633.16 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:633.16,635.3 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:637.2,637.12 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:640.119,661.2 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:663.87,723.2 4 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:725.72,730.2 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:732.68,734.2 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:736.78,738.2 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:740.110,743.35 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:743.35,745.17 2 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:745.17,747.4 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:750.2,750.13 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:756.31,757.47 1 9 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:758.24,760.17 2 5 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:760.17,762.4 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:763.3,763.63 1 4 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:765.26,766.73 1 3 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:768.10,770.37 2 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:773.2,773.16 1 7 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:773.16,775.3 1 1 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:776.2,776.16 1 6 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:776.16,778.3 1 3 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:780.2,780.17 1 3 -github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:783.64,787.2 3 1 -github.com/ShatteredRealms/go-backend/pkg/srv/util.go:17.9,18.30 1 85 -github.com/ShatteredRealms/go-backend/pkg/srv/util.go:18.30,22.56 2 340 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:60.26,62.16 2 11 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:62.16,64.3 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:66.2,67.16 2 7 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:67.16,69.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:71.2,78.16 2 6 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:78.16,80.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:82.2,82.64 1 5 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:82.64,84.3 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:84.8,86.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:88.2,88.30 1 5 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:95.20,97.16 2 6 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:97.16,99.3 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:101.2,108.16 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:108.16,110.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:112.2,112.22 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:119.27,121.16 2 14 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:121.16,123.3 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:125.2,126.16 2 10 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:126.16,128.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:129.2,129.22 1 9 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:129.22,131.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:133.2,134.16 2 7 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:134.16,136.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:137.2,139.64 2 6 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:139.64,140.36 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:140.36,143.18 3 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:143.18,145.5 1 3 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:147.8,149.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:151.2,151.30 1 6 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:158.27,160.16 2 14 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:160.16,162.3 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:164.2,165.16 2 10 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:165.16,167.3 1 6 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:169.2,170.16 2 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:170.16,173.3 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:174.2,177.64 3 3 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:177.64,179.40 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:179.40,182.18 3 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:182.18,184.5 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:186.8,188.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:190.2,190.31 1 3 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:197.26,199.16 2 8 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:199.16,201.3 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:203.2,204.16 2 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:204.16,206.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:207.2,207.25 1 3 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:207.25,209.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:211.2,211.64 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:211.64,213.17 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:213.17,215.4 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:216.8,218.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:220.2,220.33 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:227.26,229.16 2 13 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:229.16,231.3 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:233.2,234.16 2 9 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:234.16,236.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:237.2,237.30 1 8 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:237.30,239.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:241.2,242.16 2 7 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:242.16,244.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:246.2,247.64 2 6 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:247.64,248.50 1 5 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:248.50,250.45 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:250.45,252.19 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:252.19,255.6 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:258.4,259.18 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:259.18,261.5 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:262.9,263.24 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:263.24,265.41 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:265.41,267.6 1 6 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:269.5,269.46 1 3 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:269.46,270.41 1 6 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:270.41,272.21 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:272.21,274.8 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:275.12,278.41 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:278.41,280.22 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:280.22,282.9 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:288.5,288.40 1 3 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:288.40,290.20 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:290.20,292.7 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:294.10,294.45 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:294.45,296.41 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:296.41,298.20 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:298.20,300.7 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:304.8,306.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:308.2,308.34 1 6 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:315.20,317.16 2 10 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:317.16,319.3 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:321.2,322.16 2 6 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:322.16,324.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:325.2,325.24 1 5 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:325.24,327.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:329.2,330.16 2 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:330.16,332.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:334.2,335.64 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:335.64,336.38 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:336.38,338.53 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:338.53,340.19 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:340.19,343.6 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:345.5,346.19 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:346.19,348.6 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:350.9,352.48 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:352.48,354.19 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:354.19,356.6 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:359.8,361.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:363.2,363.28 1 3 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:370.27,372.16 2 6 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:372.16,374.3 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:376.2,377.16 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:377.16,379.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:381.2,381.24 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:388.21,390.16 2 6 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:390.16,392.3 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:394.2,395.16 2 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:395.16,397.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:399.2,399.40 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:406.26,408.16 2 7 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:408.16,410.3 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:412.2,414.16 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:414.16,416.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:418.2,418.22 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:418.22,420.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:422.2,422.30 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:429.20,431.16 2 7 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:431.16,433.3 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:435.2,437.16 2 3 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:437.16,439.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:441.2,441.14 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:441.14,443.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:445.2,445.22 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:451.42,458.16 2 102 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:458.16,460.3 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:462.2,469.16 2 102 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:469.16,471.3 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:473.2,475.8 1 102 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:478.97,485.16 2 0 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:485.16,487.3 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:489.2,492.8 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:495.85,497.16 2 102 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:497.16,500.3 2 22 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:503.2,503.75 1 80 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:503.75,505.3 1 22 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:507.2,507.12 1 58 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:514.9,515.34 1 11 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:515.34,517.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:520.2,525.16 2 9 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:525.16,527.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:530.2,535.16 2 8 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:535.16,537.3 1 6 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:539.2,539.12 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:546.9,547.34 1 11 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:547.34,549.3 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:551.2,561.29 3 9 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:561.29,563.3 1 3 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:566.2,572.29 2 6 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:572.29,574.3 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:576.2,576.12 1 2 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:583.9,584.34 1 6 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:584.34,586.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:588.2,593.16 2 5 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:593.16,595.3 1 0 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:597.2,602.16 2 5 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:602.16,604.3 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:606.2,606.12 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:609.119,630.2 1 13 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:632.87,699.2 1 14 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:701.72,706.2 1 69 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:708.68,710.2 1 47 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:712.78,714.2 1 22 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:716.110,719.35 2 6 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:719.35,721.17 2 7 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:721.17,723.4 1 6 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:726.2,726.13 1 6 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:732.31,733.47 1 10 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:734.24,736.17 2 6 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:736.17,738.4 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:739.3,739.63 1 5 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:741.26,742.73 1 3 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:744.10,746.37 2 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:749.2,749.16 1 8 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:749.16,751.3 1 1 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:752.2,752.16 1 7 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:752.16,754.3 1 3 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:756.2,756.17 1 4 +github.com/ShatteredRealms/go-backend/pkg/srv/servermanager.go:759.64,763.2 3 16 +github.com/ShatteredRealms/go-backend/pkg/srv/util.go:17.9,18.30 1 275 +github.com/ShatteredRealms/go-backend/pkg/srv/util.go:18.30,22.56 2 932 github.com/ShatteredRealms/go-backend/pkg/srv/util.go:22.56,24.4 1 0 -github.com/ShatteredRealms/go-backend/pkg/srv/util.go:27.2,27.12 1 85 +github.com/ShatteredRealms/go-backend/pkg/srv/util.go:27.2,27.12 1 275 diff --git a/go.mod b/go.mod index 1ca501a..0625350 100644 --- a/go.mod +++ b/go.mod @@ -36,15 +36,22 @@ require ( require ( dario.cat/mergo v1.0.0 // indirect + github.com/evanphx/json-patch v4.12.0+incompatible // indirect github.com/go-gorm/caches/v4 v4.0.0 // indirect + github.com/go-openapi/spec v0.19.5 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 // indirect + github.com/imdario/mergo v0.3.12 // indirect github.com/jackc/puddle/v2 v2.2.1 // indirect + github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect + github.com/stretchr/testify v1.8.4 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.1.2 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect @@ -54,11 +61,14 @@ require ( golang.org/x/mod v0.16.0 // indirect golang.org/x/sync v0.6.0 // indirect golang.org/x/tools v0.18.0 // indirect + gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240304161311-37d4d3c04a78 // indirect + gopkg.in/fsnotify.v1 v1.4.7 // indirect + k8s.io/apiextensions-apiserver v0.27.6 // indirect ) require ( - agones.dev/agones v1.30.0 + agones.dev/agones v1.39.0 github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/Nerzal/gocloak/v13 v13.1.0 @@ -75,9 +85,9 @@ require ( github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.20.0 // indirect - github.com/go-openapi/swag v0.19.14 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.1 // indirect + github.com/go-openapi/swag v0.22.3 // indirect github.com/go-resty/resty/v2 v2.7.0 github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect @@ -141,13 +151,13 @@ require ( gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 gorm.io/plugin/soft_delete v1.2.0 - k8s.io/api v0.26.3 - k8s.io/apimachinery v0.26.3 - k8s.io/client-go v0.26.3 + k8s.io/api v0.27.6 + k8s.io/apimachinery v0.27.6 + k8s.io/client-go v0.27.6 k8s.io/klog/v2 v2.90.1 // indirect - k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect + k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5 // indirect - sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/go.sum b/go.sum index 1d1f7d1..92a6e7b 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ agones.dev/agones v1.30.0 h1:BDwCQhXko7cVyJrkvs0/C9SGQDR91Fsg+z477blRseg= agones.dev/agones v1.30.0/go.mod h1:vkKAtL3sm2Sj2/+Y0uAKW1YE02H0+fBgie2ruiKgSdM= +agones.dev/agones v1.39.0 h1:oCwJohhcZQzfz1pQ8OxQSkZ12V0imTlEBZez78bYspo= +agones.dev/agones v1.39.0/go.mod h1:n0gTMgxYrvxvEHK8Hfr/epa95BM7W3QuYdlZ1EAG/IQ= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= @@ -12,6 +14,8 @@ github.com/Nerzal/gocloak/v13 v13.1.0 h1:ret4pZTIsSQGZHURDMJ4jXnUmHyEoRykBqDTsAK github.com/Nerzal/gocloak/v13 v13.1.0/go.mod h1:rRBtEdh5N0+JlZZEsrfZcB2sRMZWbgSxI2EIv9jpJp4= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/TwiN/go-away v1.6.10 h1:ScxGvhyJPu7VqLJJCpVx9vXBlQXi4wme3Vwx4z1WeC4= github.com/TwiN/go-away v1.6.10/go.mod h1:e0adzvKFM6LIbU+K8pczlqYMaoH/6OwdvQEqg9wSRSU= github.com/bxcodec/faker/v4 v4.0.0-beta.3 h1:gqYNBvN72QtzKkYohNDKQlm+pg+uwBDVMN28nWHS18k= @@ -45,6 +49,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= +github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= @@ -59,14 +65,25 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= +github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= +github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/spec v0.19.5 h1:Xm0Ao53uqnk9QE/LlYV5DEU09UAgpliA85QoT9LzqPw= +github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= +github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= @@ -79,6 +96,8 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -122,6 +141,8 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0Q github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1/go.mod h1:5SN9VR2LTsRFsrEC6FHgRbTWrTHu6tqPeKxEQv15giM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= +github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= @@ -178,6 +199,8 @@ github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a h1:+J2gw7Bw77w github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a/go.mod h1:M1qoD/MqPgTZIk0EWKB38wE28ACRfVcn+cU08jyArI0= github.com/mattn/go-sqlite3 v1.14.3 h1:j7a/xn1U6TKA/PHHxqZuzh64CdtRc7rU9M+AvkOl5bA= github.com/mattn/go-sqlite3 v1.14.3/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= +github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= +github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 h1:rzf0wL0CHVc8CEsgyygG0Mn9CNCCPZqOPaz8RiiHYQk= @@ -354,7 +377,9 @@ golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -398,6 +423,7 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -423,6 +449,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= +gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= @@ -464,12 +492,16 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -504,18 +536,30 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/api v0.26.3 h1:emf74GIQMTik01Aum9dPP0gAypL8JTLl/lHa4V9RFSU= k8s.io/api v0.26.3/go.mod h1:PXsqwPMXBSBcL1lJ9CYDKy7kIReUydukS5JiRlxC3qE= +k8s.io/api v0.27.6 h1:PBWu/lywJe2qQcshMjubzcBg7+XDZOo7O8JJAWuYtUo= +k8s.io/api v0.27.6/go.mod h1:AQYj0UsFCp3qJE7bOVnUuy4orCsXVkvHefnbYQiNWgk= +k8s.io/apiextensions-apiserver v0.27.6 h1:mOwSBJtThZhpJr+8gEkc3wFDIjq87E3JspR5mtZxIg8= +k8s.io/apiextensions-apiserver v0.27.6/go.mod h1:AVNlLYRrESG5Poo6ASRUhY2pvoKPcNt8y/IuZ4lx3o8= k8s.io/apimachinery v0.26.3 h1:dQx6PNETJ7nODU3XPtrwkfuubs6w7sX0M8n61zHIV/k= k8s.io/apimachinery v0.26.3/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I= +k8s.io/apimachinery v0.27.6 h1:mGU8jmBq5o8mWBov+mLjdTBcU+etTE19waies4AQ6NE= +k8s.io/apimachinery v0.27.6/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= k8s.io/client-go v0.26.3 h1:k1UY+KXfkxV2ScEL3gilKcF7761xkYsSD6BC9szIu8s= k8s.io/client-go v0.26.3/go.mod h1:ZPNu9lm8/dbRIPAgteN30RSXea6vrCpFvq+MateTUuQ= +k8s.io/client-go v0.27.6 h1:vzI8804gpUtpMCNaFjIFyJrifH7u//LJCJPy8fQuYQg= +k8s.io/client-go v0.27.6/go.mod h1:PMsXcDKiJTW7PHJ64oEsIUJF319wm+EFlCj76oE5QXM= k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E= k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5 h1:kmDqav+P+/5e1i9tFfHq1qcF3sOrDp+YEkVDAHu7Jwk= k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= diff --git a/pkg/srv/servermanager.go b/pkg/srv/servermanager.go index b2716f8..30f5bdc 100644 --- a/pkg/srv/servermanager.go +++ b/pkg/srv/servermanager.go @@ -6,9 +6,10 @@ import ( "fmt" "strings" + appsv1 "k8s.io/api/apps/v1" + v1 "agones.dev/agones/pkg/apis/agones/v1" autoscalingv1 "agones.dev/agones/pkg/apis/autoscaling/v1" - "agones.dev/agones/pkg/client/clientset/versioned" "github.com/Nerzal/gocloak/v13" gamebackend "github.com/ShatteredRealms/go-backend/cmd/gamebackend/app" "github.com/ShatteredRealms/go-backend/pkg/config" @@ -24,7 +25,6 @@ import ( k8errors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/client-go/rest" ) var ( @@ -51,7 +51,6 @@ func registerServerManagerRole(role *gocloak.Role) *gocloak.Role { type serverManagerServiceServer struct { pb.UnimplementedServerManagerServiceServer server *gamebackend.GameBackendServerContext - agones *versioned.Clientset } // CreateDimension implements pb.ServerManagerServiceServer. @@ -82,14 +81,11 @@ func (s *serverManagerServiceServer) CreateDimension( if s.server.GlobalConfig.GameBackend.Mode != config.LocalMode { err = s.setupNewDimension(ctx, dimension) - if err != nil { - return nil, status.Errorf(codes.Internal, "dimension setup: %s", err.Error()) - } } else { log.Logger.WithContext(ctx).Infof("Running Local Mode - Skipping dimension setup") } - return dimension.ToPb(), nil + return dimension.ToPb(), err } // CreateMap implements pb.ServerManagerServiceServer. @@ -140,24 +136,19 @@ func (s *serverManagerServiceServer) DeleteDimension( } log.Logger.WithContext(ctx).Infof("Deleted dimension %s (%s)", dimension.Name, dimension.Id.String()) - var outErr error if s.server.GlobalConfig.GameBackend.Mode != config.LocalMode { for _, m := range dimension.Maps { log.Logger.Infof("Deleting gameserver dimension %s map %s", dimension.Name, m.Name) err = s.deleteGameServers(ctx, dimension, m) if err != nil { - outErr = errors.Join(outErr, status.Errorf(codes.Internal, "deleting game servers for dimension %s, map %s: %s", dimension.Name, m.Name, err.Error())) + err = errors.Join(err, status.Errorf(codes.Internal, "deleting game servers for dimension %s, map %s: %s", dimension.Name, m.Name, err.Error())) } } } else { log.Logger.WithContext(ctx).Info("Local Mode: Not deleting game servers") } - if outErr != nil { - return nil, outErr - } - - return &emptypb.Empty{}, nil + return &emptypb.Empty{}, err } // DeleteMap implements pb.ServerManagerServiceServer. @@ -220,7 +211,7 @@ func (s *serverManagerServiceServer) DuplicateDimension( if s.server.GlobalConfig.GameBackend.Mode != config.LocalMode { err = s.setupNewDimension(ctx, newDimension) if err != nil { - return nil, status.Errorf(codes.Internal, "setup dimension: %s", err.Error()) + err = status.Errorf(codes.Internal, "setup dimension: %s", err.Error()) } } else { log.Logger.WithContext(ctx).Info("Local Mode: Not creating game servers") @@ -247,14 +238,14 @@ func (s *serverManagerServiceServer) EditDimension( return nil, model.ErrDoesNotExist } - editedDimension, err := s.server.GamebackendService.EditDimension(ctx, request) + newDimension, err := s.server.GamebackendService.EditDimension(ctx, request) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } var errs error if s.server.GlobalConfig.GameBackend.Mode != config.LocalMode { - if request.OptionalName != nil { + if originalDimension.Name != newDimension.Name { // Name change requires delete and recreate for _, m := range originalDimension.Maps { err := s.deleteGameServers(ctx, originalDimension, m) @@ -264,21 +255,20 @@ func (s *serverManagerServiceServer) EditDimension( } } - err = s.setupNewDimension(ctx, editedDimension) + err = s.setupNewDimension(ctx, newDimension) if err != nil { - errs = joinErrorAndLog(errs, "setting up dimension %s gameservers: %w", editedDimension.Name, err) + errs = joinErrorAndLog(errs, "setting up dimension %s gameservers: %w", newDimension.Name, err) } } else { - // Everything wasn't deleted so we can safely change one-by-one if request.EditMaps { currentMaps := make(map[*uuid.UUID]*model.Map, len(request.MapIds)) - for _, m := range editedDimension.Maps { + for _, m := range newDimension.Maps { currentMaps[m.Id] = m } for _, m := range originalDimension.Maps { if _, ok := currentMaps[m.Id]; !ok { - err := s.deleteGameServers(ctx, editedDimension, m) + err := s.deleteGameServers(ctx, newDimension, m) if err != nil { errs = joinErrorAndLog(errs, "unable to delete old gameserver world %s: %w", m.Name, err) } @@ -286,7 +276,7 @@ func (s *serverManagerServiceServer) EditDimension( delete(currentMaps, m.Id) if request.OptionalVersion != nil { - err := s.updateGameServers(ctx, editedDimension, m) + err := s.updateGameServers(ctx, newDimension, m) if err != nil { errs = joinErrorAndLog(errs, "unable to update gameserver world %s: %w", m.Name, err) } @@ -296,15 +286,15 @@ func (s *serverManagerServiceServer) EditDimension( // newMaps now only contains map that weren't in the original for _, newMap := range currentMaps { - err = s.createGameServers(ctx, editedDimension, newMap) + err = s.createGameServers(ctx, newDimension, newMap) if err != nil { errs = joinErrorAndLog(errs, "unable to delete old gameserver world %s: %w", newMap.Name, err) } } } else if request.OptionalVersion != nil { // Maps weren't changed, so update the versions - for _, m := range editedDimension.Maps { - err := s.updateGameServers(ctx, editedDimension, m) + for _, m := range newDimension.Maps { + err := s.updateGameServers(ctx, newDimension, m) if err != nil { errs = joinErrorAndLog(errs, "unable to update gameserver world %s: %w", m.Name, err) } @@ -315,7 +305,7 @@ func (s *serverManagerServiceServer) EditDimension( log.Logger.WithContext(ctx).Info("Local Mode: Not creating game servers") } - return editedDimension.ToPb(), errs + return newDimension.ToPb(), errs } // EditMap implements pb.ServerManagerServiceServer. @@ -343,7 +333,7 @@ func (s *serverManagerServiceServer) EditMap( var errs error if s.server.GlobalConfig.GameBackend.Mode != config.LocalMode { - if request.OptionalName != nil { + if originalMap.Name != newMap.Name { // Need to delete and recreate for _, dimension := range originalMap.Dimensions { err = s.deleteGameServers(ctx, dimension, originalMap) @@ -480,25 +470,6 @@ func NewServerManagerServiceServer( return nil, err } - if server.GlobalConfig.GameBackend.Mode != config.LocalMode { - conf, err := rest.InClusterConfig() - if err != nil { - log.Logger.WithContext(ctx).Errorf("creating config: %v", err) - return nil, status.Error(codes.Internal, err.Error()) - } - - agones, err := versioned.NewForConfig(conf) - if err != nil { - log.Logger.WithContext(ctx).Errorf("creating agones connection: %v", err) - return nil, status.Error(codes.Internal, err.Error()) - } - - return &serverManagerServiceServer{ - server: server, - agones: agones, - }, nil - } - return &serverManagerServiceServer{ server: server, }, nil @@ -541,12 +512,12 @@ func (s serverManagerServiceServer) createGameServers( dimension *model.Dimension, m *model.Map, ) error { - if s.agones == nil { + if s.server.AgonesClient == nil { return ErrNoAgonesConnect } // Create the fleet - fleet, err := s.agones.AgonesV1().Fleets(s.server.GlobalConfig.Agones.Namespace).Create( + fleet, err := s.server.AgonesClient.AgonesV1().Fleets(s.server.GlobalConfig.Agones.Namespace).Create( ctx, buildFleet(dimension, m, s.server.GlobalConfig.Agones.Namespace), metav1.CreateOptions{}, @@ -556,7 +527,7 @@ func (s serverManagerServiceServer) createGameServers( } // Create autoscaler - _, err = s.agones.AutoscalingV1().FleetAutoscalers(fleet.Namespace).Create( + _, err = s.server.AgonesClient.AutoscalingV1().FleetAutoscalers(fleet.Namespace).Create( ctx, buildAutoscalingFleet(dimension, m, fleet.Namespace), metav1.CreateOptions{}, @@ -573,14 +544,14 @@ func (s serverManagerServiceServer) deleteGameServers( dimension *model.Dimension, m *model.Map, ) error { - if s.agones == nil { + if s.server.AgonesClient == nil { return ErrNoAgonesConnect } namespace := s.server.GlobalConfig.Agones.Namespace // Delete autoscaler - err := s.agones.AutoscalingV1().FleetAutoscalers(namespace).Delete( + err := s.server.AgonesClient.AutoscalingV1().FleetAutoscalers(namespace).Delete( ctx, getFleetAutoscalerName(dimension, m), metav1.DeleteOptions{}, @@ -592,7 +563,7 @@ func (s serverManagerServiceServer) deleteGameServers( } // Delete autoscaler - err = s.agones.AgonesV1().Fleets(namespace).Delete( + err = s.server.AgonesClient.AgonesV1().Fleets(namespace).Delete( ctx, getFleetName(dimension, m), metav1.DeleteOptions{}, @@ -610,12 +581,11 @@ func (s serverManagerServiceServer) updateGameServers( dimension *model.Dimension, m *model.Map, ) error { - if s.agones == nil { + if s.server.AgonesClient == nil { return ErrNoAgonesConnect } - // Update the fleet - fleet, err := s.agones.AgonesV1().Fleets(s.server.GlobalConfig.Agones.Namespace).Update( + fleet, err := s.server.AgonesClient.AgonesV1().Fleets(s.server.GlobalConfig.Agones.Namespace).Update( ctx, buildFleet(dimension, m, s.server.GlobalConfig.Agones.Namespace), metav1.UpdateOptions{}, @@ -624,8 +594,7 @@ func (s serverManagerServiceServer) updateGameServers( return fmt.Errorf("creating fleet: %w", err) } - // Update autoscalergones not setup, not connected in local mode - _, err = s.agones.AutoscalingV1().FleetAutoscalers(fleet.Namespace).Update( + _, err = s.server.AgonesClient.AutoscalingV1().FleetAutoscalers(fleet.Namespace).Update( ctx, buildAutoscalingFleet(dimension, m, fleet.Namespace), metav1.UpdateOptions{}, @@ -661,15 +630,6 @@ func buildAutoscalingFleet(dimension *model.Dimension, m *model.Map, namespace s } func buildFleet(dimension *model.Dimension, m *model.Map, namespace string) *v1.Fleet { - // Create the starting arguments - startArgs := make([]string, 2) - - // Map name to load - startArgs[0] = m.Path - - // Enable logging - startArgs[1] = "-log" - return &v1.Fleet{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ @@ -679,6 +639,19 @@ func buildFleet(dimension *model.Dimension, m *model.Map, namespace string) *v1. Spec: v1.FleetSpec{ Replicas: 1, Scheduling: "", + Strategy: appsv1.DeploymentStrategy{ + Type: "RollingUpdate", + RollingUpdate: &appsv1.RollingUpdateDeployment{ + MaxUnavailable: &intstr.IntOrString{ + Type: intstr.Int, + IntVal: 25, + }, + MaxSurge: &intstr.IntOrString{ + Type: intstr.Int, + IntVal: 25, + }, + }, + }, Template: v1.GameServerTemplateSpec{ Spec: v1.GameServerSpec{ Container: "", @@ -703,9 +676,12 @@ func buildFleet(dimension *model.Dimension, m *model.Map, namespace string) *v1. Spec: corev1.PodSpec{ Containers: []corev1.Container{ { - Name: "gameserver", - Image: dimension.GetImageName(), - Args: startArgs, + Name: "gameserver", + Image: dimension.GetImageName(), + Args: []string{ + m.Path, + "-log", + }, ImagePullPolicy: "Always", }, }, diff --git a/pkg/srv/servermanager_test.go b/pkg/srv/servermanager_test.go index 98cd7a9..8ea5772 100644 --- a/pkg/srv/servermanager_test.go +++ b/pkg/srv/servermanager_test.go @@ -2,8 +2,12 @@ package srv_test import ( context "context" + "strings" "time" + agonesv1 "agones.dev/agones/pkg/apis/agones/v1" + autoscalingv1 "agones.dev/agones/pkg/apis/autoscaling/v1" + "agones.dev/agones/pkg/testing" app "github.com/ShatteredRealms/go-backend/cmd/gamebackend/app" "github.com/ShatteredRealms/go-backend/pkg/config" "github.com/ShatteredRealms/go-backend/pkg/log" @@ -20,9 +24,11 @@ import ( "go.uber.org/mock/gomock" "google.golang.org/protobuf/types/known/emptypb" "gorm.io/gorm" + k8sruntime "k8s.io/apimachinery/pkg/runtime" + k8stesting "k8s.io/client-go/testing" ) -var _ = Describe("Servermanager server (local)", func() { +var _ = Describe("Servermanager server", func() { var ( hook *test.Hook mockController *gomock.Controller @@ -33,6 +39,7 @@ var _ = Describe("Servermanager server (local)", func() { mockCharClient *mocks.MockCharacterServiceClient mockChatClient *mocks.MockChatServiceClient mockService *mocks.MockGamebackendService + mockAgones testing.Mocks server pb.ServerManagerServiceServer dimension *model.Dimension @@ -48,17 +55,18 @@ var _ = Describe("Servermanager server (local)", func() { mockCharClient = mocks.NewMockCharacterServiceClient(mockController) mockChatClient = mocks.NewMockChatServiceClient(mockController) mockService = mocks.NewMockGamebackendService(mockController) + mockAgones = testing.NewMocks() - globalConfig.GameBackend.Mode = config.LocalMode conf = &app.GameBackendServerContext{ GlobalConfig: globalConfig, CharacterClient: mockCharClient, ChatClient: mockChatClient, GamebackendService: mockService, - AgonesClient: nil, + AgonesClient: mockAgones.AgonesClient, KeycloakClient: keycloak, Tracer: otel.Tracer("test-servermanager"), } + conf.GlobalConfig.GameBackend.Mode = config.LocalMode server, err = srv.NewServerManagerServiceServer(ctx, conf) Expect(err).NotTo(HaveOccurred()) @@ -107,55 +115,142 @@ var _ = Describe("Servermanager server (local)", func() { Location: dimension.Location, } }) - When("given valid input", func() { - It("should work (admin)", func() { - mockService.EXPECT(). - CreateDimension(gomock.Any(), req.Name, req.Location, req.Version, []*uuid.UUID{m.Id}). - Return(dimension, nil) - out, err := server.CreateDimension(incAdminCtx, req) - Expect(err).NotTo(HaveOccurred()) - Expect(out).NotTo(BeNil()) + Context("local mode", func() { + When("given valid input", func() { + It("should work (admin)", func() { + mockService.EXPECT(). + CreateDimension(gomock.Any(), req.Name, req.Location, req.Version, []*uuid.UUID{m.Id}). + Return(dimension, nil) + out, err := server.CreateDimension(incAdminCtx, req) + Expect(err).NotTo(HaveOccurred()) + Expect(out).NotTo(BeNil()) + }) + }) + + When("given invalid input", func() { + It("should error for invalid ctx (nil)", func() { + out, err := server.CreateDimension(nil, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + It("should error for empty ctx (empty)", func() { + out, err := server.CreateDimension(context.Background(), req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for invalid permission (guest)", func() { + out, err := server.CreateDimension(incGuestCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for invalid permission (player)", func() { + out, err := server.CreateDimension(incPlayerCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for invalid map id", func() { + req.MapIds = []string{"asdf"} + out, err := server.CreateDimension(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for error in creationg", func() { + mockService.EXPECT(). + CreateDimension(gomock.Any(), req.Name, req.Location, req.Version, []*uuid.UUID{m.Id}). + Return(nil, fakeErr) + out, err := server.CreateDimension(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) }) }) - When("given invalid input", func() { - It("should error for invalid ctx (nil)", func() { - out, err := server.CreateDimension(nil, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - It("should error for empty ctx (empty)", func() { - out, err := server.CreateDimension(context.Background(), req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for invalid permission (guest)", func() { - out, err := server.CreateDimension(incGuestCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for invalid permission (player)", func() { - out, err := server.CreateDimension(incPlayerCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for invalid map id", func() { - req.MapIds = []string{"asdf"} - out, err := server.CreateDimension(incAdminCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for error in creationg", func() { + Context("with agones", func() { + var ( + fleet *agonesv1.Fleet + fleetAutoscaler *autoscalingv1.FleetAutoscaler + ) + BeforeEach(func() { + conf.GlobalConfig.GameBackend.Mode = config.ModeProduction mockService.EXPECT(). CreateDimension(gomock.Any(), req.Name, req.Location, req.Version, []*uuid.UUID{m.Id}). - Return(nil, fakeErr) + Return(dimension, nil) + }) + + When("agones is working", func() { + It("should work", func() { + mockAgones.AgonesClient.AddReactor("create", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ua := action.(k8stesting.CreateAction) + fleet = ua.GetObject().(*agonesv1.Fleet) + return true, fleet, nil + }) + mockAgones.AgonesClient.AddReactor("create", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ua := action.(k8stesting.CreateAction) + fleetAutoscaler = ua.GetObject().(*autoscalingv1.FleetAutoscaler) + return true, fleetAutoscaler, nil + }) + out, err := server.CreateDimension(incAdminCtx, req) + Expect(err).NotTo(HaveOccurred()) + Expect(out).NotTo(BeNil()) + + Expect(fleet).NotTo(BeNil()) + Expect(fleet.Name).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(fleet.Name).To(ContainSubstring(strings.ToLower(m.Name))) + Expect(fleetAutoscaler).NotTo(BeNil()) + Expect(fleetAutoscaler.Name).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(fleetAutoscaler.Name).To(ContainSubstring(strings.ToLower(m.Name))) + Expect(fleet.Validate(testing.FakeAPIHooks{})).To(BeNil()) + Expect(fleetAutoscaler.Validate()).To(BeNil()) + }) + }) + + When("agones isn't working", func() { + It("should err on fleet creation error", func() { + mockAgones.AgonesClient.AddReactor("create", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + return true, nil, fakeErr + }) + mockAgones.AgonesClient.AddReactor("create", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ua := action.(k8stesting.CreateAction) + fleetAutoscaler = ua.GetObject().(*autoscalingv1.FleetAutoscaler) + return true, fleetAutoscaler, nil + }) + out, err := server.CreateDimension(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).NotTo(BeNil()) + Expect(fleet).To(BeNil()) + Expect(fleetAutoscaler).To(BeNil()) + }) + + It("should err on fleet autoscaling creation error", func() { + mockAgones.AgonesClient.AddReactor("create", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ua := action.(k8stesting.CreateAction) + fleet = ua.GetObject().(*agonesv1.Fleet) + return true, fleet, nil + }) + mockAgones.AgonesClient.AddReactor("create", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + return true, nil, fakeErr + }) + out, err := server.CreateDimension(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).NotTo(BeNil()) + Expect(fleet).NotTo(BeNil()) + Expect(fleet.Name).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(fleet.Name).To(ContainSubstring(strings.ToLower(m.Name))) + Expect(fleetAutoscaler).To(BeNil()) + }) + }) + + It("should err if agones not setup", func() { + conf.AgonesClient = nil out, err := server.CreateDimension(incAdminCtx, req) Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) + Expect(out).NotTo(BeNil()) + Expect(fleet).To(BeNil()) + Expect(fleetAutoscaler).To(BeNil()) }) }) }) @@ -229,99 +324,188 @@ var _ = Describe("Servermanager server (local)", func() { }, } }) - When("given valid input", func() { - It("should work for Id target (admin)", func() { - mockService.EXPECT(). - FindDimension(gomock.Any(), req). - Return(dimension, nil) - mockService.EXPECT(). - DeleteDimensionById(gomock.Any(), dimension.Id). - Return(nil) - out, err := server.DeleteDimension(incAdminCtx, req) - Expect(err).NotTo(HaveOccurred()) - Expect(out).NotTo(BeNil()) - }) - - It("should work for Name target (admin)", func() { - req.FindBy = &pb.DimensionTarget_Name{ - Name: dimension.Name, - } - mockService.EXPECT(). - FindDimension(gomock.Any(), req). - Return(dimension, nil) - mockService.EXPECT(). - DeleteDimensionById(gomock.Any(), dimension.Id). - Return(nil) - out, err := server.DeleteDimension(incAdminCtx, req) - Expect(err).NotTo(HaveOccurred()) - Expect(out).NotTo(BeNil()) + Context("local mode", func() { + When("given valid input", func() { + It("should work for Id target (admin)", func() { + mockService.EXPECT(). + FindDimension(gomock.Any(), req). + Return(dimension, nil) + mockService.EXPECT(). + DeleteDimensionById(gomock.Any(), dimension.Id). + Return(nil) + out, err := server.DeleteDimension(incAdminCtx, req) + Expect(err).NotTo(HaveOccurred()) + Expect(out).NotTo(BeNil()) + }) + + It("should work for Name target (admin)", func() { + req.FindBy = &pb.DimensionTarget_Name{ + Name: dimension.Name, + } + mockService.EXPECT(). + FindDimension(gomock.Any(), req). + Return(dimension, nil) + mockService.EXPECT(). + DeleteDimensionById(gomock.Any(), dimension.Id). + Return(nil) + out, err := server.DeleteDimension(incAdminCtx, req) + Expect(err).NotTo(HaveOccurred()) + Expect(out).NotTo(BeNil()) + }) + }) + + When("given invalid input", func() { + It("should error for invalid ctx (nil)", func() { + out, err := server.DeleteDimension(nil, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + It("should error for empty ctx (empty)", func() { + out, err := server.DeleteDimension(context.Background(), req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for invalid permission (guest)", func() { + out, err := server.DeleteDimension(incGuestCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for invalid permission (guest)", func() { + out, err := server.DeleteDimension(incPlayerCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for FindDimension error", func() { + mockService.EXPECT(). + FindDimension(gomock.Any(), req). + Return(nil, fakeErr) + out, err := server.DeleteDimension(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for not found", func() { + mockService.EXPECT(). + FindDimension(gomock.Any(), req). + Return(nil, nil) + out, err := server.DeleteDimension(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for FindByName not found", func() { + req.FindBy = &pb.DimensionTarget_Name{ + Name: dimension.Name, + } + mockService.EXPECT(). + FindDimension(gomock.Any(), req). + Return(nil, nil) + out, err := server.DeleteDimension(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for error on deletion", func() { + mockService.EXPECT(). + FindDimension(gomock.Any(), req). + Return(dimension, nil) + mockService.EXPECT(). + DeleteDimensionById(gomock.Any(), dimension.Id). + Return(fakeErr) + out, err := server.DeleteDimension(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) }) }) - When("given invalid input", func() { - It("should error for invalid ctx (nil)", func() { - out, err := server.DeleteDimension(nil, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - It("should error for empty ctx (empty)", func() { - out, err := server.DeleteDimension(context.Background(), req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for invalid permission (guest)", func() { - out, err := server.DeleteDimension(incGuestCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for invalid permission (guest)", func() { - out, err := server.DeleteDimension(incPlayerCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for FindDimension error", func() { - mockService.EXPECT(). - FindDimension(gomock.Any(), req). - Return(nil, fakeErr) - out, err := server.DeleteDimension(incAdminCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for not found", func() { - mockService.EXPECT(). - FindDimension(gomock.Any(), req). - Return(nil, nil) - out, err := server.DeleteDimension(incAdminCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for FindByName not found", func() { - req.FindBy = &pb.DimensionTarget_Name{ - Name: dimension.Name, - } - mockService.EXPECT(). - FindDimension(gomock.Any(), req). - Return(nil, nil) - out, err := server.DeleteDimension(incAdminCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for error on deletion", func() { + Context("with agones", func() { + var ( + fleetDeleted bool + fleetAutoscalerDeleted bool + ) + BeforeEach(func() { + conf.GlobalConfig.GameBackend.Mode = config.ModeProduction mockService.EXPECT(). FindDimension(gomock.Any(), req). Return(dimension, nil) mockService.EXPECT(). DeleteDimensionById(gomock.Any(), dimension.Id). - Return(fakeErr) - out, err := server.DeleteDimension(incAdminCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) + Return(nil) + fleetDeleted = false + fleetAutoscalerDeleted = false + }) + + When("agones is working", func() { + It("should work", func() { + mockAgones.AgonesClient.AddReactor("delete", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + fleetAutoscalerDeleted = true + return true, nil, nil + }) + mockAgones.AgonesClient.AddReactor("delete", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + fleetDeleted = true + return true, nil, nil + }) + out, err := server.DeleteDimension(incAdminCtx, req) + Expect(err).NotTo(HaveOccurred()) + Expect(out).NotTo(BeNil()) + Expect(fleetDeleted).To(BeTrue()) + Expect(fleetAutoscalerDeleted).To(BeTrue()) + }) + }) + + When("agones isn't working", func() { + It("should error on autoscaling deleting issue", func() { + mockAgones.AgonesClient.AddReactor("delete", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + fleetAutoscalerDeleted = true + return true, nil, fakeErr + }) + mockAgones.AgonesClient.AddReactor("delete", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + fleetDeleted = true + return true, nil, nil + }) + out, err := server.DeleteDimension(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).NotTo(BeNil()) + Expect(fleetDeleted).To(BeFalse()) + Expect(fleetAutoscalerDeleted).To(BeTrue()) + }) + + It("should error on fleet deleting issue", func() { + mockAgones.AgonesClient.AddReactor("delete", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + fleetAutoscalerDeleted = true + return true, nil, nil + }) + mockAgones.AgonesClient.AddReactor("delete", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + fleetDeleted = true + return true, nil, fakeErr + }) + out, err := server.DeleteDimension(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).NotTo(BeNil()) + Expect(fleetDeleted).To(BeTrue()) + Expect(fleetAutoscalerDeleted).To(BeTrue()) + }) + + It("should error if agones is not setup", func() { + conf.AgonesClient = nil + mockAgones.AgonesClient.AddReactor("delete", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + fleetAutoscalerDeleted = true + return true, nil, nil + }) + mockAgones.AgonesClient.AddReactor("delete", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + fleetDeleted = true + return true, nil, fakeErr + }) + out, err := server.DeleteDimension(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).NotTo(BeNil()) + Expect(fleetDeleted).To(BeFalse()) + Expect(fleetAutoscalerDeleted).To(BeFalse()) + }) }) }) }) @@ -337,127 +521,170 @@ var _ = Describe("Servermanager server (local)", func() { }, } }) - When("given valid input", func() { - It("should work for Id target (admin)", func() { - mockService.EXPECT(). - FindMapById(gomock.Any(), m.Id). - Return(m, nil) - mockService.EXPECT(). - DeleteMapById(gomock.Any(), m.Id). - Return(nil) - out, err := server.DeleteMap(incAdminCtx, req) - Expect(err).NotTo(HaveOccurred()) - Expect(out).NotTo(BeNil()) - }) - It("should work for Name target (admin)", func() { - req.FindBy = &pb.MapTarget_Name{ - Name: m.Name, - } - mockService.EXPECT(). - FindMapByName(gomock.Any(), m.Name). - Return(m, nil) - mockService.EXPECT(). - DeleteMapById(gomock.Any(), m.Id). - Return(nil) - out, err := server.DeleteMap(incAdminCtx, req) - Expect(err).NotTo(HaveOccurred()) - Expect(out).NotTo(BeNil()) + Context("local mode", func() { + When("given valid input", func() { + It("should work for Id target (admin)", func() { + mockService.EXPECT(). + FindMapById(gomock.Any(), m.Id). + Return(m, nil) + mockService.EXPECT(). + DeleteMapById(gomock.Any(), m.Id). + Return(nil) + out, err := server.DeleteMap(incAdminCtx, req) + Expect(err).NotTo(HaveOccurred()) + Expect(out).NotTo(BeNil()) + }) + + It("should work for Name target (admin)", func() { + req.FindBy = &pb.MapTarget_Name{ + Name: m.Name, + } + mockService.EXPECT(). + FindMapByName(gomock.Any(), m.Name). + Return(m, nil) + mockService.EXPECT(). + DeleteMapById(gomock.Any(), m.Id). + Return(nil) + out, err := server.DeleteMap(incAdminCtx, req) + Expect(err).NotTo(HaveOccurred()) + Expect(out).NotTo(BeNil()) + }) + }) + + When("given invalid input", func() { + It("should error for invalid ctx (nil)", func() { + out, err := server.DeleteMap(nil, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + It("should error for empty ctx (empty)", func() { + out, err := server.DeleteMap(context.Background(), req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for invalid permission (guest)", func() { + out, err := server.DeleteMap(incGuestCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for invalid permission (guest)", func() { + out, err := server.DeleteMap(incPlayerCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for error on FindById", func() { + mockService.EXPECT(). + FindMapById(gomock.Any(), m.Id). + Return(nil, fakeErr) + out, err := server.DeleteMap(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for error on FindByName", func() { + req.FindBy = &pb.MapTarget_Name{ + Name: m.Name, + } + mockService.EXPECT(). + FindMapByName(gomock.Any(), m.Name). + Return(nil, fakeErr) + out, err := server.DeleteMap(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for FindById not found", func() { + mockService.EXPECT(). + FindMapById(gomock.Any(), m.Id). + Return(nil, nil) + out, err := server.DeleteMap(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for invalid id", func() { + req.FindBy = &pb.MapTarget_Id{ + Id: "asdf", + } + out, err := server.DeleteMap(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for FindByName not found", func() { + req.FindBy = &pb.MapTarget_Name{ + Name: m.Name, + } + mockService.EXPECT(). + FindMapByName(gomock.Any(), m.Name). + Return(nil, nil) + out, err := server.DeleteMap(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for error on unknown target type", func() { + req.FindBy = nil + out, err := server.DeleteMap(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for error on deletion", func() { + mockService.EXPECT(). + FindMapById(gomock.Any(), m.Id). + Return(m, nil) + mockService.EXPECT(). + DeleteMapById(gomock.Any(), m.Id). + Return(fakeErr) + out, err := server.DeleteMap(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) }) }) - When("given invalid input", func() { - It("should error for invalid ctx (nil)", func() { - out, err := server.DeleteMap(nil, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - It("should error for empty ctx (empty)", func() { - out, err := server.DeleteMap(context.Background(), req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for invalid permission (guest)", func() { - out, err := server.DeleteMap(incGuestCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for invalid permission (guest)", func() { - out, err := server.DeleteMap(incPlayerCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) + Context("with agones", func() { + It("should delete gameservers running this map", func() { + conf.GlobalConfig.GameBackend.Mode = config.ModeProduction + + var ( + deletedFleet string + deletedFleetAutoscaler string + ) + + mockAgones.AgonesClient.AddReactor("delete", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + da := action.(k8stesting.DeleteAction) + deletedFleet = da.GetName() + return true, nil, fakeErr + }) + mockAgones.AgonesClient.AddReactor("delete", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + da := action.(k8stesting.DeleteAction) + deletedFleetAutoscaler = da.GetName() + return true, nil, nil + }) - It("should error for error on FindById", func() { - mockService.EXPECT(). - FindMapById(gomock.Any(), m.Id). - Return(nil, fakeErr) - out, err := server.DeleteMap(incAdminCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for error on FindByName", func() { - req.FindBy = &pb.MapTarget_Name{ - Name: m.Name, - } - mockService.EXPECT(). - FindMapByName(gomock.Any(), m.Name). - Return(nil, fakeErr) - out, err := server.DeleteMap(incAdminCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for FindById not found", func() { - mockService.EXPECT(). - FindMapById(gomock.Any(), m.Id). - Return(nil, nil) - out, err := server.DeleteMap(incAdminCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for invalid id", func() { - req.FindBy = &pb.MapTarget_Id{ - Id: "asdf", - } - out, err := server.DeleteMap(incAdminCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for FindByName not found", func() { - req.FindBy = &pb.MapTarget_Name{ - Name: m.Name, - } - mockService.EXPECT(). - FindMapByName(gomock.Any(), m.Name). - Return(nil, nil) - out, err := server.DeleteMap(incAdminCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for error on unknown target type", func() { - req.FindBy = nil - out, err := server.DeleteMap(incAdminCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for error on deletion", func() { mockService.EXPECT(). FindMapById(gomock.Any(), m.Id). Return(m, nil) mockService.EXPECT(). DeleteMapById(gomock.Any(), m.Id). - Return(fakeErr) + Return(nil) + mockService.EXPECT(). + FindDimensionsWithMapIds(gomock.Any(), gomock.Any()). + Return(model.Dimensions{dimension}, nil) out, err := server.DeleteMap(incAdminCtx, req) Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) + Expect(out).NotTo(BeNil()) + + Expect(deletedFleet).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(deletedFleet).To(ContainSubstring(strings.ToLower(m.Name))) + Expect(deletedFleetAutoscaler).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(deletedFleetAutoscaler).To(ContainSubstring(strings.ToLower(m.Name))) }) }) }) @@ -476,57 +703,96 @@ var _ = Describe("Servermanager server (local)", func() { Name: faker.Username(), } }) - When("given valid input", func() { - It("should work (admin)", func() { - mockService.EXPECT(). - DuplicateDimension(gomock.Any(), req.Target, req.Name). - Return(dimension, nil) - out, err := server.DuplicateDimension(incAdminCtx, req) - Expect(err).NotTo(HaveOccurred()) - Expect(out).NotTo(BeNil()) - }) - }) - - When("given invalid input", func() { - It("should error for invalid ctx (nil)", func() { - out, err := server.DuplicateDimension(nil, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - It("should error for empty ctx (empty)", func() { - out, err := server.DuplicateDimension(context.Background(), req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for invalid permission (guest)", func() { - out, err := server.DuplicateDimension(incGuestCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - It("should error for invalid permission (player)", func() { - out, err := server.DuplicateDimension(incPlayerCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) + Context("local mode", func() { + When("given valid input", func() { + It("should work (admin)", func() { + mockService.EXPECT(). + DuplicateDimension(gomock.Any(), req.Target, req.Name). + Return(dimension, nil) + out, err := server.DuplicateDimension(incAdminCtx, req) + Expect(err).NotTo(HaveOccurred()) + Expect(out).NotTo(BeNil()) + }) + }) + + When("given invalid input", func() { + It("should error for invalid ctx (nil)", func() { + out, err := server.DuplicateDimension(nil, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + It("should error for empty ctx (empty)", func() { + out, err := server.DuplicateDimension(context.Background(), req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for invalid permission (guest)", func() { + out, err := server.DuplicateDimension(incGuestCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for invalid permission (player)", func() { + out, err := server.DuplicateDimension(incPlayerCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for duplicate dimension service errors", func() { + mockService.EXPECT(). + DuplicateDimension(gomock.Any(), req.Target, req.Name). + Return(nil, fakeErr) + out, err := server.DuplicateDimension(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for duplicate dimension service no dimension returned", func() { + mockService.EXPECT(). + DuplicateDimension(gomock.Any(), req.Target, req.Name). + Return(nil, nil) + out, err := server.DuplicateDimension(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) }) + }) - It("should error for duplicate dimension service errors", func() { + Context("with agones", func() { + It("should setup new dimension", func() { + conf.GlobalConfig.GameBackend.Mode = config.ModeProduction + + var ( + fleet *agonesv1.Fleet + fleetAutoscaler *autoscalingv1.FleetAutoscaler + ) + mockAgones.AgonesClient.AddReactor("create", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ua := action.(k8stesting.CreateAction) + fleet = ua.GetObject().(*agonesv1.Fleet) + return true, fleet, nil + }) + mockAgones.AgonesClient.AddReactor("create", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ua := action.(k8stesting.CreateAction) + fleetAutoscaler = ua.GetObject().(*autoscalingv1.FleetAutoscaler) + return true, fleetAutoscaler, fakeErr + }) mockService.EXPECT(). DuplicateDimension(gomock.Any(), req.Target, req.Name). - Return(nil, fakeErr) + Return(dimension, nil) out, err := server.DuplicateDimension(incAdminCtx, req) Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) + Expect(out).NotTo(BeNil()) - It("should error for duplicate dimension service no dimension returned", func() { - mockService.EXPECT(). - DuplicateDimension(gomock.Any(), req.Target, req.Name). - Return(nil, nil) - out, err := server.DuplicateDimension(incAdminCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) + Expect(fleet).NotTo(BeNil()) + Expect(fleet.Name).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(fleet.Name).To(ContainSubstring(strings.ToLower(m.Name))) + Expect(fleetAutoscaler).NotTo(BeNil()) + Expect(fleetAutoscaler.Name).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(fleetAutoscaler.Name).To(ContainSubstring(strings.ToLower(m.Name))) + Expect(fleet.Validate(testing.FakeAPIHooks{})).To(BeNil()) + Expect(fleetAutoscaler.Validate()).To(BeNil()) }) }) }) @@ -555,60 +821,323 @@ var _ = Describe("Servermanager server (local)", func() { }, } }) - When("given valid input", func() { - It("should work (admin)", func() { - mockService.EXPECT().FindDimension(gomock.Any(), req.Target).Return(dimension, nil) - mockService.EXPECT().EditDimension(gomock.Any(), req).Return(dimension, nil) - out, err := server.EditDimension(incAdminCtx, req) - Expect(err).NotTo(HaveOccurred()) - Expect(out).NotTo(BeNil()) + Context("local mode", func() { + When("given valid input", func() { + It("should work (admin)", func() { + mockService.EXPECT().FindDimension(gomock.Any(), req.Target).Return(dimension, nil) + mockService.EXPECT().EditDimension(gomock.Any(), req).Return(dimension, nil) + out, err := server.EditDimension(incAdminCtx, req) + Expect(err).NotTo(HaveOccurred()) + Expect(out).NotTo(BeNil()) + }) + }) + + When("given invalid input", func() { + It("should error for invalid ctx (nil)", func() { + out, err := server.EditDimension(nil, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + It("should error for empty ctx (empty)", func() { + out, err := server.EditDimension(context.Background(), req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for invalid permission (guest)", func() { + out, err := server.EditDimension(incGuestCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for invalid permission (player)", func() { + out, err := server.EditDimension(incPlayerCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for FindDimension errors", func() { + mockService.EXPECT().FindDimension(gomock.Any(), req.Target).Return(nil, fakeErr) + out, err := server.EditDimension(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for FindDimension returns no matches", func() { + mockService.EXPECT().FindDimension(gomock.Any(), req.Target).Return(nil, nil) + out, err := server.EditDimension(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for EditDimension returns an error", func() { + mockService.EXPECT().FindDimension(gomock.Any(), req.Target).Return(dimension, nil) + mockService.EXPECT().EditDimension(gomock.Any(), req).Return(nil, fakeErr) + out, err := server.EditDimension(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) }) }) - - When("given invalid input", func() { - It("should error for invalid ctx (nil)", func() { - out, err := server.EditDimension(nil, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - It("should error for empty ctx (empty)", func() { - out, err := server.EditDimension(context.Background(), req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for invalid permission (guest)", func() { - out, err := server.EditDimension(incGuestCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for invalid permission (player)", func() { - out, err := server.EditDimension(incPlayerCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for FindDimension errors", func() { - mockService.EXPECT().FindDimension(gomock.Any(), req.Target).Return(nil, fakeErr) - out, err := server.EditDimension(incAdminCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for FindDimension returns no matches", func() { - mockService.EXPECT().FindDimension(gomock.Any(), req.Target).Return(nil, nil) - out, err := server.EditDimension(incAdminCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for EditDimension returns an error", func() { + Context("with agones", func() { + var ( + updatedFleet *agonesv1.Fleet + updatedFleetAutoscaler *autoscalingv1.FleetAutoscaler + createdFleet *agonesv1.Fleet + createdFleetAutoscaler *autoscalingv1.FleetAutoscaler + deletedFleet string + deletedFleetAutoscaler string + m2 *model.Map + m3 *model.Map + newDimension *model.Dimension + ) + BeforeEach(func() { + conf.GlobalConfig.GameBackend.Mode = config.ModeProduction + req.OptionalName = nil + req.EditMaps = true + req.OptionalVersion = &pb.EditDimensionRequest_Version{ + Version: "v2", + } + m2Id := uuid.New() + m2 = &model.Map{ + Model: model.Model{ + Id: &m2Id, + CreatedAt: time.Now(), + UpdatedAt: time.Now(), + DeletedAt: gorm.DeletedAt{}, + }, + Name: faker.Username(), + Path: faker.Username(), + MaxPlayers: 40, + Instanced: false, + } + m2.Dimensions = []*model.Dimension{dimension} + m3Id := uuid.New() + m3 = &model.Map{ + Model: model.Model{ + Id: &m3Id, + CreatedAt: time.Now(), + UpdatedAt: time.Now(), + DeletedAt: gorm.DeletedAt{}, + }, + Name: faker.Username(), + Path: faker.Username(), + MaxPlayers: 40, + Instanced: false, + } + m3.Dimensions = []*model.Dimension{dimension} + dimension.Maps = model.Maps{m, m2} + newDimension = &model.Dimension{ + Model: model.Model{ + Id: dimension.Id, + CreatedAt: time.Now(), + UpdatedAt: time.Now(), + }, + Name: dimension.Name, + Location: req.GetLocation(), + Version: req.GetVersion(), + Maps: []*model.Map{m2, m3}, + } + req.MapIds = []string{m2.Id.String(), m3.Id.String()} mockService.EXPECT().FindDimension(gomock.Any(), req.Target).Return(dimension, nil) - mockService.EXPECT().EditDimension(gomock.Any(), req).Return(nil, fakeErr) - out, err := server.EditDimension(incAdminCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) + mockService.EXPECT().EditDimension(gomock.Any(), req).Return(newDimension, nil) + }) + + When("agones is working", func() { + It("should update correctly given map changes", func() { + mockAgones.AgonesClient.AddReactor("update", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ua := action.(k8stesting.UpdateAction) + updatedFleet = ua.GetObject().(*agonesv1.Fleet) + return true, updatedFleet, nil + }) + mockAgones.AgonesClient.AddReactor("update", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ua := action.(k8stesting.UpdateAction) + updatedFleetAutoscaler = ua.GetObject().(*autoscalingv1.FleetAutoscaler) + return true, updatedFleetAutoscaler, nil + }) + mockAgones.AgonesClient.AddReactor("create", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ca := action.(k8stesting.CreateAction) + createdFleet = ca.GetObject().(*agonesv1.Fleet) + return true, createdFleet, nil + }) + mockAgones.AgonesClient.AddReactor("create", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ca := action.(k8stesting.CreateAction) + createdFleetAutoscaler = ca.GetObject().(*autoscalingv1.FleetAutoscaler) + return true, createdFleetAutoscaler, nil + }) + mockAgones.AgonesClient.AddReactor("delete", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + da := action.(k8stesting.DeleteAction) + deletedFleet = da.GetName() + return true, nil, nil + }) + mockAgones.AgonesClient.AddReactor("delete", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + da := action.(k8stesting.DeleteAction) + deletedFleetAutoscaler = da.GetName() + return true, nil, nil + }) + out, err := server.EditDimension(incAdminCtx, req) + Expect(err).NotTo(HaveOccurred()) + Expect(out).NotTo(BeNil()) + + // Removed m, kept m2, and m3 is new + Expect(deletedFleet).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(deletedFleet).To(ContainSubstring(strings.ToLower(m.Name))) + Expect(deletedFleetAutoscaler).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(deletedFleetAutoscaler).To(ContainSubstring(strings.ToLower(m.Name))) + Expect(updatedFleet).NotTo(BeNil()) + Expect(updatedFleet.Name).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(updatedFleet.Name).To(ContainSubstring(strings.ToLower(m2.Name))) + Expect(updatedFleetAutoscaler).NotTo(BeNil()) + Expect(updatedFleetAutoscaler.Name).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(updatedFleetAutoscaler.Name).To(ContainSubstring(strings.ToLower(m2.Name))) + Expect(updatedFleet.Validate(testing.FakeAPIHooks{})).To(BeNil()) + Expect(updatedFleetAutoscaler.Validate()).To(BeNil()) + Expect(createdFleet).NotTo(BeNil()) + Expect(createdFleet.Name).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(createdFleet.Name).To(ContainSubstring(strings.ToLower(m3.Name))) + Expect(createdFleetAutoscaler).NotTo(BeNil()) + Expect(createdFleetAutoscaler.Name).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(createdFleetAutoscaler.Name).To(ContainSubstring(strings.ToLower(m3.Name))) + Expect(createdFleet.Validate(testing.FakeAPIHooks{})).To(BeNil()) + Expect(createdFleetAutoscaler.Validate()).To(BeNil()) + }) + + It("should update correctly given name change", func() { + req.OptionalName = &pb.EditDimensionRequest_Name{ + Name: "newname", + } + newDimension.Name = req.GetName() + mockAgones.AgonesClient.AddReactor("create", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ca := action.(k8stesting.CreateAction) + createdFleet = ca.GetObject().(*agonesv1.Fleet) + Expect(createdFleet).NotTo(BeNil()) + Expect(createdFleet.Name).To(Or(ContainSubstring(strings.ToLower(m2.Name)), ContainSubstring(strings.ToLower(m3.Name)))) + Expect(createdFleet.Name).To(ContainSubstring(strings.ToLower(req.GetName()))) + Expect(createdFleet.Validate(testing.FakeAPIHooks{})).To(BeNil()) + return true, createdFleet, nil + }) + mockAgones.AgonesClient.AddReactor("create", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ca := action.(k8stesting.CreateAction) + createdFleetAutoscaler = ca.GetObject().(*autoscalingv1.FleetAutoscaler) + Expect(createdFleetAutoscaler).NotTo(BeNil()) + Expect(createdFleetAutoscaler.Name).To(ContainSubstring(strings.ToLower(req.GetName()))) + Expect(createdFleetAutoscaler.Name).To(Or(ContainSubstring(strings.ToLower(m2.Name)), ContainSubstring(strings.ToLower(m3.Name)))) + Expect(createdFleetAutoscaler.Validate()).To(BeNil()) + return true, createdFleetAutoscaler, fakeErr + }) + mockAgones.AgonesClient.AddReactor("delete", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + da := action.(k8stesting.DeleteAction) + deletedFleet = da.GetName() + Expect(deletedFleet).To(Or(ContainSubstring(strings.ToLower(m2.Name)), ContainSubstring(strings.ToLower(m.Name)))) + Expect(deletedFleet).To(ContainSubstring(strings.ToLower(dimension.Name))) + return true, nil, nil + }) + mockAgones.AgonesClient.AddReactor("delete", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + da := action.(k8stesting.DeleteAction) + deletedFleetAutoscaler = da.GetName() + Expect(deletedFleetAutoscaler).To(Or(ContainSubstring(strings.ToLower(m2.Name)), ContainSubstring(strings.ToLower(m.Name)))) + Expect(deletedFleetAutoscaler).To(ContainSubstring(strings.ToLower(dimension.Name))) + return true, nil, fakeErr + }) + out, err := server.EditDimension(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).NotTo(BeNil()) + }) + + It("should update correctly given only a version change", func() { + req.EditMaps = false + newDimension.Maps = model.Maps{m, m2} + mockAgones.AgonesClient.AddReactor("update", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ca := action.(k8stesting.UpdateAction) + updatedFleet = ca.GetObject().(*agonesv1.Fleet) + Expect(updatedFleet).NotTo(BeNil()) + Expect(updatedFleet.Name).To(Or(ContainSubstring(strings.ToLower(m.Name)), ContainSubstring(strings.ToLower(m2.Name)))) + Expect(updatedFleet.Name).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(updatedFleet.Validate(testing.FakeAPIHooks{})).To(BeNil()) + return true, updatedFleet, nil + }) + mockAgones.AgonesClient.AddReactor("update", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ca := action.(k8stesting.UpdateAction) + updatedFleetAutoscaler = ca.GetObject().(*autoscalingv1.FleetAutoscaler) + Expect(updatedFleetAutoscaler).NotTo(BeNil()) + Expect(updatedFleetAutoscaler.Name).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(updatedFleetAutoscaler.Name).To(Or(ContainSubstring(strings.ToLower(m.Name)), ContainSubstring(strings.ToLower(m2.Name)))) + Expect(updatedFleetAutoscaler.Validate()).To(BeNil()) + return true, updatedFleetAutoscaler, fakeErr + }) + out, err := server.EditDimension(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).NotTo(BeNil()) + }) + }) + + When("agones isn't working", func() { + It("should combine all errs that occured", func() { + mockAgones.AgonesClient.AddReactor("update", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ua := action.(k8stesting.UpdateAction) + updatedFleet = ua.GetObject().(*agonesv1.Fleet) + return true, updatedFleet, nil + }) + mockAgones.AgonesClient.AddReactor("update", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ua := action.(k8stesting.UpdateAction) + updatedFleetAutoscaler = ua.GetObject().(*autoscalingv1.FleetAutoscaler) + return true, updatedFleetAutoscaler, fakeErr + }) + mockAgones.AgonesClient.AddReactor("create", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ua := action.(k8stesting.CreateAction) + createdFleet = ua.GetObject().(*agonesv1.Fleet) + return true, createdFleet, nil + }) + mockAgones.AgonesClient.AddReactor("create", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ua := action.(k8stesting.CreateAction) + createdFleetAutoscaler = ua.GetObject().(*autoscalingv1.FleetAutoscaler) + return true, createdFleetAutoscaler, fakeErr + }) + mockAgones.AgonesClient.AddReactor("delete", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + da := action.(k8stesting.DeleteAction) + deletedFleet = da.GetName() + return true, nil, fakeErr + }) + mockAgones.AgonesClient.AddReactor("delete", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + da := action.(k8stesting.DeleteAction) + deletedFleetAutoscaler = da.GetName() + return true, nil, nil + }) + out, err := server.EditDimension(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).NotTo(BeNil()) + + // Removed m, kept m2, and m3 is new + Expect(deletedFleet).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(deletedFleet).To(ContainSubstring(strings.ToLower(m.Name))) + Expect(deletedFleetAutoscaler).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(deletedFleetAutoscaler).To(ContainSubstring(strings.ToLower(m.Name))) + Expect(updatedFleet).NotTo(BeNil()) + Expect(updatedFleet.Name).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(updatedFleet.Name).To(ContainSubstring(strings.ToLower(m2.Name))) + Expect(updatedFleetAutoscaler).NotTo(BeNil()) + Expect(updatedFleetAutoscaler.Name).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(updatedFleetAutoscaler.Name).To(ContainSubstring(strings.ToLower(m2.Name))) + Expect(updatedFleet.Validate(testing.FakeAPIHooks{})).To(BeNil()) + Expect(updatedFleetAutoscaler.Validate()).To(BeNil()) + Expect(createdFleet).NotTo(BeNil()) + Expect(createdFleet.Name).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(createdFleet.Name).To(ContainSubstring(strings.ToLower(m3.Name))) + Expect(createdFleetAutoscaler).NotTo(BeNil()) + Expect(createdFleetAutoscaler.Name).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(createdFleetAutoscaler.Name).To(ContainSubstring(strings.ToLower(m3.Name))) + Expect(createdFleet.Validate(testing.FakeAPIHooks{})).To(BeNil()) + Expect(createdFleetAutoscaler.Validate()).To(BeNil()) + }) + + It("should err if agones not setup", func() { + conf.AgonesClient = nil + out, err := server.EditDimension(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).NotTo(BeNil()) + Expect(updatedFleet).To(BeNil()) + Expect(updatedFleetAutoscaler).To(BeNil()) + }) }) }) }) @@ -638,60 +1167,165 @@ var _ = Describe("Servermanager server (local)", func() { }, } }) - When("given valid input", func() { - It("should work (admin)", func() { - mockService.EXPECT().FindMap(gomock.Any(), req.Target).Return(m, nil) - mockService.EXPECT().EditMap(gomock.Any(), req).Return(m, nil) - out, err := server.EditMap(incAdminCtx, req) - Expect(err).NotTo(HaveOccurred()) - Expect(out).NotTo(BeNil()) + Context("local mode", func() { + When("given valid input", func() { + It("should work (admin)", func() { + mockService.EXPECT().FindMap(gomock.Any(), req.Target).Return(m, nil) + mockService.EXPECT().EditMap(gomock.Any(), req).Return(m, nil) + out, err := server.EditMap(incAdminCtx, req) + Expect(err).NotTo(HaveOccurred()) + Expect(out).NotTo(BeNil()) + }) + }) + + When("given invalid input", func() { + It("should error for invalid ctx (nil)", func() { + out, err := server.EditMap(nil, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + It("should error for empty ctx (empty)", func() { + out, err := server.EditMap(context.Background(), req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for invalid permission (guest)", func() { + out, err := server.EditMap(incGuestCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for invalid permission (player)", func() { + out, err := server.EditMap(incPlayerCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for FindMap errors", func() { + mockService.EXPECT().FindMap(gomock.Any(), req.Target).Return(nil, fakeErr) + out, err := server.EditMap(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for FindMap returns no matches", func() { + mockService.EXPECT().FindMap(gomock.Any(), req.Target).Return(nil, nil) + out, err := server.EditMap(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) + + It("should error for EditMap returns an error", func() { + mockService.EXPECT().FindMap(gomock.Any(), req.Target).Return(m, nil) + mockService.EXPECT().EditMap(gomock.Any(), req).Return(nil, fakeErr) + out, err := server.EditMap(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).To(BeNil()) + }) }) }) - - When("given invalid input", func() { - It("should error for invalid ctx (nil)", func() { - out, err := server.EditMap(nil, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - It("should error for empty ctx (empty)", func() { - out, err := server.EditMap(context.Background(), req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for invalid permission (guest)", func() { - out, err := server.EditMap(incGuestCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for invalid permission (player)", func() { - out, err := server.EditMap(incPlayerCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for FindMap errors", func() { - mockService.EXPECT().FindMap(gomock.Any(), req.Target).Return(nil, fakeErr) - out, err := server.EditMap(incAdminCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for FindMap returns no matches", func() { - mockService.EXPECT().FindMap(gomock.Any(), req.Target).Return(nil, nil) - out, err := server.EditMap(incAdminCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) - }) - - It("should error for EditMap returns an error", func() { + Context("with agones", func() { + var ( + updatedFleet *agonesv1.Fleet + updatedFleetAutoscaler *autoscalingv1.FleetAutoscaler + createdFleet *agonesv1.Fleet + createdFleetAutoscaler *autoscalingv1.FleetAutoscaler + deletedFleet string + deletedFleetAutoscaler string + m2 *model.Map + ) + BeforeEach(func() { + conf.GlobalConfig.GameBackend.Mode = config.ModeProduction + m2 = &model.Map{ + Model: model.Model{ + Id: m.Id, + CreatedAt: m.CreatedAt, + UpdatedAt: time.Now(), + }, + Name: req.GetName(), + Path: req.GetPath(), + MaxPlayers: req.GetMaxPlayers(), + Instanced: req.GetInstanced(), + Dimensions: []*model.Dimension{dimension}, + } mockService.EXPECT().FindMap(gomock.Any(), req.Target).Return(m, nil) - mockService.EXPECT().EditMap(gomock.Any(), req).Return(nil, fakeErr) - out, err := server.EditMap(incAdminCtx, req) - Expect(err).To(HaveOccurred()) - Expect(out).To(BeNil()) + mockService.EXPECT().EditMap(gomock.Any(), req).Return(m2, nil) + + req.OptionalName = nil + }) + + When("name changes", func() { + It("should delete and recreate servers", func() { + mockAgones.AgonesClient.AddReactor("create", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ca := action.(k8stesting.CreateAction) + createdFleet = ca.GetObject().(*agonesv1.Fleet) + return true, createdFleet, nil + }) + mockAgones.AgonesClient.AddReactor("create", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ca := action.(k8stesting.CreateAction) + createdFleetAutoscaler = ca.GetObject().(*autoscalingv1.FleetAutoscaler) + return true, createdFleetAutoscaler, fakeErr + }) + mockAgones.AgonesClient.AddReactor("delete", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + da := action.(k8stesting.DeleteAction) + deletedFleet = da.GetName() + return true, nil, fakeErr + }) + mockAgones.AgonesClient.AddReactor("delete", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + da := action.(k8stesting.DeleteAction) + deletedFleetAutoscaler = da.GetName() + return true, nil, nil + }) + out, err := server.EditMap(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).NotTo(BeNil()) + + Expect(deletedFleet).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(deletedFleet).To(ContainSubstring(strings.ToLower(m.Name))) + Expect(deletedFleetAutoscaler).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(deletedFleetAutoscaler).To(ContainSubstring(strings.ToLower(m.Name))) + Expect(createdFleet).NotTo(BeNil()) + Expect(createdFleet.Name).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(createdFleet.Name).To(ContainSubstring(strings.ToLower(m2.Name))) + Expect(createdFleetAutoscaler).NotTo(BeNil()) + Expect(createdFleetAutoscaler.Name).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(createdFleetAutoscaler.Name).To(ContainSubstring(strings.ToLower(m2.Name))) + Expect(createdFleet.Validate(testing.FakeAPIHooks{})).To(BeNil()) + Expect(createdFleetAutoscaler.Validate()).To(BeNil()) + }) + }) + + When("name doesn't change", func() { + It("should update for all dimension", func() { + m2.Name = m.Name + req.OptionalName = &pb.EditMapRequest_Name{ + Name: m2.Name, + } + mockAgones.AgonesClient.AddReactor("update", "fleets", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ua := action.(k8stesting.UpdateAction) + updatedFleet = ua.GetObject().(*agonesv1.Fleet) + return true, updatedFleet, nil + }) + mockAgones.AgonesClient.AddReactor("update", "fleetautoscalers", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { + ua := action.(k8stesting.UpdateAction) + updatedFleetAutoscaler = ua.GetObject().(*autoscalingv1.FleetAutoscaler) + return true, updatedFleetAutoscaler, fakeErr + }) + + out, err := server.EditMap(incAdminCtx, req) + Expect(err).To(HaveOccurred()) + Expect(out).NotTo(BeNil()) + + Expect(updatedFleet).NotTo(BeNil()) + Expect(updatedFleet.Name).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(updatedFleet.Name).To(ContainSubstring(strings.ToLower(m.Name))) + Expect(updatedFleetAutoscaler).NotTo(BeNil()) + Expect(updatedFleetAutoscaler.Name).To(ContainSubstring(strings.ToLower(dimension.Name))) + Expect(updatedFleetAutoscaler.Name).To(ContainSubstring(strings.ToLower(m.Name))) + Expect(updatedFleet.Validate(testing.FakeAPIHooks{})).To(BeNil()) + Expect(updatedFleetAutoscaler.Validate()).To(BeNil()) + }) }) }) })