Repository navigation
Register realm OOC chat when SimpleFactions enables after RPCharacters - #78
Conversation
RPCharacters only registered the simplefactions:realm recipient resolver if SimpleFactions was already enabled during onEnable. SimpleFactions depends on RPCharacters, so it always enables later and /rooc never had a resolver: every message reached nobody. RealmChatDependencyListener registers the resolver at startup when SimpleFactions is already up, on SimpleFactions' PluginEnableEvent, and removes it on PluginDisableEvent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughRPCharacters now uses a dependency listener to manage the SimpleFactions realm-chat recipient resolver. The listener handles startup availability and plugin enable and disable events. Tests cover resolver registration and removal in these cases. ChangesRealm-chat resolver lifecycle
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant RPCharacters
participant RealmChatDependencyListener
participant PluginManager
participant ResolverRegistry
RPCharacters->>RealmChatDependencyListener: registerIfPresent()
RealmChatDependencyListener->>PluginManager: Check whether SimpleFactions is enabled
PluginManager-->>RealmChatDependencyListener: Enabled status
RealmChatDependencyListener->>ResolverRegistry: Register realm resolver when enabled
PluginManager->>RealmChatDependencyListener: Dispatch SimpleFactions disable event
RealmChatDependencyListener->>ResolverRegistry: Unregister realm resolver
Merge Risk: ⚪ Minimal · up to The change appears ready to merge after normal checks; no unresolved realm-chat lifecycle issue is established.
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 |
What changes
/rooc(realm OOC chat) has never delivered a message on Main. Senders get "No one can hear you in this channel." and the console logsNo chat recipient resolver registered for 'simplefactions:realm' (channel rooc)(once per session, e.g. 2026-10-02, 2026-10-04 and 2026-10-07; all seven/roocuses in the last week failed).onEnableonly registered thesimplefactions:realmresolver if SimpleFactions was already enabled. SimpleFactions depends on RPCharacters, so it always enables afterwards (on Main RPCharacters enables atlatest.logline 2541, SimpleFactions at 2573) and the resolver was never registered.RealmChatDependencyListenerregisters the resolver when SimpleFactions enables (PluginEnableEvent), the same wayPermadeathDependencyListenerhandles the permadeath bridge. It still registers at startup if SimpleFactions is already up (e.g. after a plugin reload)./roocnever calls into a disabled plugin.onDisableuses the sharedRESOLVER_IDconstant.No config, message or command changes.
Tests
RealmChatDependencyListenerTest: no SimpleFactions → no resolver; SimpleFactions enabling after RPCharacters → realm members resolve; startup with SimpleFactions already enabled → resolves; SimpleFactions disabling → resolver removed; another plugin enabling → nothing.RealmChatDependencyListenerTest,RealmOocChatRecipientResolverTest,ChatRecipientResolverRegistryTest,RPCharactersStartupTest,RPCharactersLifecycleTest(21 tests).🤖 Generated with Claude Code