fix(autostart): v0.68 game-agnostic YAML autostarts, wayto overrides, and double-start guard#2310
Conversation
The generic autostart loop (Settings['scripts'] / CharSettings['scripts']) did not check Script.running? before calling Script.start. On DragonRealms, the DR-specific autostart loop (UserVars + YAML autostarts) already starts scripts with a running? guard. If a script appeared in both registries, it would start twice on every login. Add `next if Script.running?(script_info[:name])` before Script.start in the generic loop, matching the guard already present in the DR loop. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- before(:each) -> before (RSpec default) - Trim verbose comment in dedup test to two lines Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…gnostic The YAML profile autostart loop, UserVars.autostart_scripts merge, and Map.apply_wayto_overrides were gated behind `if XMLData.game =~ /^DR/` but the underlying infrastructure (get_settings, SetupFiles, Map) is game-agnostic. This extracts them above the DR gate so GS characters can use YAML profiles and wayto overrides by creating profile files in scripts/profiles/. Also adds a visible warning when a configured autostart script is not found on disk, so typos and missing downloads are surfaced at login instead of silently skipped. The DR block is simplified to only dependency startup and the legacy first-run install path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
mrhoribu
left a comment
There was a problem hiding this comment.
Forgot to bump version of the script in the header, other than that and the one comment I left, looks good.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
next if Script.running?(script_info[:name])guard to the generic autostart loop to prevent double-startsUserVars.autostart_scripts, andMap.apply_wayto_overridesout from behind theif XMLData.game =~ /^DR/gate -- these features are now game-agnosticProblem
Double-start bug: The DR autostart loop (lines 138-163) guarded with
Script.running?, but the generic Lich autostart loop (lines 197-227) did not. Scripts in both registries started twice on every login.DR-only gate: YAML profile autostarts (
get_settings.autostarts),UserVars.autostart_scripts, andMap.apply_wayto_overrideswere gated behindif XMLData.game =~ /^DR/despite all underlying infrastructure (get_settings,SetupFiles,Map) being game-agnostic. GS characters could not use YAML profiles for autostarts or wayto overrides.Silent failures: When a script configured in YAML profiles or
UserVars.autostart_scriptsdid not exist on disk, it was silently skipped with no feedback to the user.Changes
scripts/autostart.licUserVars.autostart_scripts+get_settings.autostarts(deduplicated)Map.apply_wayto_overridesif availablerespond_to?(:get_settings, true)-- no game checkdependencyfor runtime helpers + legacy first-run install pathScript.running?guard to prevent double-startsspec/autostart/autostart_spec.rbTest plan
rubocop scripts/autostart.lic spec/autostart/autostart_spec.rb-- 0 offensesrspec spec/autostart/autostart_spec.rb-- 50 examples, 0 failuresscripts/profiles/<CharName>-setup.yamlwithautostarts:array): starts configured scripts🤖 Generated with Claude Code