Sleep voting for Valheim dedicated servers: skip the night before every single player is in bed, if enough people agree.
- Server-driven: the server decides when to ask and when the night skips.
- No client is required: on a server where nobody runs the mod, it silently behaves like auto-skip (see How it works).
- Clients get a prompt: awake LessSleep clients see a message and can vote with
Y/Nor by typingyes/noin chat.
- When at least
PercentInBedToStartVote(default 50%) of online players are in bed (and at leastMinimumPlayersInBed), the server opens a vote. - Sleeping players are treated as a yes (they are the ones asking - it's their night too).
- Awake players running LessSleep are asked to accept or decline. If no awake player runs LessSleep, the vote passes immediately (auto-skip).
- The vote passes when at least
VotePercentOfAwakeToPassof awake modded players accepted, and fails on timeout or when everyone voted no. - On a pass the server skips to morning exactly like vanilla sleeping does.
Install BepInExPack_Valheim and drop LessSleep.dll into BepInEx/plugins on the server.
Same thing: install BepInExPack_Valheim, drop LessSleep.dll into BepInEx/plugins.
Clients without the mod still see the vote messages and the night still skips for them,
they just cannot cast a vote.
Server config (BepInEx/config/LessCx.LessSleep.cfg):
| Setting | Default | Description |
|---|---|---|
PercentInBedToStartVote |
50 | Percentage of online players that must be in bed to start a vote. |
MinimumPlayersInBed |
1 | Minimum number of players in bed before a vote can start. |
VotePercentOfAwakeToPass |
50 | Percentage of awake LessSleep clients that must accept. |
VoteTimeoutSeconds |
30 | How long a vote stays open. |
VoteCooldownSeconds |
60 | Wait after a failed vote before a new one can start. |
Client config:
| Setting | Default | Description |
|---|---|---|
EnableVotePrompt |
true | Allow voting with the Y and N keys. |
AllowChatYesNo |
true | While a vote is open, typing yes or no in chat casts your vote. |
- The server never needs to know which clients run the mod to skip; the modded-client list is only used to decide who gets asked.
- Voting is intentionally simple: one vote per player, last vote wins, votes are only accepted from connected players that announced themselves.
dotnet build src/LessSleep.csproj -c Release
./scripts/pack.sh # produces dist/LessCx-LessSleep-<version>.zip for ThunderstoreReference paths default to the macOS Steam install and can be overridden:
dotnet build src/LessSleep.csproj -c Release \
-p:ValheimManagedDir=".../Steam/steamapps/common/Valheim/valheim.app/Contents/Resources/Data/Managed" \
-p:BepInExCoreDir=".../Steam/steamapps/common/Valheim/BepInEx/core"| Workflow | Trigger | What it does |
|---|---|---|
build |
push to main, pull requests |
compiles and uploads the package as a build artifact |
publish |
tag vX.Y.Z or manual dispatch |
stamps the version, builds, publishes to Thunderstore with tcli, creates a GitHub release |
CI has no game install, so .github/actions/prepare-refs downloads the Valheim dedicated
server with SteamCMD (anonymous) and the BepInEx core from Thunderstore into a cached
.refs/ directory. Game DLLs are never committed to this repository. When Valheim updates,
bump the cache key in .github/actions/prepare-refs/action.yml so CI picks up fresh
reference assemblies.
One-time setup: create a Thunderstore service account for the LessCx team
(Settings > Teams > LessCx > Service Accounts) and store its token as a repository secret:
gh secret set TCLI_AUTH_TOKEN --repo LovelessCodes/LessSleepRelease: bump version_number in manifest.json (and CHANGELOG.md), commit, then:
git tag v1.0.1 && git push origin v1.0.1The publish workflow stamps that version everywhere, so the tag is the source of truth.
MIT