-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverConfiguration.php
857 lines (708 loc) · 40.5 KB
/
serverConfiguration.php
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
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
<!doctype html>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<link rel="icon" type="image/png" href="images/128.png" />
<script src="https://kit.fontawesome.com/d34481d57e.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel=stylesheet href="https://s3-us-west-2.amazonaws.com/colors-css/2.2.0/colors.min.css">
<link rel="stylesheet" type="text/css" href="styles.css">
<title>Server Configuration</title>
<style>
.topright {
position: relative;
position: absolute;
top: 8px;
right: 16px;
}
</style>
<div class="container container-fluid">
<?php
session_start();
if (!isset($_SESSION['login'])) {
header('LOCATION:login.php');
die();
}
header('Cache-Control: max-age=900');
$role = $_SESSION["role"];
$server = $_GET['serverchoose'];
/* Start of reading the current config file */
$serverName = `sed -n '2p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 7- `;
$serverName = substr($serverName, 0, -2);
$serverDescription = `sed -n '3p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 14-`;
$serverDescription = substr($serverDescription, 0, -2);
$serverTags = `sed -n '4p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 8-`;
$serverTags = substr($serverTags, 0, -3);
$serverMaxPlayers = `sed -n '5p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 14-`;
$serverMaxPlayers = substr($serverMaxPlayers, 0, -2);
$serverVisibilityPublic = `sed -n '8p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 9-`;
$serverVisibilityPublic = substr($serverVisibilityPublic, 0, -2);
$serverVisibilityLan = `sed -n '9p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 6-`;
$serverVisibilityLan = substr($serverVisibilityLan, 0, -1);
$serverPassword = `sed -n '12p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 16-`;
$serverPassword = substr($serverPassword, 0, -2);
$serverUserVerification = `sed -n '13p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 28-`;
$serverUserVerification = substr($serverUserVerification, 0, -2);
$serverUpload = `sed -n '14p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 37-`;
$serverUpload = substr($serverUpload, 0, -2);
$serverLatency = `sed -n '15p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 27-`;
$serverLatency = substr($serverLatency, 0, -2);
$serverIgnorePlayerLimit = `sed -n '16p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 44-`;
$serverIgnorePlayerLimit = substr($serverIgnorePlayerLimit, 0, -2);
$serverAllowCommands = `sed -n '17p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 17-`;
$serverAllowCommands = substr($serverAllowCommands, 0, -2);
$serverAutoSaveInterval = `sed -n '18p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 20-`;
$serverAutoSaveInterval = substr($serverAutoSaveInterval, 0, -2);
$serverAutoSaveSlots = `sed -n '19p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 17-`;
$serverAutoSaveSlots = substr($serverAutoSaveSlots, 0, -2);
$serverAFK = `sed -n '20p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 24-`;
$serverAFK = substr($serverAFK, 0, -2);
$serverAutoPause = `sed -n '21p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 13-`;
$serverAutoPause = substr($serverAutoPause, 0, -2);
$serverOnlyAdminPause = `sed -n '22p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 33-`;
$serverOnlyAdminPause = substr($serverOnlyAdminPause, 0, -2);
$serverAutoSaveOnlyOnServer = `sed -n '23p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 26-`;
$serverAutoSaveOnlyOnServer = substr($serverAutoSaveOnlyOnServer, 0, -2);
$serverNonBlockSave = `sed -n '24p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 22-`;
$serverNonBlockSave = substr($serverNonBlockSave, 0, -2);
$serverFactorioUsername = `sed -n '26p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 11-`;
$serverFactorioUsername = substr($serverFactorioUsername, 0, -2);
$serverFactorioPassword = `sed -n '27p' server/${server}/data/fctrserver.json | sed 's/"//g' | cut -c 11-`;
$serverFactorioPassword = substr($serverFactorioPassword, 0, -1);
//Server scenario and all config
$serverGithubScenario = `sed -n '3p' server/${server}/server-config.txt | sed 's/"//g'`;
$serverGithubScenario = substr($serverGithubScenario, 0, -1);
$serverGithubScenarioPath = `sed -n '5p' server/${server}/server-config.txt | sed 's/"//g'`;
$serverGithubScenarioPath = substr($serverGithubScenarioPath, 0, -1);
$serverVersion = `sed -n '7p' server/${server}/server-config.txt | sed 's/"//g'`;
$serverVersion = substr($serverVersion, 0, -1);
$serverRocketResetCounter = `sed -n '9p' server/${server}/server-config.txt | sed 's/"//g'`;
$serverRocketResetCounter == substr($serverRocketResetCounter, 0, -1);
//ServerManager CONFIG
$serverManagerToken = `sed -n '1p' server/${server}/ServerManager/.env | sed 's/"//g' | cut -c 16-`;
$serverManagerToken = substr($serverManagerToken, 0, -1);
$serverManagerFactorioChatID = `sed -n '2p' server/${server}/ServerManager/.env | sed 's/"//g' | cut -c 21-`;
$serverManagerFactorioChatID = substr($serverManagerFactorioChatID, 0, -1);
$serverManagerConsoleChat = `sed -n '4p' server/${server}/ServerManager/.env | sed 's/"//g' | cut -c 24-`;
$serverManagerConsoleChat = substr($serverManagerConsoleChat, 0, -1);
$serverManagerConsoleChatID = `sed -n '5p' server/${server}/ServerManager/.env | sed 's/"//g' | cut -c 25-`;
$serverManagerConsoleChatID = substr($serverManagerConsoleChatID, 0, -1);
$serverManagerMapSettigns = `sed -n '7p' server/${server}/ServerManager/.env | sed 's/"//g' | cut -c 20- | grep -o 'map-settings.*' | cut -f1,2 -d' ' | awk '{gsub("map-settings ", "");print}'`;
$serverManagerMapSettigns = substr($serverManagerMapSettigns, 0, -1);
$serverManagerMapGenSettigns = `sed -n '7p' server/${server}/ServerManager/.createenv | sed 's/"//g' | cut -c 20- | grep -o 'map-gen-settings.*' | cut -f1,2 -d' ' | awk '{gsub("map-gen-settings ", "");print}'`;
$serverManagerMapGenSettigns = substr($serverManagerMapGenSettigns, 0, -1);
$serverManagerPort = `sed -n '7p' server/${server}/ServerManager/.env | sed 's/"//g' | cut -c 20- | grep -o 'port .*' | cut -f1,2 -d' ' | awk '{gsub("port ", "");print}'`;
$serverManagerPort = substr($serverManagerPort, 0, -1);
$serverManagerRconPort = `sed -n '7p' server/${server}/ServerManager/.env | sed 's/"//g' | cut -c 20- | grep -o 'rcon-port .*' | cut -f1,2 -d' ' | awk '{gsub("rcon-port ", "");print}'`;
$serverManagerRconPort = substr($serverManagerRconPort, 0, -1);
$serverManagerRconPassword = `sed -n '7p' server/${server}/ServerManager/.env | sed 's/"//g' | cut -c 20- | grep -o 'rcon-password .*' | cut -f1,2 -d' ' | awk '{gsub("rcon-password ", "");print}'`;
$serverManagerRconPassword = substr($serverManagerRconPassword, 0, -1);
$serverManagerAdmins = `sed -n '8p' server/${server}/ServerManager/.env | sed 's/"//g' | cut -c 12-`;
$serverManagerAdmins = substr($serverManagerAdmins, 0, -1);
$serverManagerPrefix = `sed -n '9p' server/${server}/ServerManager/.env | sed 's/"//g' | cut -c 10`;
$serverManagerPrefix = substr($serverManagerPrefix, 0, -1);
$serverManagerModListLocation = `sed -n '10p' server/${server}/ServerManager/.env | sed 's/"//g' | cut -c 19-`;
$serverManagerModListLocation = substr($serverManagerModListLocation, 0, -1);
$serverManagerExitGracePeriod = `sed -n '11p' server/${server}/ServerManager/.env | sed 's/"//g' | cut -c 19-`;
$serverManagerExitGracePeriod = substr($serverManagerExitGracePeriod, 0, -1);
$serverManagerResetChatID = `sed -n '2p' server/${server}/ServerManager/.createenv | sed 's/"//g' | cut -c 21-`;
$serverManagerResetChatID = substr($serverManagerResetChatID, 0, -1);
/* Stop of reading the config file */
echo '<div class="col-sm-4">';
echo '<table class="table table-borderless"><tr><td>';
echo "Role - $role <br>";
echo "</td><td>";
echo '<a href="';
echo "scripts/launchAdminLoading.php?serverchoose=${server}";
echo '" class="button" style="color:black;"><i class="fas fa-home fa-2x"></i></span></a>';
echo '</td>';
if ($role == "Admin") {
echo '<td>';
echo '<form action="scripts/changeConfigFile.php';
echo "?serverchoose=${server}&action=createjson";
echo '" autocomplete="off" method="post">';
echo '<input type="submit" class="btn btn-info" value="Generate Config" onclick="return confirm(\'This will delete all your current config \nAre you sure?\');">';
echo ' </form>';
echo '</td>';
echo '<td>';
echo '<form action="scripts/removeServer.php';
echo "?serverchoose=${server}";
echo '" autocomplete="off" method="post">';
echo '<input type="submit" class="btn btn-info" value="Delete Server" onclick="return confirm(\'This will completly delete the server \nAre you sure?\');">';
echo ' </form>';
echo '</td>';
echo '<td>';
echo '<form action="scripts/schedulerConfig.php';
echo "?serverchoose=${server}";
echo '" autocomplete="off" method="post">';
echo '<input type="submit" class="btn btn-info" value="Schedule Configuration">';
echo ' </form>';
echo '</td>';
}
echo '</table>';
echo '</div>';
echo '<table class="table">
<td>';
if ($role == "Admin") {
echo '<form action="scripts/changeConfigFile.php';
echo "?serverchoose=${server}&action=json";
echo '" autocomplete="off" method="post">';
echo "Server name : <br>";
echo '<input type="text" name="serverName" value="';
echo "$serverName";
echo '">';
echo "<br>";
echo "Server description : <br>";
echo '<input type="text" name="serverDescription" value="';
echo "$serverDescription";
echo '">';
echo "<br>";
echo "Server tags : <br>";
echo '<input type="text" name="serverTags" value="';
echo "$serverTags";
echo '">';
echo "<br>";
echo "Max players : <br>";
echo '<input type="text" name="serverMaxPlayers" value="';
echo "$serverMaxPlayers";
echo '">';
echo "<br>";
if ($serverVisibilityPublic == "true") {
echo "Server Public Visibility : <br>";
echo '<select name="serverVisibilityPublic">';
echo '<option value="true" selected>True</option>';
echo '<option value="false">False</option>';
echo '</select>';
echo "<br>";
} elseif ($serverVisibilityPublic == "false") {
echo "Server Public Visibility : <br>";
echo '<select name="serverVisibilityPublic">';
echo '<option value="true">True</option>';
echo '<option value="false" selected>False</option>';
echo '</select>';
echo "<br>";
}
if ($serverVisibilityLan == "true") {
echo "Server Lan Visibility : <br>";
echo '<select name="serverVisibilityLan">';
echo '<option value="true" selected>True</option>';
echo '<option value="false">False</option>';
echo '</select>';
echo "<br>";
} elseif ($serverVisibilityLan == "false") {
echo "Server Lan Visibility : <br>";
echo '<select name="serverVisibilityLan">';
echo '<option value="true">True</option>';
echo '<option value="false" selected>False</option>';
echo '</select>';
echo "<br>";
}
echo "Token (hidden) : <br>";
echo '<input type="password" name="serverToken" >';
echo "<br>";
echo "Factorio.com Username : <br>";
echo '<input type="text" name="serverFactorioUsername" value="';
echo "$serverFactorioUsername";
echo '">';
echo "<br>";
echo "Factorio.com Password (hidden) : <br>";
echo '<input type="password" name="serverFactorioPassword" >';
echo "<br>";
echo "Server password : <br>";
echo '<input type="text" name="serverPassword" value="';
echo "$serverPassword";
echo '">';
echo "<br>";
if ($serverUserVerification == "true") {
echo "User verification : <br>";
echo '<select name="serverUserVerification">';
echo '<option value="true" selected>True</option>';
echo '<option value="false">False</option>';
echo '</select>';
echo "<br>";
} elseif ($serverUserVerification == "false") {
echo "User verification : <br>";
echo '<select name="serverUserVerification">';
echo '<option value="true">True</option>';
echo '<option value="false" selected>False</option>';
echo '</select>';
echo "<br>";
}
echo "Upload limit in kb/s : <br>";
echo '<input type="text" name="serverUpload" value="';
echo "$serverUpload";
echo '">';
echo "<br>";
echo "Latency limit in ticks (1 tick = 16ms) : <br>";
echo '<input type="text" name="serverLatency" value="';
echo "$serverLatency";
echo '">';
echo "<br>";
if ($serverIgnorePlayerLimit == "true") {
echo "Ignore player limit for returning players : <br>";
echo '<select name="serverIgnorePlayerLimit">';
echo '<option value="true" selected>True</option>';
echo '<option value="false">False</option>';
echo '</select>';
echo "<br>";
} elseif ($serverIgnorePlayerLimit == "false") {
echo "Ignore player limit for returning players : <br>";
echo '<select name="serverIgnorePlayerLimit">';
echo '<option value="true">True</option>';
echo '<option value="false" selected>False</option>';
echo '</select>';
echo "<br>";
}
if ($serverAllowCommands == "true") {
echo "Allow commands : <br>";
echo '<select name="serverAllowCommands">';
echo '<option value="true" selected>True</option>';
echo '<option value="false">False</option>';
echo '<option value="admins-only">Admins only</option>';
echo '</select>';
echo "<br>";
} elseif ($serverAllowCommands == "false") {
echo "Allow commands : <br>";
echo '<select name="serverAllowCommands">';
echo '<option value="true">True</option>';
echo '<option value="false" selected>False</option>';
echo '<option value="admins-only">Admins only</option>';
echo '</select>';
echo "<br>";
} elseif ($serverAllowCommands == "admins-only") {
echo "Allow commands : <br>";
echo '<select name="serverAllowCommands">';
echo '<option value="true">True</option>';
echo '<option value="false">False</option>';
echo '<option value="admins-only" selected>Admins only</option>';
echo '</select>';
echo "<br>";
}
echo "Autosave interval : <br>";
echo '<input type="text" name="serverAutoSaveInterval" value="';
echo "$serverAutoSaveInterval";
echo '">';
echo "<br>";
echo "Autosave slots : <br>";
echo '<input type="text" name="serverAutoSaveSlots" value="';
echo "$serverAutoSaveSlots";
echo '">';
echo "<br>";
if ($serverAutoSaveOnlyOnServer == "true") {
echo "Auto save only on server : <br>";
echo '<select name="serverAutoSaveOnlyOnServer">';
echo '<option value="true" selected>True</option>';
echo '<option value="false">False</option>';
echo '</select>';
echo "<br>";
} elseif ($serverAutoSaveOnlyOnServer == "false") {
echo "Auto save only on server : <br>";
echo '<select name="serverAutoSaveOnlyOnServer">';
echo '<option value="true">True</option>';
echo '<option value="false" selected>False</option>';
echo '</select>';
echo "<br>";
}
if ($serverNonBlockSave == "true") {
echo "Non block saving (experimental) : <br>";
echo '<select name="serverNonBlockSave">';
echo '<option value="true" selected>True</option>';
echo '<option value="false">False</option>';
echo '</select>';
echo "<br>";
} elseif ($serverNonBlockSave == "false") {
echo "Non block saving (experimental) : <br>";
echo '<select name="serverNonBlockSave">';
echo '<option value="true">True</option>';
echo '<option value="false" selected>False</option>';
echo '</select>';
echo "<br>";
}
echo "AFK kick (minutes): <br>";
echo '<input type="text" name="serverAFK" value="';
echo "$serverAFK";
echo '">';
echo "<br>";
if ($serverAutoPause == "true") {
echo "Auto pause : <br>";
echo '<select name="serverAutoPause">';
echo '<option value="true" selected>True</option>';
echo '<option value="false">False</option>';
echo '</select>';
echo "<br>";
} elseif ($serverAutoPause == "false") {
echo "Auto pause : <br>";
echo '<select name="serverAutoPause">';
echo '<option value="true">True</option>';
echo '<option value="false" selected>False</option>';
echo '</select>';
echo "<br>";
}
if ($serverOnlyAdminPause == "true") {
echo "Only admins can pause the game : <br>";
echo '<select name="serverOnlyAdminPause">';
echo '<option value="true" selected>True</option>';
echo '<option value="false">False</option>';
echo '</select>';
echo "<br>";
} elseif ($serverOnlyAdminPause == "false") {
echo "Only admins can pause the game : <br>";
echo '<select name="serverOnlyAdminPause">';
echo '<option value="true">True</option>';
echo '<option value="false" selected>False</option>';
echo '</select>';
echo "<br>";
}
} elseif ($role == "Moderator") {
echo '<form action="scripts/changeConfigFile.php';
echo "?serverchoose=${server}";
echo '" autocomplete="off" method="post">';
echo "Server name : <br>";
echo '<input type="text" name="serverName" readonly="readonly" value="';
echo "$serverName";
echo '">';
echo "<br>";
echo "Server description : <br>";
echo '<input type="text" name="serverDescription" readonly="readonly" value="';
echo "$serverDescription";
echo '">';
echo "<br>";
echo "Server tags : <br>";
echo '<input type="text" name="serverTags" readonly="readonly" value="';
echo "$serverTags";
echo '">';
echo "<br>";
echo "Max players : <br>";
echo '<input type="text" name="serverMaxPlayers" readonly="readonly" value="';
echo "$serverMaxPlayers";
echo '">';
echo "<br>";
echo "Server Public Visibility: <br>";
echo '<input type="text" name="serverVisibilityPublic" readonly="readonly" value="';
echo "$serverVisibilityPublic";
echo '">';
echo "<br>";
echo "Server Lan Visibility: <br>";
echo '<input type="text" name="serverVisibilityLan" readonly="readonly" value="';
echo "$serverVisibilityLan";
echo '">';
echo "<br>";
echo "Token (hidden) : <br>";
echo '<input type="password" name="serverToken" readonly="readonly">';
echo "<br>";
echo "Factorio.com Username : <br>";
echo '<input type="text" name="serverFactorioUsername" readonly="readonly" value="';
echo "$serverFactorioUsername";
echo '">';
echo "<br>";
echo "Factorio.com Password (hidden) : <br>";
echo '<input type="password" readonly="readonly" name="serverFactorioPassword" >';
echo "<br>";
echo "Server password : <br>";
echo '<input type="text" name="serverPassword" readonly="readonly" value="';
echo "$serverPassword";
echo '">';
echo "<br>";
echo "User verification : <br>";
echo '<input type="text" name="serverUserVerification" readonly="readonly" value="';
echo "$serverUserVerification";
echo '">';
echo "<br>";
echo "Upload limit in kb/s : <br>";
echo '<input type="text" name="serverUpload" readonly="readonly" value="';
echo "$serverUpload";
echo '">';
echo "<br>";
echo "Latency limit in ticks (1 tick = 16ms) : <br>";
echo '<input type="text" name="serverLatency" readonly="readonly" value="';
echo "$serverLatency";
echo '">';
echo "<br>";
echo "Ignore player limit for returning players : <br>";
echo '<input type="text" name="serverIgnorePlayerLimit" readonly="readonly" value="';
echo "$serverIgnorePlayerLimit";
echo '">';
echo "<br>";
echo "Allow commands : <br>";
echo '<input type="text" name="serverAllowCommands" readonly="readonly" value="';
echo "$serverAllowCommands";
echo '">';
echo "<br>";
echo "Autosave interval : <br>";
echo '<input type="text" name="serverAutoSaveInterval" readonly="readonly" value="';
echo "$serverAutoSaveInterval";
echo '">';
echo "<br>";
echo "Autosave slots : <br>";
echo '<input type="text" name="serverAutoSaveSlots" readonly="readonly" value="';
echo "$serverAutoSaveSlots";
echo '">';
echo "<br>";
echo "Auto save only on server : <br>";
echo '<input type="text" name="serverAutoSaveOnlyOnServer" readonly="readonly" value="';
echo "$serverAutoSaveOnlyOnServer";
echo '">';
echo "<br>";
echo "Non block saving (experimental) : <br>";
echo '<input type="text" name="serverNonBlockSave" readonly="readonly" value="';
echo "$serverNonBlockSave";
echo '">';
echo "<br>";
echo "AFK kick (minutes): <br>";
echo '<input type="text" name="serverAFK" value="';
echo "$serverAFK";
echo '">';
echo "<br>";
if ($serverAutoPause == "true") {
echo "Auto pause : <br>";
echo '<select name="serverAutoPause">';
echo '<option value="true" selected>True</option>';
echo '<option value="false">False</option>';
echo '</select>';
echo "<br>";
} elseif ($serverAutoPause == "false") {
echo "Auto pause : <br>";
echo '<select name="serverAutoPause">';
echo '<option value="true">True</option>';
echo '<option value="false" selected>False</option>';
echo '</select>';
echo "<br>";
}
echo "Only admins can pause the game : <br>";
echo '<input type="text" name="serverOnlyAdminPause" readonly="readonly" value="';
echo "$serverOnlyAdminPause";
echo '">';
echo "<br>";
}
echo '<input type="submit" value="Apply Config">';
echo ' </form>';
?>
</td>
<td valign="top">
<?php
/* --------------------------------------------------------------------------------*/
echo '<form action="scripts/changeConfigFile.php';
echo "?serverchoose=${server}&action=github";
echo '" autocomplete="off" method="post">';
echo "<br>";
if ($role == "Admin") {
echo "Github Scenario URL : <br>";
echo '<input type="text" name="serverGithubScenario" value="';
echo "$serverGithubScenario";
echo '">';
echo "<br>";
echo "Github Scenario PATH : <br>";
echo '<input type="text" name="serverGithubScenarioPath" value="';
echo "$serverGithubScenarioPath";
echo '">';
echo "<br>";
if ($serverVersion == "stable") {
echo "Factorio Version: <br>";
echo '<select name="serverVersion">';
echo '<option value="stable" selected>Stable</option>';
echo '<option value="latest">Latest</option>';
echo '</select>';
echo "<br>";
} elseif ($serverVersion == "latest") {
echo "Factorio Version : <br>";
echo '<select name="serverVersion">';
echo '<option value="stable">Stable</option>';
echo '<option value="latest" selected>Latest</option>';
echo '</select>';
echo "<br>";
}
echo "Max rocket for reset (if enabled) : <br>";
echo '<input type="text" name="serverRocketResetCounter" value="';
echo "$serverRocketResetCounter";
echo '">';
echo "<br>";
} elseif ($role == "Moderator") {
echo "Github Scenario URL : <br>";
echo '<input type="text" name="serverGithubScenario" readonly="readonly" value="';
echo "$serverGithubScenario";
echo '">';
echo "<br>";
echo "Github Scenario PATH : <br>";
echo '<input type="text" name="serverGithubScenarioPath" readonly="readonly" value="';
echo "$serverGithubScenarioPath";
echo '">';
echo "<br>";
echo "Factorio Version : <br>";
echo '<input type="text" name="serverVersion" readonly="readonly" value="';
echo "$serverVersion";
echo '">';
echo "<br>";
echo "Max rocket for reset (if enabled) : <br>";
echo '<input type="text" name="serverRocketResetCounter" value="';
echo "$serverRocketResetCounter";
echo '">';
echo "<br>";
}
echo '<input type="submit" value="Apply Config">';
echo '</form>';
?>
</td>
<td valign="top">
<?php
/* --------------------------------------------------------------------------------*/
echo '<form action="scripts/changeConfigFile.php';
echo "?serverchoose=${server}&action=servermanager";
echo '" autocomplete="off" method="post">';
echo "<br>";
if ($role == "Admin") {
echo "BOT token : <br>";
echo '<input type="text" name="serverManagerToken" value="';
echo "$serverManagerToken";
echo '">';
echo "<br>";
echo "Chat ID : <br>";
echo '<input type="text" name="serverManagerFactorioChatID" value="';
echo "$serverManagerFactorioChatID";
echo '">';
echo "<br>";
if ($serverManagerConsoleChat == "false") {
echo "Console chat channel : <br>";
echo '<select name="serverManagerConsoleChat">';
echo '<option value="false" selected>False</option>';
echo '<option value="true">True</option>';
echo '</select>';
echo "<br>";
} elseif ($serverManagerConsoleChat == "true") {
echo "Console chat channel : <br>";
echo '<select name="serverManagerConsoleChat">';
echo '<option value="false">False</option>';
echo '<option value="true" selected>True</option>';
echo '</select>';
echo "<br>";
}
echo "Console chat ID : <br>";
echo '<input type="text" name="serverManagerConsoleChatID" value="';
echo "$serverManagerConsoleChatID";
echo '">';
echo "<br>";
echo "Map settigns path : <br>";
echo '<input type="text" name="serverManagerMapSettigns" value="';
echo "$serverManagerMapSettigns";
echo '">';
echo "<br>";
echo "Map gen settigns path : <br>";
echo '<input type="text" name="serverManagerMapGenSettigns" value="';
echo "$serverManagerMapGenSettigns";
echo '">';
echo "<br>";
echo "Game Port : <br>";
echo '<input type="text" name="serverManagerPort" value="';
echo "$serverManagerPort";
echo '">';
echo "<br>";
echo "Rcon Port : <br>";
echo '<input type="text" name="serverManagerRconPort" value="';
echo "$serverManagerRconPort";
echo '">';
echo "<br>";
echo "Rcon Password : <br>";
echo '<input type="text" name="serverManagerRconPassword" value="';
echo "$serverManagerRconPassword";
echo '">';
echo "<br>";
echo "Admin ID's : <br>";
echo '<input type="text" name="serverManagerAdmins" value="';
echo "$serverManagerAdmins";
echo '">';
echo "<br>";
echo "Bot prefix : <br>";
echo '<input type="text" name="serverManagerPrefix" value="';
echo "$serverManagerPrefix";
echo '">';
echo "<br>";
echo "Mod list location : <br>";
echo '<input type="text" name="serverManagerModListLocation" value="';
echo "$serverManagerModListLocation";
echo '">';
echo "<br>";
echo "Exit grace time (in seconds) : <br>";
echo '<input type="text" name="serverManagerExitGracePeriod" value="';
echo "$serverManagerExitGracePeriod";
echo '">';
echo "<br>";
echo "Reset channel ID : <br>";
echo '<input type="text" name="serverManagerResetChatID" value="';
echo "$serverManagerResetChatID";
echo '">';
echo "<br>";
} elseif ($role == "Moderator") {
echo "BOT token : <br>";
echo '<input type="text" name="serverManagerToken" readonly="readonly" value="';
echo "$serverManagerToken";
echo '">';
echo "<br>";
echo "Chat ID : <br>";
echo '<input type="text" name="serverManagerFactorioChatID" readonly="readonly" value="';
echo "$serverManagerFactorioChatID";
echo '">';
echo "<br>";
echo "Console chat channel : <br>";
echo '<input type="text" name="serverManagerConsoleChat" readonly="readonly" value="';
echo "$serverManagerConsoleChat";
echo '">';
echo "<br>";
echo "Console chat ID : <br>";
echo '<input type="text" name="serverManagerConsoleChatID" readonly="readonly" value="';
echo "$serverManagerConsoleChatID";
echo '">';
echo "<br>";
echo "Map settigns path : <br>";
echo '<input type="text" name="serverManagerMapSettigns" readonly="readonly" value="';
echo "$serverManagerMapSettigns";
echo '">';
echo "<br>";
echo "Game Port : <br>";
echo '<input type="text" name="serverManagerPort" readonly="readonly" value="';
echo "$serverManagerPort";
echo '">';
echo "<br>";
echo "Rcon Port : <br>";
echo '<input type="text" name="serverManagerRconPort" readonly="readonly" value="';
echo "$serverManagerRconPort";
echo '">';
echo "<br>";
echo "Rcon Password : <br>";
echo '<input type="text" name="serverManagerRconPassword" readonly="readonly" value="';
echo '">';
echo "<br>";
echo "Admin ID's : <br>";
echo '<input type="text" name="serverManagerAdmins" readonly="readonly" value="';
echo "$serverManagerAdmins";
echo '">';
echo "<br>";
echo "Bot prefix : <br>";
echo '<input type="text" name="serverManagerPrefix" readonly="readonly" value="';
echo "$serverManagerPrefix";
echo '">';
echo "<br>";
echo "Mod list location : <br>";
echo '<input type="text" name="serverManagerModListLocation" readonly="readonly" value="';
echo "$serverManagerModListLocation";
echo '">';
echo "<br>";
echo "Exit grace time (in seconds) : <br>";
echo '<input type="text" name="serverManagerExitGracePeriod" readonly="readonly" value="';
echo "$serverManagerExitGracePeriod";
echo '">';
echo "<br>";
echo "Reset channel ID : <br>";
echo '<input type="text" name="serverManagerResetChatID" readonly="readonly" value="';
echo "$serverManagerResetChatID";
echo '">';
echo "<br>";
}
echo '<input type="submit" value="Apply Config">';
echo '</form>';
?>
</td>
</table>
</div>