Skip to content

Announce v1 homes at startup and on join when nothing has been imported yet #54

Description

@milanmalhotra

Part of #41.

An admin who upgrades from Set Homes v1 and reads nothing sees an empty homes list on first boot. plugins/SetHomes/homes.yml is sitting there full of homes and the server says nothing about it. The first anyone hears of it is a player asking where their homes went.

Auto-import on enable was the original proposal for this and was rejected in #41: the config half of the migration cannot be automated anyway, a silent import makes a dropped home impossible to surface, and plugin-managed worlds are not loaded at our onEnable, so an automatic run would skip every home in a Multiverse world and record the migration as done. What auto-import was really buying is that nobody discovers the problem from player complaints. This is the replacement for that.

What to build

In onEnable, once the database connection is up: if plugins/SetHomes/homes.yml exists and holds at least one home, and our players_homes table is empty, log a prominent block naming the file, how many homes were found, and /import-homes sethomes.

Send the same notice in chat on join to any player holding sh2.import-homes, because plenty of admins never read the console.

Both stop as soon as our database holds a home.

Deliberately not a marker file. "The database has no homes" is the condition that matters, it is re-read every time, and it needs no new state on disk.

Notes

  • Ordering: this runs after the v1 jar refusal in Refuse to enable when Set Homes v1 is installed alongside #53, which owns the top of onEnable.
  • Every join versus once per session is open. Every join is the suggested default, since the condition clears itself the moment any home exists, and an admin who joins once and misses the line has no second chance otherwise.
  • The message needs a UserInfo default and a config key, per the repo's pattern for user-facing text.

Acceptance criteria

  • A server with a v1 homes.yml holding homes and an empty database logs the block at startup, naming the file, the count and the command.
  • The same notice reaches a joining player holding sh2.import-homes.
  • Nothing is logged or sent once the database holds a home.
  • Nothing is logged or sent when plugins/SetHomes/homes.yml is absent, or present but holding no homes.
  • The text has a UserInfo default and a config key, and the README config table lists the key.
  • The README migration section describes the notice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions