diff options
| author | historia <[not public]> | 2026-09-18 16:13:49 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-18 16:13:49 -0400 |
| commit | 194164a77eb4f2479b94c19e6f0e1278ab608781 (patch) | |
| tree | 53413add8ed6f32a34d1733397e380cc98ef70ef /internal/game/room_write.go | |
| parent | 67e01aab85607b9e601185c7d62dff576af3bb43 (diff) | |
| download | thehouseoficarus-194164a77eb4f2479b94c19e6f0e1278ab608781.tar.gz | |
fix: more casino, economy, gameplay, security, and world data hardening gaps
Diffstat (limited to 'internal/game/room_write.go')
| -rw-r--r-- | internal/game/room_write.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/game/room_write.go b/internal/game/room_write.go new file mode 100644 index 0000000..5ba24c1 --- /dev/null +++ b/internal/game/room_write.go @@ -0,0 +1,13 @@ +package game + +import ( + "thehouseoficarus/internal/persistence" +) + +// writeRoomFile durably writes an authored world/content file: temp file + +// rename + directory fsync. The in-game admin room commands previously used a +// bare os.WriteFile, which can truncate world data if the process dies +// mid-write. +func writeRoomFile(path string, data []byte) error { + return persistence.WriteFile(path, data, 0644) +} |
