LeafSleep¶
Cross-server, cross-platform sharded sequel to OnePlayerSleep for Paper, Spigot, Folia, Fabric, NeoForge, and Velocity.
Features¶
- Sharded Sleep State Machine (
ADR-001): Aggregates(eligibleCount, sleepingCount, cancellingCount, ignoredCount, maxPlayers)across regional threads (Folia) and multi-server shard groups (ONE_PLAYER,PERCENTAGE,FIXED_COUNT,ABSOLUTE_MAJORITY,CURVE) with population-adaptiveUnitCurveshapes (logarithmic,smootherstep,power,sigmoid,linear), a configurable warmup countdown, and cross-shard/sleep cancel(TUG_OF_WAR,CURVE,VETO). - Idempotent
targetDayEpochCAS: Advances dawn (targetDayEpoch = currentFullTime / 24000L + 1) and clears weather once per day epoch across all shards, resettingTIME_SINCE_RESTon each player's owning entity thread so Phantoms do not spawn after a group skip. - Hybrid Direct Bus + Pooled Async SQL Store: Sub-50ms delta frames (
BED_ENTER,BED_LEAVE,SLEEP_VOTE,CANCEL_SLEEP,EPOCH_COMMIT,SHARD_HEARTBEAT) over Redis RESP2 pub/sub (REDIS_PUBSUB), Velocity plugin messaging (PLUGIN_MESSAGING), HMAC-signed direct UDP sockets (DIRECT_SOCKETwith±30sreplay protection), orLOCAL_ONLYmode guarded byBudgetPacer, paired with:database-api'sMiniConnectionPool(SQLITE,MYSQL,MARIADB,POSTGRESQL). OnePlayerSleepConfiguration Superset (ADR-002): Self-documentingconfig.yml,player.yml,commands.yml,sleep.yml, andmessages/*.yml(loaded viaMultiConfigParser<SleepMessageKeys>) with@type,@range,@options, and@defaultschema directives, weighted random sleep/wakeup messages, clickable[Cancel]/[Sleep]prompts, andeffects-apiwakeup buffs.- Built-In Test (
[OPS bit]):/sleep test(or/ops test) executes PBIT/CBIT/IBIT diagnostics (OPS_001..OPS_005) indexed bydiscord-support-bot.