Skip to content

Commit c6ed103

Browse files
committed
Update /api/stats
1 parent a465335 commit c6ed103

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

pkg/core/config.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,9 @@ import (
99
)
1010

1111
type Config struct {
12-
Port int `json:"port"`
13-
Debug bool `json:"debug"`
14-
Version string `json:"version"`
15-
DevBuildVersion string `json:"dev_build_version"`
16-
McVersion string `json:"mc_version"`
17-
DevBuildMcVersion string `json:"dev_build_mc_version"`
18-
BaritoneMcVersion string `json:"baritone_mc_version"`
19-
MaxDevBuilds int `json:"max_dev_builds"`
20-
Changelog []string `json:"changelog"`
12+
Port int `json:"port"`
13+
Debug bool `json:"debug"`
14+
BaritoneMcVersion string `json:"baritone_mc_version"`
2115
}
2216

2317
type PrivateConfig struct {

pkg/db/global.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ import (
77
)
88

99
type Global struct {
10-
Downloads int `bson:"downloads"`
11-
TotalAccounts int `bson:"totalAccounts"`
12-
SupportMessage int64 `bson:"supportMessage"`
13-
DevBuild string `bson:"devBuild"`
14-
DevBuildVersion string `bson:"devBuildVersion"`
10+
Downloads int `bson:"downloads"`
11+
TotalAccounts int `bson:"totalAccounts"`
12+
SupportMessage int64 `bson:"supportMessage"`
1513
}
1614

1715
var cache Global
@@ -31,7 +29,3 @@ func GetGlobal() Global {
3129

3230
return cache
3331
}
34-
35-
func SetDevBuild(devBuild string) {
36-
_, _ = global.UpdateOne(nil, bson.M{"id": "Stats"}, bson.M{"$set": bson.M{"devBuild": devBuild}})
37-
}

pkg/web/api/stats.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@ type Stats struct {
2121
core.Config
2222

2323
Date string `json:"date"`
24-
DevBuild string `json:"devBuild"`
2524
Downloads int `json:"downloads"`
2625
OnlinePlayers int `json:"onlinePlayers"`
27-
OnlineUUIDs int `json:"onlineUUIDs"`
2826

2927
Builds map[string]int `json:"builds"`
3028
}
@@ -52,7 +50,6 @@ func StatsHandler(w http.ResponseWriter, r *http.Request) {
5250
core.Json(w, Stats{
5351
Config: core.GetConfig(),
5452
Date: core.GetDate(),
55-
DevBuild: g.DevBuild,
5653
Downloads: g.Downloads,
5754
OnlinePlayers: GetPlayingCount(),
5855
Builds: builds,

0 commit comments

Comments
 (0)