From 194164a77eb4f2479b94c19e6f0e1278ab608781 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 18 Sep 2026 16:13:49 -0400 Subject: fix: more casino, economy, gameplay, security, and world data hardening gaps --- internal/game/room_write.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 internal/game/room_write.go (limited to 'internal/game/room_write.go') 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) +} -- cgit v1.2.3