Files
bdot1andClaude Opus 5.5 f679318d70 v1.15.0: drag and drop only - everything ships with WhoDidIt, no CMD for players
Holybunny tested it: players had to run CMD files to get half the addon,
the "not downloaded yet" prompt sent them to the sync helper (which then
read 2,929 raid logs for ~50 minutes), and the built-in Chronicle logger
started logging for someone who had switched ChronicleCompanion off.

- Chronicle\, RollFor\ and DopingControl\ now ship in the repository at
  their pinned commits, each with a WDI_NOTICE.txt crediting its authors
  (DopingControl keeps its MIT LICENSE; ChronicleCompanion and RollFor
  state no licence: not under WhoDidIt's MIT licence, removed on request).
  The maintainer's decision.
- the built-in Chronicle logger logs nothing until the player says yes
  (asked the first time they enter a raid, or Start logging); until then
  its auto-logging is off. If the separate ChronicleCompanion is installed
  but switched off, the built-in copy stays off too.
- no player is told to run a CMD any more: missing parts say "download
  WhoDidIt again"; raid times aren't counted as missing (they come from the
  master feed); the Rankings bar shows the feed for players, and Sync now /
  helper states only for the master's characters
- the sync helper and AutoSync are maintainer-only: they check the WTF
  folder for a B.MASTERS character and otherwise explain and stop (-Force
  overrides; AutoSync-Off works for anyone). The helper no longer installs
  addons; EmbedUpdate.ps1 is the maintainer tool for moving pins.
- README (install = drag and drop), CLAUDE.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 00:00:04 +01:00

70 lines
2.3 KiB
Lua

if WDI_CHRON_SKIP then return end -- File I/O abstraction for ChronicleCompanion
-- Wraps Nampower's CustomData file APIs (WriteCustomFile, ReadCustomFile, CustomFileExists)
ChronicleFile = {}
-------------------------------------------------------------------------------
-- File Operations
-------------------------------------------------------------------------------
--- Append content to a file (creates if doesn't exist)
-- @param filename string: File name (no path separators)
-- @param content string: Content to append
-- @return boolean: success
-- @return string|nil: error message on failure
function ChronicleFile:AppendToFile(filename, content)
if not WriteCustomFile then
return false, "WriteCustomFile not available (requires Nampower)"
end
local ok, err = pcall(WriteCustomFile, filename, content, "a")
if not ok then
return false, err
end
return true
end
--- Read entire file contents
-- @param filename string: File name (no path separators)
-- @return string|nil: file contents, or nil if doesn't exist
-- @return string|nil: error message on failure
function ChronicleFile:ReadFile(filename)
if not ReadCustomFile then
return nil, "ReadCustomFile not available (requires Nampower)"
end
local ok, result = pcall(ReadCustomFile, filename)
if not ok then
return nil, result
end
return result -- nil if file doesn't exist
end
--- Write content to a file (overwrites existing)
-- @param filename string: File name (no path separators)
-- @param content string: Content to write
-- @return boolean: success
-- @return string|nil: error message on failure
function ChronicleFile:WriteFile(filename, content)
if not WriteCustomFile then
return false, "WriteCustomFile not available (requires Nampower)"
end
local ok, err = pcall(WriteCustomFile, filename, content, "w")
if not ok then
return false, err
end
return true
end
--- Check if a file exists
-- @param filename string: File name (no path separators)
-- @return boolean: true if exists
function ChronicleFile:FileExists(filename)
if not CustomFileExists then
return false
end
local ok, result = pcall(CustomFileExists, filename)
if not ok then
return false
end
return result == true
end