ObjectManagerManager / SMAPIDedicatedServerMod

Dedicated (headless) server mod for Stardew Valley, powered by SMAPI. Turns the host into an automated bot.
MIT License
78 stars 17 forks source link

SMAPI Dedicated Server Mod for Stardew Valley

This mod provides a dedicated (headless) server for Stardew Valley, powered by SMAPI. It turns the host farmer into an automated bot to facilitate multiplayer gameplay.

Configuration File

Upon running SMAPI with the mod installed for the first time, a config.json file will be generated in the mod's folder. This file specifies which farm will be loaded on startup, farm creation options, host automation details, and other mod configuration options. Default values will be provided, which can then be modified. Here is an overview of the available settings:

Startup options

Farm Creation Options

Host Automation Options

Additional Options

Host Options

In Game Command

All commands in the game must be sent privately to the player ServerBot. For example, you must write the following /message ServerBot MoveBuildPermission on.

Running the Server on Linux Without GUI

This mod can be run without the use of a GUI. To start the game, you must enter the following command:

xvfb-run -a "$HOME/GOG Games/Stardew Valley/game/StardewModdingAPI"

You can shut down the server from the started terminal session by pressing Control-C. From another terminal session, you can send Control-C with kill -SIGINT .....

ps -aux | grep StardewModdingAPI
kill -SIGINT ....

Development

If Stardew Valley was not installed in the default path, the installation path must be added to the project file DedicatedServer.csproj. Add the path with the tag GamePath to the PropertyGroup. Depending on the path, it should look something like this:

  <PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
    <GamePath>D:\SteamLibrary\steamapps\common\Stardew Valley</GamePath>
  </PropertyGroup>