Commit Graph

92 Commits

Author SHA1 Message Date
MayaTheShy
173a0a9f95 Persist config files across Opus package updates
The Opus package manager deletes the entire package directory on
update (fs.delete(packageDir)) before re-downloading files. This
wiped all config files (.manager_config, .client_config, etc.) that
were stored inside packages/inventory-manager/.

Fix: add _configPath() helper to every program that resolves config
file paths to usr/config/inventory-manager/ when running under Opus,
which lives outside the package directory and survives updates.
Falls back to the local _path() for standalone (non-Opus) use.

Updated files:
- inventoryManager.lua, manager/config.lua, inventoryClient.lua,
  inventoryWebBridge.lua, dropperController.lua, craftingTurtle.lua
- .package install script: saves configs to usr/config/inventory-manager/
- autorun/startup.lua: checks both persistent and package dirs
- startup/client.lua: uses persistent dir for .client_setup/.dropper_config
- web/server/Dockerfile: switch health check to wget (from prior fix)
2026-03-22 20:51:31 -04:00
MayaTheShy
381951bd91 fix: clear boot window to prevent future monitor write interference 2026-03-22 19:00:39 -04:00
MayaTheShy
64b3e4b069 debug: log draw errors instead of silent pcall swallowing 2026-03-22 18:52:23 -04:00
MayaTheShy
c4acc2159e fix: prevent early return in parallel tasks from killing waitForAny
Task 12 (supply chest) and Task 13 (network) returned immediately
when not configured, which caused parallel.waitForAny to exit and
the entire program to silently stop after cache build.
2026-03-22 18:49:43 -04:00
MayaTheShy
a0740b81f5 debug: xpcall entire program body, write crash log to .crash.log
Error is now saved to disk even if the window closes instantly.
Uses xpcall with debug.traceback for full stack trace.
2026-03-22 18:47:15 -04:00
MayaTheShy
82d74a01b5 debug: wrap main() in pcall to show crash error before window closes 2026-03-22 18:44:46 -04:00
MayaTheShy
bb139b4afd fix: override dofile to preserve Opus env (require was nil in sub-modules)
CC:Tweaked dofile loads files with _G as environment, but Opus
injects require into the program's sandbox _ENV. All dofile'd
modules (especially display.lua) could not see require.

