Add audited admin player item and title management

This commit is contained in:
dingo
2026-09-08 07:20:18 -04:00
parent ed55cd23ab
commit ece92fa65c
15 changed files with 512 additions and 8 deletions
+11
View File
@@ -1,6 +1,7 @@
package transport
import (
"aeternalis/server/internal/game"
"context"
"errors"
"net/http"
@@ -100,6 +101,16 @@ func (h *HTTP) portalRoutes(mux *http.ServeMux) {
return
}
switch req.Op {
case "grant-item", "remove-item":
if _, _, err := game.ParseItemChange(req.Value); err != nil {
fail(w, 400, err.Error())
return
}
case "grant-title", "revoke-title":
if !regexp.MustCompile(`^[a-z][a-z0-9_-]{0,63}$`).MatchString(req.Value) {
fail(w, 400, "choose a title")
return
}
case "create-world":
if h.Provisioner == nil {
fail(w, 503, "GitOps provisioning is not configured")