Skip to content

Feat: Add combine and prune commands #9

@Jaxkr

Description

@Jaxkr

Add two new commands to provisioner to simplify world management across a cluster:

  • combine: Merge all world region files into a single folder. Sync neighboring region files to each server. Used to create a single world from a Mammoth cluster and update areas nearby a server border while offline.
  • prune: remove irrelevant world files from each server. Skip deleting neighboring regions. Used to save space.

A "neighboring region" is the .mca region files immediately outside an area owned by the server. For example, if the following represents a mammoth slice grid the desired area to copy is represented in red
image

You can use logic from getDistanceFromSliceBoundary to determine if a certain region is near a server border. If the distance is <= 512 then it's worth copying.
This function is used to determine slice ownership: https://github.com/WorldQL/mammoth/blob/trunk/src/main/java/com/worldql/client/Slices.java#L172

Note: Note the logic about unslicedOrigins. That's used to avoid splitting the 0,0 area across multiple servers which is undesirable for projects with a dedicated spawn.

This function should be controlled using settings that mirror these options in Mammoth's config.yml and should also respect options for avoid-slicing-origin and origin-radius to make sure it copies information from the right server.

The following configuration options should be read from provisioner.toml and respected for the prune and combine commands:

  • server_count
  • world-diameter (new)
  • slice-width (new)
  • avoid-slicing-origin (new)
  • origin-radius (new)

Feel free to rename these new provisioner.toml options to whatever you please.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions