Setting up a Dungbeetle host

Navigating to 'WindowDungbeetleToolsBuild DLL or ServerStandalone Server' opens the server compilation window

By default, Dungbeetle is configured to run a server as an editor script in Unity. It is a demonstration server, not suitable for long-term projects, since it shuts down when you close Unity. Make sure to turn this off in the connection config.

To set up a permanent server, you can create a Standalone Server. This server only requires a .net runtime, and runs separately from Unity.

The standalone server stores its configuration in ServerPreferences.yaml. The defaults are generated from your current config.asset and placed next to the executable at the time of compilation.

You can call DungbeetleServer.exe with the --preferences <path> flag to control its placement later.

ServerPreferences.yaml details

Also see config.asset.

mode:
SQLite or MySQL
port:
Network port for Dungbeetle hosting.
dbUserName:
MySQL username
dbPassword:
MySQL password
dbPort:
MySQL port
dbUrl:
MySQL host url
dbName:
MySQL database name
reporterPasword:
Password required to grant clients the reporter privilege.
developerPassword:
Password required to grant clients the developer privilege.
privateKey:
Key used to decrypt Dungbeetle network traffic.

Setting up a .net runtime

On Windows, a .net runtime support is built in, so you can basically skip this section.

On OS X and Linux, you will need a mono runtime to run the server.
sudo apt-get install mono libmono-system-serviceprocess4.0-cil

On OS X in particular, the mono command might not be available right after installation. If you have this problem, refer to this post on stackoverflow.

To run DungbeetleServer.exe, open the terminal in the same folder as Dungbeetle.exe and run mono with DungbeetleServer.exe as its argument:
mono DungbeetleServer.exe

To pass arguments to DungbeetleServer.exe, just pass them to mono as if you were running DungbeetleServer.exe directly.

Setting up a MySQL backend

Dungbeetle can use MySQL as a backend instead of SQLite for performance or other reasons.

If you want MySQL as your backend, follow these steps.

  1. Install a MySQL server on the same machine, or some other machine you have access to.
  2. Create a user on the server: CREATE USER 'fredrik'@'localhost' IDENTIFIED BY 'some_pass';
  3. Grant that user access to the database that you want to use: GRANT ALL ON dungbeetle.* TO 'fredrik'@'localhost';
  4. Do not create the database, but remember its name. In our case it is dungbeetle.
  5. Note down the details in ServerPreferences.Yaml

Sample initscript for Ubuntu

Download it here.
I recommend that you compare it to your own /etc/inid.d/skeleton, since it's based on that.

Assumptions about your installation:

Notable quirks about DungbeetleServer.exe (all handled by the script):

Running as a service in Windows

DungbeetleServer.exe supports being run as a service in Windows.

Before it's run the first time, the server needs to know where it should store its data.

I'm using C:\Users\<USERNAME>\DungbeetleHome as my main Dungbeetle folder in this example, but it's all up to you. Almost none of the files actually need to be in the same folder when configured appropriately.

Create the service (as administrator):

Now you can open up the service manager and start Dungbeetle as a service.