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
+17
View File
@@ -179,9 +179,26 @@ func (l *Lease) SaveCommand(ctx context.Context, w *game.World, claimID string,
if err = d.syncCharacters(ctx, tx, w, claimID); err != nil {
return err
}
if command != nil && outcome == "" && game.IsContentCommand(command.Op) {
outcome, err = d.applyContentCommand(ctx, tx, w, command)
if err != nil {
return err
}
}
if err = d.syncTitles(ctx, tx, w); err != nil {
return err
}
if command != nil && outcome == "" && command.Op == "grant-title" {
found := false
for _, award := range w.Characters[command.Target].View.Titles {
if award.ID == command.Value {
found = true
}
}
if !found {
outcome = "title's first claim belongs to another player"
}
}
// Rewrite the final payloads after the immutable award claims have resolved.
// The transaction already holds the owner, passage and character row locks.
data, err = json.Marshal(w)