aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-07-09 17:54:11 -0400
committerhistoria <[not public]>2026-07-09 17:54:35 -0400
commit18c7af94b30c2767b6633d050324c1db34074ce2 (patch)
tree84755755a028fe1d8ace94b247993064196c7bbb
parent7ea40cbd00f7ddae53a8e43dd018d62ca798f8cf (diff)
downloadthehouseoficarus-18c7af94b30c2767b6633d050324c1db34074ce2.tar.gz
feat(admin): remove unused undo history on server boot
-rw-r--r--data/.admin_history.json1
-rw-r--r--internal/admin/undo.go5
2 files changed, 1 insertions, 5 deletions
diff --git a/data/.admin_history.json b/data/.admin_history.json
deleted file mode 100644
index 7198539..0000000
--- a/data/.admin_history.json
+++ /dev/null
@@ -1 +0,0 @@
-{"history":[{"time":"2026-07-09T17:47:14-04:00","description":"unlink 2006 east 2005","file_path":"data/rooms/intro/2006.yaml","old_content":"block_transport: false\ndescription:\n - text: It's a test room\nexits:\n east:\n room: 2005\n north:\n room: 2001\nname: Test Room\n","new_content":"id: 2006\nname: Test Room\ncolor: \"\"\ndescription:\n - text: It's a test room\nexits:\n north:\n room: 2001\nobjects: []\nitem_spawns: []\nmobs: []\non_enter: []\nhazard: \"\"\nblock_transport: false\ntriggers: []\n","is_delete":false,"is_create":false},{"time":"2026-07-09T17:47:15-04:00","description":"unlink 2001 southeast 2005","file_path":"data/rooms/intro/2001.yaml","old_content":"id: 2001\nname: Test Room\ncolor: \"\"\ndescription:\n - text: It's a test room\nexits:\n east:\n room: 1005\n south:\n room: 2006\n southeast:\n room: 2005\n west:\n room: 1001\nobjects:\n - name: hidden guy\n hidden: true\n description:\n - text: YOU FOUND HIM\n - id: tree\nitem_spawns:\n - id: bronze_axe\n quantity: 1\n respawn_ticks: 1\n - id: pot_of_flour\n quantity: 1\n respawn_ticks: 1\n - id: bucket_of_water\n quantity: 1\n respawn_ticks: 1\nmobs:\n - id: man\non_enter: []\nhazard: \"\"\nblock_transport: false\ntriggers: []\n","new_content":"id: 2001\nname: Test Room\ncolor: \"\"\ndescription:\n - text: It's a test room\nexits:\n east:\n room: 1005\n south:\n room: 2006\n west:\n room: 1001\nobjects:\n - name: hidden guy\n hidden: true\n description:\n - text: YOU FOUND HIM\n - id: tree\nitem_spawns:\n - id: bronze_axe\n quantity: 1\n respawn_ticks: 1\n - id: pot_of_flour\n quantity: 1\n respawn_ticks: 1\n - id: bucket_of_water\n quantity: 1\n respawn_ticks: 1\nmobs:\n - id: man\non_enter: []\nhazard: \"\"\nblock_transport: false\ntriggers: []\n","is_delete":false,"is_create":false}],"redo":null} \ No newline at end of file
diff --git a/internal/admin/undo.go b/internal/admin/undo.go
index 53af942..5e1e6a3 100644
--- a/internal/admin/undo.go
+++ b/internal/admin/undo.go
@@ -66,14 +66,11 @@ type UndoStack struct {
}
func NewUndoStack(dataDir string) *UndoStack {
- us := &UndoStack{
+ return &UndoStack{
dataDir: dataDir,
maxSize: 100,
filePath: filepath.Join(dataDir, ".admin_history.json"),
}
- us.load()
- us.redo = nil
- return us
}
func (us *UndoStack) Push(desc ChangeDesc) {