-
Notifications
You must be signed in to change notification settings - Fork 81
/
hosting.txt
150 lines (124 loc) · 5.02 KB
/
hosting.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
If you just want to play with friends while you're active yourself - use the co-op menu in the client.
If you want to leave a server on while your pc is active, use the colonyserver executable of your install manually and follow the menu's.
Both of these options require you to either leave the client or server active, and require steam to be started and logged in
The rest of this guide is intended for setting up headless dedicated servers.
## Summary to install SteamCMD and download the game for ubuntu:
Install/download SteamCMD according to the instructions here: https://developer.valvesoftware.com/wiki/SteamCMD
Or use the below summary:
# as root
# install a dependency of steamcmd if it's not there yet
apt-get install lib32gcc1
# create steam user to manage everything (musn't do those things as root)
useradd -m steam
# swap to this new user
su steam
# move to the home directory, set up a directory for steamcmd
cd /home/steam/
mkdir Steam
cd Steam
# download the steamcmd archive from steam and unpack it
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
# start steamcmd
./steamcmd.sh
# it'll download a bunch of files (the rest of steam), few dozen MB
# afterwards you'll be in steamcmd in interactive mode
# we'll need to login to download anything - you can use the "anonymous" account to download the dedicated server (it's free)
login anonymous
# set the install directory to use
# this has to be done every time you restart steamcmd or it'll use a generic install location
# or just leave this out and use said generic location
force_install_dir /home/steam/colonydedicated/
# download the colony survival dedicated server
# validate is optional (basically check integrity of local files from the steam client)
# to use a beta branch, do it like this: app_update 748090 -beta 0.6.3
app_update 748090 validate
# should say "Success! App '748080' fully installed."
exit
# now we're back to /home/steam/Steam/ as the steam user
# move to the folder we just made, it has the server in it now
cd ../colonydedicated/
# launch the game (see 'Launching the game' for more)
# this will launch the game (once)
./colonyserver.x86_64 -batchmode -nographics +server.world "Test World" +server.networktype SteamOnline +server.name "My Test Server" +server.password test_pw +server.rconpassword rcon_test_pw
Optionally you can save the above command to a sh file and launch that instead of the full string, or do that and use the json based config as described further below.
Launching said sh file as a service is left as an exercise to the reader
## Launching the game
# command line arguments
All optional values will default to the settings used in the UI previously - they are stored in gamedata/savegames/hosting_settings.json
Usable networktype values: "SteamOnline", "SteamNonPublic"
"SteamOnline" is the same as "SteamNonPublic" but will also:
- List itself in the public server browser
- Port forward the gameport via UPnP
- Authenticate steam users that connect
## command line args
# required to disable the UI
-batchmode
-nographics
# require either these:
+server.world "world name"
+server.networktype SteamOnline
+server.name "Server Name Here"
# or this one
+server.config "./relative/path.json"
# optional
+server.password "pass here"
+server.maxplayers 10
+server.gameport 27004
+server.steamport 27005
+server.usevac true
# optional, helps choose the network interface the game will attach to (otherwise just omit it and it'll auto select)
+server.ip 1.2.3.4
# optional, enables RCON access using colonyserverrcon.exe (comes with the game client) - handy for remote management to do `/stopserver` or `/setgroup god "player here"`
+server.rconpassword rcon_pass_here
# misc
+parentprocess 315 # indicates a parent process, if the parent process is stopped the game will also stop
# if the world folder did not exist yet (i.e, new world)
+server.daydifficulty 0 # zombie difficulty, 0 = none, 4 = max
+server.nightdifficulty 2 # same
+server.seed 12341533 # world seed, between 0 and 2147483648
## example json config contents
# used when +server.config is passed to the game
# load world example:
{
"LaunchArguments" : {
"LoadWorld" : {
"WorldName" : "world name here"
}
},
"ServerSettings" : {
"ServerName" : "Server name",
"ServerPassword" : "Server password",
"ServerIP" : "0.0.0.0",
"ServerGamePort" : 27004,
"ServerSteamPort" : 27005,
"UseVAC" : true,
"MaxPlayerCount" : 10,
"MaxDrawDistance" : 1024,
"NetworkType" : "SteamOnline",
"RCONPassword" : "rcon password"
}
}
# new world example
{
"LaunchArguments" : {
"NewWorld" : {
"WorldName" : "world name here",
"Seed" : 34243242,
"DayMonstersLevel" : 0,
"NightMonstersLevel" : 2,
"EnableHappiness" : true
}
},
"ServerSettings" : {
"ServerName" : "Server name",
"ServerPassword" : "Server password",
"ServerIP" : "0.0.0.0",
"ServerGamePort" : 27004,
"ServerSteamPort" : 27005,
"UseVAC" : true,
"MaxPlayerCount" : 10,
"MaxDrawDistance" : 1024,
"NetworkType" : "SteamOnline",
"RCONPassword" : "rcon password"
}
}