forked from OMARATION/mcforge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Properties.cs
698 lines (682 loc) · 40.3 KB
/
Properties.cs
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
/*
Copyright 2010 MCSharp team (Modified for use with MCZall/MCLawl/MCForge)
Dual-licensed under the Educational Community License, Version 2.0 and
the GNU General Public License, Version 3 (the "Licenses"); you may
not use this file except in compliance with the Licenses. You may
obtain a copy of the Licenses at
http://www.opensource.org/licenses/ecl2.php
http://www.gnu.org/licenses/gpl-3.0.html
Unless required by applicable law or agreed to in writing,
software distributed under the Licenses are distributed on an "AS IS"
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the Licenses for the specific language governing
permissions and limitations under the Licenses.
*/
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace MCForge
{
public static class Properties
{
public static void Load(string givenPath, bool skipsalt = false)
{
/*
if (!skipsalt)
{
Server.salt = "";
string rndchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
Random rnd = new Random();
for (int i = 0; i < 16; ++i) { Server.salt += rndchars[rnd.Next(rndchars.Length)]; }
}*/
if (!skipsalt)
{
RandomNumberGenerator prng = RandomNumberGenerator.Create();
StringBuilder sb = new StringBuilder();
byte[] oneChar = new byte[1];
while (sb.Length < 16)
{
prng.GetBytes(oneChar);
if (Char.IsLetterOrDigit((char)oneChar[0]))
{
sb.Append((char)oneChar[0]);
}
}
Server.salt = sb.ToString();
}
if (File.Exists(givenPath))
{
string[] lines = File.ReadAllLines(givenPath);
foreach (string line in lines)
{
if (line != "" && line[0] != '#')
{
//int index = line.IndexOf('=') + 1; // not needed if we use Split('=')
string key = line.Split('=')[0].Trim();
string value = "";
if (line.IndexOf('=') >= 0)
value = line.Substring(line.IndexOf('=') + 1).Trim(); // allowing = in the values
string color = "";
switch (key.ToLower())
{
case "server-name":
if (ValidString(value, "![]:.,{}~-+()?_/\\ "))
{
Server.name = value;
}
else { Server.s.Log("server-name invalid! setting to default."); }
break;
case "motd":
if (ValidString(value, "=![]&:.,{}~-+()?_/\\ ")) // allow = in the motd
{
Server.motd = value;
}
else { Server.s.Log("motd invalid! setting to default."); }
break;
case "port":
try { Server.port = Convert.ToInt32(value); }
catch { Server.s.Log("port invalid! setting to default."); }
break;
case "verify-names":
Server.verify = (value.ToLower() == "true") ? true : false;
break;
case "public":
Server.pub = (value.ToLower() == "true") ? true : false;
break;
case "world-chat":
Server.worldChat = (value.ToLower() == "true") ? true : false;
break;
case "guest-goto":
Server.guestGoto = (value.ToLower() == "true") ? true : false;
break;
case "max-players":
try
{
if (Convert.ToByte(value) > 128)
{
value = "128"; Server.s.Log("Max players has been lowered to 128.");
}
else if (Convert.ToByte(value) < 1)
{
value = "1"; Server.s.Log("Max players has been increased to 1.");
}
Server.players = Convert.ToByte(value);
}
catch { Server.s.Log("max-players invalid! setting to default."); }
break;
case "max-guests":
try
{
if (Convert.ToByte(value) > Server.players)
{
value = Server.players.ToString(); Server.s.Log("Max guests has been lowered to " + Server.players.ToString());
}
else if (Convert.ToByte(value) < 0)
{
value = "0"; Server.s.Log("Max guests has been increased to 0.");
}
Server.maxGuests = Convert.ToByte(value);
}
catch { Server.s.Log("max-guests invalid! setting to default."); }
break;
case "max-maps":
try
{
if (Convert.ToByte(value) > 100)
{
value = "100";
Server.s.Log("Max maps has been lowered to 100.");
}
else if (Convert.ToByte(value) < 1)
{
value = "1";
Server.s.Log("Max maps has been increased to 1.");
}
Server.maps = Convert.ToByte(value);
}
catch
{
Server.s.Log("max-maps invalid! setting to default.");
}
break;
case "irc":
Server.irc = (value.ToLower() == "true") ? true : false;
break;
case "irc-server":
Server.ircServer = value;
break;
case "irc-nick":
Server.ircNick = value;
break;
case "irc-channel":
Server.ircChannel = value;
break;
case "irc-opchannel":
Server.ircOpChannel = value;
break;
case "irc-port":
try
{
Server.ircPort = Convert.ToInt32(value);
}
catch
{
Server.s.Log("irc-port invalid! setting to default.");
}
break;
case "irc-identify":
try
{
Server.ircIdentify = Convert.ToBoolean(value);
}
catch
{
Server.s.Log("irc-identify boolean value invalid! Setting to the default of: " + Server.ircIdentify + ".");
}
break;
case "irc-password":
Server.ircPassword = value;
break;
case "anti-tunnels":
Server.antiTunnel = (value.ToLower() == "true") ? true : false;
break;
case "max-depth":
try
{
Server.maxDepth = Convert.ToByte(value);
}
catch
{
Server.s.Log("maxDepth invalid! setting to default.");
}
break;
case "rplimit":
try { Server.rpLimit = Convert.ToInt16(value); }
catch { Server.s.Log("rpLimit invalid! setting to default."); }
break;
case "rplimit-norm":
try { Server.rpNormLimit = Convert.ToInt16(value); }
catch { Server.s.Log("rpLimit-norm invalid! setting to default."); }
break;
case "report-back":
Server.reportBack = (value.ToLower() == "true") ? true : false;
break;
case "backup-time":
if (Convert.ToInt32(value) > 1) { Server.backupInterval = Convert.ToInt32(value); }
break;
case "backup-location":
if (!value.Contains("System.Windows.Forms.TextBox, Text:"))
Server.backupLocation = value;
break;
case "console-only":
Server.console = (value.ToLower() == "true") ? true : false;
break;
case "physicsrestart":
Server.physicsRestart = (value.ToLower() == "true") ? true : false;
break;
case "deathcount":
Server.deathcount = (value.ToLower() == "true") ? true : false;
break;
case "usemysql":
Server.useMySQL = (value.ToLower() == "true") ? true : false;
break;
case "host":
Server.MySQLHost = value;
break;
case "sqlport":
Server.MySQLPort = value;
break;
case "username":
Server.MySQLUsername = value;
break;
case "password":
Server.MySQLPassword = value;
break;
case "databasename":
Server.MySQLDatabaseName = value;
break;
case "pooling":
try { Server.MySQLPooling = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default."); break; }
break;
case "defaultcolor":
color = c.Parse(value);
if (color == "")
{
color = c.Name(value); if (color != "") color = value; else { Server.s.Log("Could not find " + value); return; }
}
Server.DefaultColor = color;
break;
case "irc-color":
color = c.Parse(value);
if (color == "")
{
color = c.Name(value); if (color != "") color = value; else { Server.s.Log("Could not find " + value); return; }
}
Server.IRCColour = color;
break;
case "old-help":
try { Server.oldHelp = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default."); break; }
break;
case "opchat-perm":
try
{
sbyte parsed = sbyte.Parse(value);
if (parsed < -50 || parsed > 120)
{
throw new FormatException();
}
Server.opchatperm = (LevelPermission)parsed;
}
catch { Server.s.Log("Invalid " + key + ". Using default."); break; }
break;
case "adminchat-perm":
try
{
sbyte parsed = sbyte.Parse(value);
if (parsed < -50 || parsed > 120)
{
throw new FormatException();
}
Server.adminchatperm = (LevelPermission)parsed;
}
catch { Server.s.Log("Invalid " + key + ". Using default."); break; }
break;
case "log-heartbeat":
try { Server.logbeat = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default."); break; }
break;
case "force-cuboid":
try { Server.forceCuboid = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default."); break; }
break;
case "profanity-filter":
try { Server.profanityFilter = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default."); break; }
break;
case "notify-on-join-leave":
try { Server.notifyOnJoinLeave = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default."); break; }
break;
case "cheapmessage":
try { Server.cheapMessage = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default."); break; }
break;
case "cheap-message-given":
if (value != "") Server.cheapMessageGiven = value;
break;
case "custom-ban":
try { Server.customBan = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default."); break; }
break;
case "custom-ban-message":
if (value != "") Server.customBanMessage = value;
break;
case "custom-shutdown":
try { Server.customShutdown = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default."); break; }
break;
case "custom-shutdown-message":
if (value != "") Server.customShutdownMessage = value;
break;
case "rank-super":
try { Server.rankSuper = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default."); break; }
break;
case "default-rank":
try { Server.defaultRank = value.ToLower(); }
catch { }
break;
case "afk-minutes":
try
{
Server.afkminutes = Convert.ToInt32(value);
}
catch
{
Server.s.Log("irc-port invalid! setting to default.");
}
break;
case "afk-kick":
try { Server.afkkick = Convert.ToInt32(value); }
catch { Server.s.Log("irc-port invalid! setting to default."); }
break;
case "check-updates":
try { Server.autonotify = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default."); break; }
break;
case "autoload":
try { Server.AutoLoad = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default."); break; }
break;
case "auto-restart":
try { Server.autorestart = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default."); break; }
break;
case "restarttime":
try { Server.restarttime = DateTime.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using defualt."); break; }
break;
case "parse-emotes":
try { Server.parseSmiley = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default."); break; }
break;
case "use-whitelist":
Server.useWhitelist = (value.ToLower() == "true") ? true : false;
break;
case "allow-tp-to-higher-ranks":
Server.higherranktp = (value.ToLower() == "true") ? true : false;
break;
case "agree-to-rules-on-entry":
try { Server.agreetorulesonentry = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default"); }
break;
case "admins-join-silent":
try { Server.adminsjoinsilent = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default"); }
break;
case "main-name":
if (Player.ValidName(value)) Server.level = value;
else Server.s.Log("Invalid main name");
break;
case "dollar-before-dollar":
try { Server.dollardollardollar = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default."); }
break;
case "money-name":
if (value != "") Server.moneys = value;
break;
case "mono":
try { Server.mono = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default."); }
break;
case "restart-on-error":
try { Server.restartOnError = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default."); }
break;
case "repeat-messages":
try { Server.repeatMessage = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default."); }
break;
case "host-state":
if (value != "")
Server.ZallState = value;
break;
case "kick-on-hackrank":
try { Server.hackrank_kick = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default"); }
break;
case "hackrank-kick-time":
try { Server.hackrank_kick_time = int.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default"); }
break;
case "server-owner":
if (value != "")
Server.server_owner = value;
break;
case "zombie-on-server-start":
try { Server.startZombieModeOnStartup = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default"); }
break;
case "no-respawning-during-zombie":
try { Server.noRespawn = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default"); }
break;
case "no-level-saving-during-zombie":
try { Server.noLevelSaving = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default"); }
break;
case "no-pillaring-during-zombie":
try { Server.noPillaring = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default"); }
break;
case "zombie-name-while-infected":
if (value != "")
Server.ZombieName = value;
break;
case "ignore-ops":
try { Server.globalignoreops = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default"); }
break;
case "admin-verification":
try { Server.verifyadmins = bool.Parse(value); }
catch { Server.s.Log("invalid " + key + ". Using default"); }
break;
case "verify-admin-perm":
try
{
sbyte parsed = sbyte.Parse(value);
if (parsed < -50 || parsed > 120)
{
throw new FormatException();
}
Server.verifyadminsrank = (LevelPermission)parsed;
}
catch { Server.s.Log("Invalid " + key + ". Using default."); break; }
break;
case "mute-on-spam":
try { Server.checkspam = bool.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default"); }
break;
case "spam-messages":
try { Server.spamcounter = int.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default"); }
break;
case "spam-mute-time":
try { Server.mutespamtime = int.Parse(value); }
catch { Server.s.Log("Invalid " + key + ". Using default"); }
break;
}
}
}
Server.s.SettingsUpdate();
Save(givenPath);
}
else Save(givenPath);
}
public static bool ValidString(string str, string allowed)
{
string allowedchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890" + allowed;
foreach (char ch in str)
{
if (allowedchars.IndexOf(ch) == -1)
{
return false;
}
} return true;
}
static void Save(string givenPath)
{
try
{
File.Create(givenPath).Dispose();
using (StreamWriter w = File.CreateText(givenPath))
{
if (givenPath.IndexOf("server") != -1)
{
SaveProps(w);
}
}
}
catch
{
Server.s.Log("SAVE FAILED! " + givenPath);
}
}
static void SaveProps(StreamWriter w)
{
w.WriteLine("# Edit the settings below to modify how your server operates. This is an explanation of what each setting does.");
w.WriteLine("# server-name\t=\tThe name which displays on minecraft.net");
w.WriteLine("# motd\t=\tThe message which displays when a player connects");
w.WriteLine("# port\t=\tThe port to operate from");
w.WriteLine("# console-only\t=\tRun without a GUI (useful for Linux servers with mono)");
w.WriteLine("# verify-names\t=\tVerify the validity of names");
w.WriteLine("# public\t=\tSet to true to appear in the public server list");
w.WriteLine("# max-players\t=\tThe maximum number of connections");
w.WriteLine("# max-guests\t=\tThe maximum number of guests allowed");
w.WriteLine("# max-maps\t=\tThe maximum number of maps loaded at once");
w.WriteLine("# world-chat\t=\tSet to true to enable world chat");
w.WriteLine("# guest-goto\t=\tSet to true to give guests goto and levels commands");
w.WriteLine("# irc\t=\tSet to true to enable the IRC bot");
w.WriteLine("# irc-nick\t=\tThe name of the IRC bot");
w.WriteLine("# irc-server\t=\tThe server to connect to");
w.WriteLine("# irc-channel\t=\tThe channel to join");
w.WriteLine("# irc-opchannel\t=\tThe channel to join (posts OpChat)");
w.WriteLine("# irc-port\t=\tThe port to use to connect");
w.WriteLine("# irc-identify\t=(true/false)\tDo you want the IRC bot to Identify itself with nickserv. Note: You will need to register it's name with nickserv manually.");
w.WriteLine("# irc-password\t=\tThe password you want to use if you're identifying with nickserv");
w.WriteLine("# anti-tunnels\t=\tStops people digging below max-depth");
w.WriteLine("# max-depth\t=\tThe maximum allowed depth to dig down");
w.WriteLine("# backup-time\t=\tThe number of seconds between automatic backups");
w.WriteLine("# overload\t=\tThe higher this is, the longer the physics is allowed to lag. Default 1500");
w.WriteLine("# use-whitelist\t=\tSwitch to allow use of a whitelist to override IP bans for certain players. Default false.");
w.WriteLine("# force-cuboid\t=\tRun cuboid until the limit is hit, instead of canceling the whole operation. Default false.");
w.WriteLine("# profanity-filter\t=\tFilter bad words from the chat. Default false.");
w.WriteLine("# notify-on-join-leave\t=\tShow a balloon popup in tray notification area when a player joins/leaves the server. Default false.");
w.WriteLine("# allow-tp-to-higher-ranks\t=\tAllows the teleportation to players of higher ranks");
w.WriteLine("# agree-to-rules-on-entry\t=\tForces all new players to the server to agree to the rules before they can build or use commands.");
w.WriteLine("# adminchat-perm\t=\tThe rank required to view adminchat. Default rank is superop.");
w.WriteLine("# server-owner\t=\tThe minecraft name, of the owner of the server.");
w.WriteLine("# zombie-on-server-start\t=\tStarts Zombie Survival when server is started.");
w.WriteLine("# no-respawning-during-zombie\t=\tDisables respawning (Pressing R) while Zombie is on.");
w.WriteLine("# no-level-saving-during-zombie\t=\tDisables level saving while Zombie Survival is activated.");
w.WriteLine("# no-pillaring-during-zombie\t=\tDisables pillaring while Zombie Survival is activated.");
w.WriteLine("# zombie-name-while-infected\t=\tSets the zombies name while actived if there is a value.");
w.WriteLine();
w.WriteLine("# Host\t=\tThe host name for the database (usually 127.0.0.1)");
w.WriteLine("# SQLPort\t=\tPort number to be used for MySQL. Unless you manually changed the port, leave this alone. Default 3306.");
w.WriteLine("# Username\t=\tThe username you used to create the database (usually root)");
w.WriteLine("# Password\t=\tThe password set while making the database");
w.WriteLine("# DatabaseName\t=\tThe name of the database stored (Default = MCZall)");
w.WriteLine();
w.WriteLine("# defaultColor\t=\tThe color code of the default messages (Default = &e)");
w.WriteLine();
w.WriteLine("# Super-limit\t=\tThe limit for building commands for SuperOPs");
w.WriteLine("# Op-limit\t=\tThe limit for building commands for Operators");
w.WriteLine("# Adv-limit\t=\tThe limit for building commands for AdvBuilders");
w.WriteLine("# Builder-limit\t=\tThe limit for building commands for Builders");
w.WriteLine();
w.WriteLine("# kick-on-hackrank\t=\tSet to true if hackrank should kick players");
w.WriteLine("# hackrank-kick-time\t=\tNumber of seconds until player is kicked");
w.WriteLine("# custom-rank-welcome-messages\t=\tDecides if different welcome messages for each rank is enabled. Default true.");
w.WriteLine("# ignore-ops\t=\tDecides whether or not an operator can be ignored. Default false.");
w.WriteLine();
w.WriteLine("# admin-verification\t=\tDetermines whether admins have to verify on entry to the server. Default true.");
w.WriteLine("# verify-admin-perm\t=\tThe minimum rank required for admin verification to occur.");
w.WriteLine();
w.WriteLine("# mute-on-spam\t=\tIf enabled it mutes a player for spamming. Default false.");
w.WriteLine("# spam-messages\t=\tThe amount of messages that have to be sent consecutively to be muted.");
w.WriteLine("# spam-mute-time\t=\tThe amount of seconds a player is muted for spam.");
w.WriteLine();
w.WriteLine();
w.WriteLine("# Server options");
w.WriteLine("server-name = " + Server.name);
w.WriteLine("motd = " + Server.motd);
w.WriteLine("port = " + Server.port.ToString());
w.WriteLine("verify-names = " + Server.verify.ToString().ToLower());
w.WriteLine("public = " + Server.pub.ToString().ToLower());
w.WriteLine("max-players = " + Server.players.ToString());
w.WriteLine("max-guests = " + Server.maxGuests.ToString());
w.WriteLine("max-maps = " + Server.maps.ToString());
w.WriteLine("world-chat = " + Server.worldChat.ToString().ToLower());
w.WriteLine("check-updates = " + Server.autonotify.ToString().ToLower());
w.WriteLine("autoload = " + Server.AutoLoad.ToString().ToLower());
w.WriteLine("auto-restart = " + Server.autorestart.ToString().ToLower());
w.WriteLine("restarttime = " + Server.restarttime.ToShortTimeString());
w.WriteLine("restart-on-error = " + Server.restartOnError);
w.WriteLine("main-name = " + Server.level);
w.WriteLine();
w.WriteLine("# irc bot options");
w.WriteLine("irc = " + Server.irc.ToString().ToLower());
w.WriteLine("irc-nick = " + Server.ircNick);
w.WriteLine("irc-server = " + Server.ircServer);
w.WriteLine("irc-channel = " + Server.ircChannel);
w.WriteLine("irc-opchannel = " + Server.ircOpChannel);
w.WriteLine("irc-port = " + Server.ircPort.ToString());
w.WriteLine("irc-identify = " + Server.ircIdentify.ToString());
w.WriteLine("irc-password = " + Server.ircPassword);
w.WriteLine();
w.WriteLine("# other options");
w.WriteLine("anti-tunnels = " + Server.antiTunnel.ToString().ToLower());
w.WriteLine("max-depth = " + Server.maxDepth.ToString().ToLower());
w.WriteLine("rplimit = " + Server.rpLimit.ToString().ToLower());
w.WriteLine("rplimit-norm = " + Server.rpNormLimit.ToString().ToLower());
w.WriteLine("physicsrestart = " + Server.physicsRestart.ToString().ToLower());
w.WriteLine("old-help = " + Server.oldHelp.ToString().ToLower());
w.WriteLine("deathcount = " + Server.deathcount.ToString().ToLower());
w.WriteLine("afk-minutes = " + Server.afkminutes.ToString());
w.WriteLine("afk-kick = " + Server.afkkick.ToString());
w.WriteLine("parse-emotes = " + Server.parseSmiley.ToString().ToLower());
w.WriteLine("dollar-before-dollar = " + Server.dollardollardollar.ToString().ToLower());
w.WriteLine("use-whitelist = " + Server.useWhitelist.ToString().ToLower());
w.WriteLine("money-name = " + Server.moneys);
w.WriteLine("opchat-perm = " + ((sbyte)Server.opchatperm).ToString());
w.WriteLine("adminchat-perm = " + ((sbyte)Server.adminchatperm).ToString());
w.WriteLine("log-heartbeat = " + Server.logbeat.ToString());
w.WriteLine("force-cuboid = " + Server.forceCuboid.ToString());
w.WriteLine("profanity-filter = " + Server.profanityFilter.ToString());
w.WriteLine("notify-on-join-leave = " + Server.notifyOnJoinLeave.ToString());
w.WriteLine("repeat-messages = " + Server.repeatMessage.ToString());
w.WriteLine("host-state = " + Server.ZallState.ToString());
w.WriteLine("agree-to-rules-on-entry = " + Server.agreetorulesonentry.ToString().ToLower());
w.WriteLine("admins-join-silent = " + Server.adminsjoinsilent.ToString().ToLower());
w.WriteLine("server-owner = " + Server.server_owner.ToString());
w.WriteLine("zombie-on-server-start = " + Server.startZombieModeOnStartup);
w.WriteLine("no-respawning-during-zombie = " + Server.noRespawn);
w.WriteLine("no-level-saving-during-zombie = " + Server.noLevelSaving);
w.WriteLine("no-pillaring-during-zombie = " + Server.noPillaring);
w.WriteLine("zombie-name-while-infected = " + Server.ZombieName);
w.WriteLine();
w.WriteLine("# backup options");
w.WriteLine("backup-time = " + Server.backupInterval.ToString());
w.WriteLine("backup-location = " + Server.backupLocation);
w.WriteLine();
w.WriteLine("#Error logging");
w.WriteLine("report-back = " + Server.reportBack.ToString().ToLower());
w.WriteLine();
w.WriteLine("#MySQL information");
w.WriteLine("UseMySQL = " + Server.useMySQL);
w.WriteLine("Host = " + Server.MySQLHost);
w.WriteLine("SQLPort = " + Server.MySQLPort);
w.WriteLine("Username = " + Server.MySQLUsername);
w.WriteLine("Password = " + Server.MySQLPassword);
w.WriteLine("DatabaseName = " + Server.MySQLDatabaseName);
w.WriteLine("Pooling = " + Server.MySQLPooling);
w.WriteLine();
w.WriteLine("#Colors");
w.WriteLine("defaultColor = " + Server.DefaultColor);
w.WriteLine("irc-color = " + Server.IRCColour);
w.WriteLine();
w.WriteLine("#Running on mono?");
w.WriteLine("mono = " + Server.mono);
w.WriteLine();
w.WriteLine("#Custom Messages");
w.WriteLine("custom-ban = " + Server.customBan.ToString().ToLower());
w.WriteLine("custom-ban-message = " + Server.customBanMessage);
w.WriteLine("custom-shutdown = " + Server.customShutdown.ToString().ToLower());
w.WriteLine("custom-shutdown-message = " + Server.customShutdownMessage);
w.WriteLine("allow-tp-to-higher-ranks = " + Server.higherranktp.ToString().ToLower());
w.WriteLine("ignore-ops = " + Server.globalignoreops.ToString().ToLower());
w.WriteLine();
w.WriteLine("cheapmessage = " + Server.cheapMessage.ToString().ToLower());
w.WriteLine("cheap-message-given = " + Server.cheapMessageGiven);
w.WriteLine("rank-super = " + Server.rankSuper.ToString().ToLower());
try { w.WriteLine("default-rank = " + Server.defaultRank); }
catch { w.WriteLine("default-rank = guest"); }
w.WriteLine();
w.WriteLine("kick-on-hackrank = " + Server.hackrank_kick.ToString().ToLower());
w.WriteLine("hackrank-kick-time = " + Server.hackrank_kick_time.ToString());
w.WriteLine();
w.WriteLine("#Admin Verification");
w.WriteLine("admin-verification = " + Server.verifyadmins.ToString().ToLower());
w.WriteLine("verify-admin-perm = " + ((sbyte)Server.verifyadminsrank).ToString());
w.WriteLine();
w.WriteLine("#Spam Control");
w.WriteLine("mute-on-spam = " + Server.checkspam.ToString().ToLower());
w.WriteLine("spam-messages = " + Server.spamcounter.ToString());
w.WriteLine("spam-mute-time = " + Server.mutespamtime.ToString());
}
}
}