diff --git a/app/resources/server/db.go b/app/resources/server/db.go index 9ab792f697..ea0740b762 100644 --- a/app/resources/server/db.go +++ b/app/resources/server/db.go @@ -40,8 +40,8 @@ func (s *DB) Upsert(ctx context.Context, e All) error { Update( db.Server.IP.Set(e.IP), db.Server.Hn.Set(e.Core.Hostname), - db.Server.Pc.Set(e.Core.Players), - db.Server.Pm.Set(e.Core.MaxPlayers), + db.Server.Pc.Set(db.BigInt(e.Core.Players)), + db.Server.Pm.Set(db.BigInt(e.Core.MaxPlayers)), db.Server.Gm.Set(e.Core.Gamemode), db.Server.La.Set(e.Core.Language), db.Server.Pa.Set(e.Core.Password), @@ -60,14 +60,14 @@ func (s *DB) Upsert(ctx context.Context, e All) error { if svr, err = s.client.Server.CreateOne( db.Server.IP.Set(e.IP), db.Server.Hn.Set(e.Core.Hostname), - db.Server.Pc.Set(e.Core.Players), - db.Server.Pm.Set(e.Core.MaxPlayers), + db.Server.Pc.Set(db.BigInt(e.Core.Players)), + db.Server.Pm.Set(db.BigInt(e.Core.MaxPlayers)), db.Server.Gm.Set(e.Core.Gamemode), db.Server.La.Set(e.Core.Language), db.Server.Pa.Set(e.Core.Password), db.Server.Vn.Set(e.Core.Version), - db.Server.Omp.Set(e.Core.IsOmp), db.Server.Active.Set(e.Active), + db.Server.Omp.Set(e.Core.IsOmp), db.Server.Domain.SetOptional(e.Domain), db.Server.Description.SetOptional(e.Description), db.Server.Banner.SetOptional(e.Banner), diff --git a/app/resources/server/model.go b/app/resources/server/model.go index bec3d3a967..cf16a471bb 100644 --- a/app/resources/server/model.go +++ b/app/resources/server/model.go @@ -27,8 +27,8 @@ type All struct { type Essential struct { IP string `json:"ip"` Hostname string `json:"hn"` - Players int `json:"pc"` - MaxPlayers int `json:"pm"` + Players int64 `json:"pc"` + MaxPlayers int64 `json:"pm"` Gamemode string `json:"gm"` Language string `json:"la"` Password bool `json:"pa"` @@ -90,8 +90,8 @@ func dbToAPI(r db.ServerModel) *All { Core: Essential{ IP: r.IP, Hostname: r.Hn, - Players: r.Pc, - MaxPlayers: r.Pm, + Players: int64(r.Pc), + MaxPlayers: int64(r.Pm), Gamemode: r.Gm, Language: r.La, Password: r.Pa, diff --git a/app/resources/server/transform.go b/app/resources/server/transform.go index b78384ec72..5bc12e37b1 100644 --- a/app/resources/server/transform.go +++ b/app/resources/server/transform.go @@ -32,8 +32,8 @@ func TransformQueryResult(s sampquery.Server, err error) (r All) { r.Core = Essential{ IP: s.Address, Hostname: s.Hostname, - Players: s.Players, - MaxPlayers: s.MaxPlayers, + Players: int64(s.Players), + MaxPlayers: int64(s.MaxPlayers), Gamemode: s.Gamemode, Language: s.Language, Password: s.Password,