Add audited admin player item and title management
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user