From 27965129dce1825f2272aed60f14bcdd1ce096d5 Mon Sep 17 00:00:00 2001 From: pg9182 <96569817+pg9182@users.noreply.github.com> Date: Sat, 15 Oct 2022 10:17:41 -0400 Subject: pkg/api/api0: Fix playerCount and maxPlayers server value updates I seem to have been a little short on sleep... --- pkg/api/api0/server.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'pkg') diff --git a/pkg/api/api0/server.go b/pkg/api/api0/server.go index 3c748a2..bb25790 100644 --- a/pkg/api/api0/server.go +++ b/pkg/api/api0/server.go @@ -245,10 +245,11 @@ func (h *Handler) handleServerUpsert(w http.ResponseWriter, r *http.Request) { if n, err := strconv.ParseUint(r.URL.Query().Get("playerCount"), 10, 8); err == nil { if canCreate { - s.MaxPlayers = int(n) + s.PlayerCount = int(n) } if canUpdate { - s.MaxPlayers = int(n) + x := int(n) + u.PlayerCount = &x } } @@ -257,7 +258,8 @@ func (h *Handler) handleServerUpsert(w http.ResponseWriter, r *http.Request) { s.MaxPlayers = int(n) } if canUpdate { - s.MaxPlayers = int(n) + x := int(n) + u.MaxPlayers = &x } } } -- cgit v1.2.3