diff --git a/acsr.go b/acsr.go index 9444de923..f6a6560b0 100644 --- a/acsr.go +++ b/acsr.go @@ -15,7 +15,8 @@ import ( // Sends a championship to ACSR, called OnEndSession and when a championship is created func ACSRSendResult(championship Championship) { - if config == nil || (config.ACSR.APIKey == "" || config.ACSR.AccountID == "" || !config.ACSR.Enabled) || len(championship.Events) == 0 { + if config == nil || (config.ACSR.APIKey == "" || config.ACSR.AccountID == "" || !config.ACSR.Enabled) || + len(championship.Events) == 0 || IsPremium != "true" { return } @@ -58,9 +59,17 @@ func ACSRSendResult(championship Championship) { return } + geoIP, err := geoIP() + + if err != nil { + logrus.WithError(err).Error("couldn't get server geoIP for acsr request") + return + } + q := req.URL.Query() q.Add("baseurl", config.HTTP.BaseURL) q.Add("guid", config.ACSR.AccountID) + q.Add("geoip", geoIP.CountryName) req.URL.RawQuery = q.Encode() req.Header.Set("Content-Type", "application/json") diff --git a/cmd/server-manager/views/pages/championships/new.html b/cmd/server-manager/views/pages/championships/new.html index ea613844e..72110c447 100644 --- a/cmd/server-manager/views/pages/championships/new.html +++ b/cmd/server-manager/views/pages/championships/new.html @@ -73,9 +73,22 @@

-

+ + {{ if ne $.RaceTemplateVars.BaseTemplateVars.IsPremium "true" }} + + Exporting to ACSR is a premium feature! You can access premium features by + renting a server or + going premium with a minimum $10 donation, + thanks very much! + + +
+
+ {{ end }} + If enabled then entrants in this championship will be (anonymously) tracked by our skill and safety rating system! This championship will also be made publicly available for people to sign up from