diff --git a/.gitignore b/.gitignore index f1c181e..fd6223a 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,10 @@ # Output of the go coverage tool, specifically when used with LiteIDE *.out + +# Editor / MAC files +*.sublime-* +*.iml +.idea/ +.DS_Store +Thumbs.db diff --git a/README.md b/README.md index 36ece24..2e12d0d 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,7 @@ go-svrquery is a [Go](http://golang.org/) client for talking to game servers usi Features -------- * Support for various game server query protocol's including: -** Titanfall -* Supports per protocol custom [netdata](https://github.com/netdata/netdata) graphs as required by [go.d.plugin](https://github.com/netdata/go.d.plugin) which is based on the [go-orchestrator plugin framework](https://github.com/netdata/go-orchestrator). +** SQP, TF2E Installation ------------ diff --git a/go.mod b/go.mod index ec8af0f..6506bb1 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module github.com/multiplay/go-svrquery go 1.13 require ( - github.com/netdata/go-orchestrator v0.0.0-20200917191103-724cb40df90f github.com/stretchr/objx v0.3.0 // indirect github.com/stretchr/testify v1.7.0 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect diff --git a/go.sum b/go.sum index c2d9e5a..1226ffb 100644 --- a/go.sum +++ b/go.sum @@ -1,30 +1,16 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/gofrs/flock v0.8.0/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/ilyam8/hashstructure v1.1.0/go.mod h1:LoLuwBSNpZOi3eTMfAqe2i4oW9QkI08e6g1Pci9h7hs= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/netdata/go-orchestrator v0.0.0-20200917191103-724cb40df90f h1:xI3KtIDIgWHuFNwkZIbfj9sRQZNs9AOEuyOfXQRJ7ic= -github.com/netdata/go-orchestrator v0.0.0-20200917191103-724cb40df90f/go.mod h1:MaUAHYG6wSsTvYbesOJpDQo9WGEtPI89MZRaDJ4F6zo= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As= github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/lib/svrquery/protocol/interfaces.go b/lib/svrquery/protocol/interfaces.go index a4895e8..b227b0e 100644 --- a/lib/svrquery/protocol/interfaces.go +++ b/lib/svrquery/protocol/interfaces.go @@ -2,8 +2,6 @@ package protocol import ( "io" - - "github.com/netdata/go-orchestrator/module" ) // Queryer is an interface implemented by all svrquery protocols. @@ -28,15 +26,3 @@ type Client interface { Key() string Address() string } - -// Charter is an interface which is implemented by types which support custom netdata -// charts. -type Charter interface { - Charts(serverID int64) module.Charts -} - -// Collector is an interface which is implemented by Responsers that provide custom -// netdata metrics. -type Collector interface { - Collect(serverID int64, mx map[string]int64) -} diff --git a/lib/svrquery/protocol/titanfall/charts.go b/lib/svrquery/protocol/titanfall/charts.go deleted file mode 100644 index cae1495..0000000 --- a/lib/svrquery/protocol/titanfall/charts.go +++ /dev/null @@ -1,46 +0,0 @@ -package titanfall - -import ( - "github.com/multiplay/go-svrquery/lib/svrquery/common" - "github.com/netdata/go-orchestrator/module" -) - -var ( - charts = module.Charts{ - { - ID: "%d_frame_time", - Title: "Frame Time", - Ctx: "clanforge.frame_time", - Units: "milliseconds", - Fam: "serverid %d", - Type: module.Area, - Dims: module.Dims{ - {ID: "%d_avg_frame_time", Name: "average", Div: common.Dim3DP}, - {ID: "%d_max_frame_time", Name: "max", Div: common.Dim3DP}, - }, - }, - { - ID: "%d_user_cmd_time", - Title: "User Command Time", - Ctx: "clanforge.user_cmd_time", - Units: "milliseconds", - Fam: "serverid %d", - Type: module.Area, - Dims: module.Dims{ - {ID: "%d_avg_user_cmd_time", Name: "average", Div: common.Dim3DP}, - {ID: "%d_max_user_cmd_time", Name: "max", Div: common.Dim3DP}, - }, - }, - { - ID: "%d_phase", - Title: "Phase", - Ctx: "clanforge.phase", - Units: "Phase", - Fam: "serverid %d", - Type: module.Line, - Dims: module.Dims{ - {ID: "%d_phase", Name: "phase"}, - }, - }, - } -) diff --git a/lib/svrquery/protocol/titanfall/query.go b/lib/svrquery/protocol/titanfall/query.go index bd01281..af54264 100644 --- a/lib/svrquery/protocol/titanfall/query.go +++ b/lib/svrquery/protocol/titanfall/query.go @@ -11,7 +11,6 @@ import ( "github.com/multiplay/go-svrquery/lib/svrquery/common" "github.com/multiplay/go-svrquery/lib/svrquery/protocol" - "github.com/netdata/go-orchestrator/module" ) var ( @@ -326,24 +325,6 @@ func (q *queryer) clients(r *common.BinaryReader, i *Info) (err error) { return nil } -// Charts implements protocol.Charter. -func (q *queryer) Charts(serverID int64) module.Charts { - if q.c.Key() == "" { - return nil - } - - cs := *charts.Copy() - for _, c := range cs { - c.ID = fmt.Sprintf(c.ID, serverID) - c.Fam = fmt.Sprintf(c.Fam, serverID) - for _, d := range c.Dims { - d.ID = fmt.Sprintf(d.ID, serverID) - } - c.MarkNotCreated() - } - return cs -} - // serverInfoPkt returns a byte array of info request packet data. func (q *queryer) serverInfoPkt() []byte { return []byte{0xFF, 0xFF, 0xFF, 0xFF, ServerInfoRequest, q.version}