LessSleep
Sleep voting for dedicated servers: skip the night before everyone is in bed, if a configurable percentage of players agree. Works with vanilla clients.
模組介紹 作者原文
LessSleep
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 / N
or by typing yes / no in chat.
How it works
- When at least PercentInBedToStartVote (default 50%) of online players are in bed
(and at least MinimumPlayersInBed), 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 VotePercentOfAwakeToPass of 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.
Installation
Server
Install BepInExPack_Valheim and drop LessSleep.dll into BepInEx/plugins on the server.
Clients (optional, but recommended)
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.
Configuration
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. |
Notes
- 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.
Building
dotnet build src/LessSleep.csproj -c Release./scripts/pack.sh # produces dist/LessCx-LessSleep-.zip
Reference 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"
CI / releasing
| 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 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 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 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/LessSleep
Release: bump version_number in manifest.json (and CHANGELOG.md), commit, then:
git tag v1.0.1 && git push origin v1.0.1
The publish workflow stamps that version everywhere, so the tag is the source of
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。
下面這些內容需要先安裝,否則該模組不會生效: