Skip to content

Commit

Permalink
Add motd to serverconfig.json
Browse files Browse the repository at this point in the history
  • Loading branch information
silentbaws committed May 29, 2020
1 parent 2353c3b commit 88a6b65
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions XLMultiplayerServer/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ class Server {
[JsonProperty("Enforce_Map")]
private static bool ENFORCE_MAPS = true;

[JsonProperty("MessageOTD")]
private static string defaultMOTD = "";

[JsonProperty("API_Key")]
private static string API_KEY = "";

Expand Down Expand Up @@ -163,6 +166,13 @@ public static int Main(String[] args) {
}
}

if (!defaultMOTD.Equals("")) {
byte[] defaultMOTDBytes = ProcessMessageCommand(defaultMOTD);
if(defaultMOTDBytes != null) {
motdBytes = defaultMOTDBytes;
}
}

if (File.Exists("ipban.txt")) {
string ipBanList = File.ReadAllText("ipban.txt");
string[] readBannedIPs = ipBanList.Split('\n');
Expand Down
2 changes: 1 addition & 1 deletion XLMultiplayerServer/ServerConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Server_Name": "Hello Test Server",
"Enforce_Map": false,
"Maps_Folder": "",

"MessageOTD": "motd:15:ff0000 This is an example motd that displays for 15 seconds in solid red",

"PUBLIC SERVER OPTIONS": "THESE ARE NOT NEEDED FOR YOUR PRIVATE SERVER",
"API_Key": "",
Expand Down

0 comments on commit 88a6b65

Please sign in to comment.