Also add dropperController to apps.db.
2026-03-22 18:40:03 -04:00
MayaTheShy
37e9b89057 feat: enhance inventory management with recursive crafting and supply chest functionality 2026-03-22 18:15:25 -04:00
MayaTheShy
d43662b2dc Refactor module loading to use dynamic base directory path 2026-03-22 16:07:33 -04:00
MayaTheShy
6760ca5e5d Refactor code structure for improved readability and maintainability 2026-03-22 11:38:41 -04:00
MayaTheShy
e1186ab532 Add remote reboot functionality via system channel 2026-03-22 03:15:47 -04:00
MayaTheShy
deeb70ba0d Buffer ORDER_CHANNEL messages in craftItem function to avoid re-queue bounce 2026-03-22 02:52:30 -04:00
MayaTheShy
7a277a86eb Enhance event handling in craftItem function and improve broadcastState function to include stateVersion 2026-03-22 02:41:36 -04:00
MayaTheShy
8ad05cdeb9 Refactor autoSmelt and autoCompost functions to use snapshots for catalogue iteration and improve command return values 2026-03-22 02:38:00 -04:00
MayaTheShy
24683f23a5 Implement idempotency for command handling to skip duplicates and enhance request processing 2026-03-22 02:12:50 -04:00
MayaTheShy
e9c0cc03f0 Implement idempotent command tracking with TTL for improved command handling 2026-03-22 02:12:08 -04:00
MayaTheShy
304e779fd0 Add log level configuration to enhance logging flexibility 2026-03-22 02:03:37 -04:00
MayaTheShy
50ec1ee6c2 Refactor main function to replace print statements with structured logging for improved debugging 2026-03-22 02:03:31 -04:00
MayaTheShy
33cad06155 Refactor main function to replace print statements with structured logging for improved clarity and debugging 2026-03-22 02:02:58 -04:00
MayaTheShy
e61a13961a Refactor touch handling to use structured logging for improved debugging 2026-03-22 02:02:19 -04:00
MayaTheShy
e017eb1009 Refactor logging to use structured logging for improved clarity and consistency 2026-03-22 02:02:15 -04:00
MayaTheShy
0e4d184059 Add structured logging functionality to inventory manager 2026-03-22 01:59:08 -04:00
MayaTheShy
39b95b3663 Refactor crafting helpers to delegate functionality to shared UI module 2026-03-22 01:56:40 -04:00
MayaTheShy
8cdb2d3b98 Refactor dashboard drawing functions to use setDrawTarget for improved clarity 2026-03-22 01:56:34 -04:00
MayaTheShy
338af14b6b Refactor drawing helpers to utilize shared UI module functions 2026-03-22 01:56:15 -04:00
MayaTheShy
50fa771ca4 Refactor touch zone functions to utilize shared UI helpers 2026-03-22 01:56:07 -04:00
MayaTheShy
4dc06184de Refactor monitor setup functions to use shared UI helpers 2026-03-22 01:55:47 -04:00
MayaTheShy
7404e73fd3 Refactor smelting and composting logic: load data tables from external files for better maintainability 2026-03-22 01:54:44 -04:00
MayaTheShy
d80b0b155e Enhance network state management: skip broadcasting if state has not changed and update state version on configuration changes 2026-03-22 01:41:44 -04:00
MayaTheShy
1198c2e73a Enhance cache management: integrate state version bumping in refreshCache function 2026-03-22 01:40:31 -04:00
MayaTheShy
7ad68885d3 Enhance inventory management: add scanInventory function and improve furnace status refresh 2026-03-22 01:40:13 -04:00
MayaTheShy
491abf891f Enhance inventory scanning: integrate state version bumping in scanInventory function 2026-03-22 01:40:09 -04:00
MayaTheShy
2bcb907914 Enhance state management: implement version tracking and conditional broadcasting for configuration updates 2026-03-22 01:40:04 -04:00
MayaTheShy
b2c635b7ef Enhance configuration loading: implement file existence check and JSON parsing for dynamic settings 2026-03-22 01:38:51 -04:00
MayaTheShy
bd3159cd39 Enhance peripheral handling: implement detach handler to invalidate cached handles 2026-03-22 01:37:22 -04:00
MayaTheShy
4637275529 Enhance peripheral handling: implement caching for peripheral wraps to improve performance 2026-03-22 01:36:45 -04:00
MayaTheShy
98f8157bea Enhance crafting functionality: implement modem communication for turtle crafting requests and responses 2026-03-22 01:28:50 -04:00
MayaTheShy
a2f7df448c Add client dropper registration and merging functionality 2026-03-21 20:36:58 -04:00
MayaTheShy
a3d0a46b44 Enhance dropper detection logic: implement name-based matching for improved compatibility with CC:Tweaked versions 2026-03-21 20:31:24 -04:00
MayaTheShy
75f785d8da Add support for multiple droppers: discover and cache available dropper peripherals for location-based dispensing 2026-03-21 19:41:52 -04:00
MayaTheShy
5bad9a1e71 Increase smelt and compost reserves for improved resource management and add trash items for composting 2026-03-16 22:25:38 -04:00
MayaTheShy
1abd6b4165 Add error handling for network order and craft message transmissions 2026-03-16 22:09:04 -04:00
MayaTheShy
32eaa2db3d Enhance autoSmelt function for balanced distribution of smeltable items across empty furnaces 2026-03-16 20:51:13 -04:00
MayaTheShy
9e1852a219 Optimize smelting process by pre-building furnace compatibility sets and using sorted candidate lists for improved efficiency 2026-03-16 19:21:44 -04:00
MayaTheShy
594d8c954c Implement lazy rebuild for itemList and enhance peripheral caching for improved performance 2026-03-16 18:56:34 -04:00
MayaTheShy
10edbe8fff Enhance autoSmelt function by adding cache adjustments for item movements 2026-03-16 18:41:15 -04:00
MayaTheShy
4faf8469e3 Update defrag interval to 10 minutes for improved performance 2026-03-16 18:34:31 -04:00
MayaTheShy
e6debef4fd Update smeltable items to restrict certain ores to regular furnace only 2026-03-16 18:31:48 -04:00
MayaTheShy
7699276c22 Remove bamboo from compostable items list 2026-03-16 00:46:54 -04:00
MayaTheShy
08f6f12764 Improve error handling in craftItem function with pcall for safer execution 2026-03-16 00:40:43 -04:00