Skip to content

chore: remove the announcement system - #832

Merged
darbyjack merged 2 commits into
masterfrom
chore/remove-announcements
Oct 5, 2026
Merged

darbyjack merged 2 commits into
masterfrom
chore/remove-announcements

Conversation

@darbyjack

@darbyjack darbyjack commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Removes the announcement system: the plugin fetched a message from
glaremasters.me on startup and again the first time each operator joined,
shown as a chat line with a hover. The backend is no longer maintained, so
this is now a remote call that can only fail, and it fails quietly.

-if (settingsHandler.getMainConf().getProperty(PluginSettings.ANNOUNCEMENTS_CONSOLE)) {
-    newChain().async(() -> {
-        try {
-            LoggingUtils.info(StringUtils.getAnnouncements(this));
-        } catch (IOException e) {
-            LoggingUtils.warn("Unable to fetch console announcements.", e);
-        }
-    }).execute();
-}

Four things go, in dependency order:

  • the fetch at startup in Guilds.onEnable
  • the same fetch on operator join in PlayerListener.onJoin, plus the
    informed set that tracked who had already seen it
  • both config keys, settings.announcements.console and
    settings.announcements.in-game, and the comment above them
  • StringUtils.getAnnouncements and convert_html

convert_html had already been reduced to a single replace('&', '§') in
#808, once that left it a single caller. That caller was this.

Not the war announcer

announceWinner and announceDeath in ChallengeHandler are unrelated and
untouched. Those broadcast to the guilds in a war; they never touched the
network. The names collide, which is why they are called out here rather than
left for a reviewer to work out from the diff.

Config migration

The second commit. Removing a property from a SettingsHolder does not
remove it from a server owner's existing config.yml, and I checked rather
than assuming:

PROBE contains(settings.announcements.console) = true
PROBE needsMigration = false

So without help, the block would sit there unread forever. A server owner who
had deliberately set in-game: false would have no way to tell that the
setting no longer does anything.

GuildsMigrationService already has a list for exactly this, and its own
comment states the rule: only paths that no longer exist in any SettingsHolder
belong here
. settings.announcements now qualifies, so it is added.

         String[] deprecatedProperties = {
                 ...
+                "settings.announcements",

ConfigMe rewrites the file when a migration is detected, which drops the block
once and never again. That rewrite also strips admin comments and custom keys,
which is the cost of cleaning up and the reason it must happen exactly once.
The suite already pins both halves of that, and both still pass:

GuildsMigrationServiceTest > a leftover announcement block is cleaned up by a migration PASSED
GuildsMigrationServiceTest > a config a server owner edited does not trigger a migration either PASSED
GuildsMigrationServiceTest > a freshly generated default config does not trigger a migration PASSED
GuildsMigrationServiceTest > a genuinely deprecated path still triggers a migration PASSED
GuildsMigrationServiceTest > the sethome cooldown is a live setting, not a deprecated path PASSED
GuildsMigrationServiceTest > an inlined tiers section still triggers a migration PASSED

The third of those is the important one: a fresh install must not migrate, or
every startup would rewrite the file.

Evidence

Nothing in src/main references the feature any more:

$ git grep -c -i "getAnnouncements\|ANNOUNCEMENTS_\|convert_html" -- src/main
(no matches)

Exactly the four classes that changed appear in the jar, and no entry is added
or removed:

entries before/after: 2257 2257
changed entries: 4
  ~ me/glaremasters/guilds/Guilds.class
  ~ me/glaremasters/guilds/configuration/sections/PluginSettings.class
  ~ me/glaremasters/guilds/listeners/PlayerListener.class
  ~ me/glaremasters/guilds/utils/StringUtils.class

Suites pass, including the two that guard the supported-version floor:

$ ./gradlew check testJava11 legacyApiProbe --rerun-tasks
BUILD SUCCESSFUL in 9s

The e2e fixture had console: false and in-game: false set, with a comment
explaining they kept bot chat buffers free of plugin chatter. Those keys no
longer exist, so the block is removed. The tests themselves never asserted on
announcements, only on the absence of other plugin chatter.

Server owner impact

  • No announcement line in the console at startup.
  • No hoverable chat message when an operator first joins.
  • settings.announcements disappears from config.yml on the next boot, once.
    That rewrite also strips comments and custom keys from the file, which is
    worth knowing if you keep notes in there.

Leftover, deliberately

PremiumFun is now uncalled. It reads SpigotMC's premium-download placeholders
(%%__USER__%% and friends) and existed only to build the announcement URL, so
removing the announcements orphaned it. I have left it in place because it is
the premium-licensing shim rather than part of this feature, and deleting it
belongs in its own change. Nothing references it, so it is inert.

Merge Danger

Door: two-way. Two commits, no additions, so revert restores every file
exactly.

Blast Radius: startup output, one operator chat message, and one config
rewrite for existing installs.

  • No behaviour a player or server owner depends on is removed. The feature was
    a notification channel to a backend that is no longer running.
  • The config rewrite is the one thing to be aware of. It is the existing
    migration mechanism doing what it is designed to do, it fires once, and it
    is the same cost every previously deprecated path already imposed.

The plugin fetched a message from glaremasters.me on startup and again for
each operator's first join, hovering over a chat line. The backend is no
longer maintained, so this is a remote call that can only ever fail, and it
fails silently: getAnnouncements catches every exception and returns "Could
not fetch announcements!".

Removes the fetch itself, the two config keys that gated it, and
convert_html, which existed only to translate the response and had already
been reduced to a single replace call in #808 once that left one caller.

The war announcer is untouched. announceWinner and announceDeath broadcast
to the guilds in a war and are unrelated to the backend.

Leftover for a follow-up: PremiumFun is now uncalled. It reads SpigotMC's
premium-download placeholders and existed only for the announcement URL, but
it is the premium-licensing shim rather than part of this feature, so it is
left alone here.
Removing the properties from PluginSettings does not remove them from a
server owner's existing config.yml. Verified rather than assumed: with the
keys gone, a config still carrying settings.announcements.console is read
back fine but triggers no migration, so the block would sit there unread
indefinitely. A server owner who had set in-game to false would have no way
to tell that it no longer does anything.

Adds settings.announcements to the deprecated list in GuildsMigrationService,
which is what that list is for: its own comment says only paths that no longer
exist in any SettingsHolder belong there. ConfigMe rewrites the file when a
migration is detected, so the block is dropped once and never again.

The rewrite strips admin comments and custom keys, which is the cost of
cleaning this up and the reason it happens exactly once. The suite already
pins both halves of that: a freshly generated default config must not trigger
a migration, and an edited one must not either.
@darbyjack
darbyjack merged commit b63a565 into master Oct 5, 2026
1 of 2 checks passed
@darbyjack
darbyjack deleted the chore/remove-announcements branch October 5, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant