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:
|
<?php
if (!ereg("/^[0-9]{5}", $HTTP_POST_VARS['net_port'])) {
echo "Fataler Fehler, Port falsch";
die;
}
/* Begin ausgabe */
$confcontent = "//Oeffentliche Server-Informationen:\n\n"
."//Name des Servers\n"
."set sv_hostname \"" . $HTTP_POST_VARS['sv_hostname'] . "\"\n\n"
."//Administrator des Servers\n"
."sets _Admin \"" . $HTTP_POST_VARS['ADMIN'] . "\"\n\n"
."//E-Mail-Adresse des Admins\n"
."sets _Email \"" . $HTTP_POST_VARS['MAIL'] . "\"\n\n"
."//IRC-Channels\n"
."sets _IRC \"#" . $HTTP_POST_VARS['IRC'] . "\"\n\n"
."//Homepage\n"
."sets _Url \"" . $HTTP_POST_VARS['WEBSITE'] . "\"\n\n"
."//Standort des Servers\n"
."sets _Location \"" . $HTTP_POST_VARS['LOCATION'] . "\"\n"
."//MOTD\n"
."sets scr_motd \"" . $HTTP_POST_VARS['MOTD'] . "\"\n\n"
."//***\n\n"
."//Passw-rter\n\n"
."//RCON-Passwort\n"
."set rcon_password \"" . $HTTP_POST_VARS['rcon_password'] . "\"\n\n"
."//NUR EINS VON BEIDEN VERWENDEN!\n"
."//Server-Passwort\n"
."set g_password \"" . $HTTP_POST_VARS['g_password'] . "\"\n\n"
."//Privates Passwort\n"
."set sv_privatepassword \"" . $HTTP_POST_VARS['sv_privatePassword'] . "\"\n\n"
."//***\n\n"
."//Allgemeine Servereinstellungen:\n\n"
."//IP des Servers\n"
."set net_ip \"\"\n\n"
."//Port des Servers\n"
."set net_port \"" . $HTTP_POST_VARS['net_port'] . "\"\n\n"
."//Maximale Spieleranzahl\n"
."set sv_maxclients \"" . $HTTP_POST_VARS['sv_maxclients'] . "\"\n\n"
."//Private Clients\n"
."set sv_privateClients \"" . $HTTP_POST_VARS['sv_privateClients'] . "\"\n\n"
."//Maximale Datenrate\n"
."set sv_maxRate \"" . $HTTP_POST_VARS['sv_maxRate'] . "\"\n\n"
."//Mindest-Ping der Clients (0 = egal)\n"
."set sv_minPing \"" . $HTTP_POST_VARS['sv_minPing'] . "\"\n\n"
."//Max-Ping der Clients (0 = egal)\n"
."set sv_maxPing \"" . $HTTP_POST_VARS['sv_maxPing'] . "\"\n\n"
."//Antilag-Feature\n"
."set g_antilag \"" . $HTTP_POST_VARS['g_antilag'] . "\"\n\n"
."//Friendly Fire (0 = an, 1 = aus,2 = reflektierend, 3 = geteilter Schaden)\n"
."set scr_friendlyfire \"" . $HTTP_POST_VARS['scr_friendlyfire'] . "\"\n\n"
."//KillCam\n"
."set scr_killcam \"" . $HTTP_POST_VARS['scr_killcam'] . "\"\n\n"
."//Freies Umsehen\n"
."set scr_spectatefree \"" . $HTTP_POST_VARS['scr_spectatefree'] . "\"\n\n"
."//Gegner im Zuschauer-Modus beobachten\n"
."set scr_spectateenemy \"" . $HTTP_POST_VARS['scr_spectateenemy'] . "\"\n\n"
."//PK3-Dateien-Abgleich (0 = an, 1 = aus)\n"
."//Wenn an m+ssen die pk3s des Servers und der Clients gleich sein!\n"
."set sv_pure \"" . $HTTP_POST_VARS['sv_pure'] . "\"\n\n"
."//Punkbuster\n"
."set sv_punkbuster \"" . $HTTP_POST_VARS['sv_punkbuster'] . "\"\n"
."pb_sv_enable\n"
."wait\n\n"
."//Spiel loggen ( 0 = aus 1 = an )\n"
."set logfile \"" . $HTTP_POST_VARS['logfile'] . "\"\n\n"
."//0 - gepuffertes Loggen (zeitversetzt)\n"
."//1 - sofortiges Loggen\n"
."set g_logsync \"" . $HTTP_POST_VARS['g_logsync'] . "\"\n\n"
."//Name der Log-Datei\n"
."set g_log \"" . $HTTP_POST_VARS['g_log'] . "\"\n\n"
."//Automatischer Team-Ausgleich\n"
."set scr_teambalance \"" . $HTTP_POST_VARS['scr_teambalance'] . "\"\n\n"
."//Cheats\n"
."set sv_cheats \"" . $HTTP_POST_VARS['sv_cheats'] . "\"\n\n"
."//Spam-Schutz\n"
."set sv_floodprotect \"" . $HTTP_POST_VARS['sv_floodprotect'] . "\"\n\n"
."//FPS des Servers\n"
."set sv_fps \"" . $HTTP_POST_VARS['sv_fps'] . "\"\n\n"
."//Master-Server (wo der Server angemeldet werden soll)\n"
."seta sv_master0 \"" . $HTTP_POST_VARS['sv_master0'] . "\"\n"
."seta sv_master1 \"" . $HTTP_POST_VARS['sv_master1'] . "\"\n"
."seta sv_master2 \"" . $HTTP_POST_VARS['sv_master2'] . "\"\n"
."seta sv_master3 \"" . $HTTP_POST_VARS['sv_master3'] . "\"\n"
."seta sv_master4 \"" . $HTTP_POST_VARS['sv_master4'] . "\"\n\n"
."//Tote k-nnen mit allen chatten 0 = aus, 1 = an\n"
."set g_deadChat \"" . $HTTP_POST_VARS['g_deadChat'] . "\"\n\n"
."//Konsolensperre f+r Clients\n"
."set sv_disableClientConsole \"" . $HTTP_POST_VARS['sv_disableClientConsole'] . "\"\n\n"
."//Download erlauben\n"
."set sv_allowDownload \"" . $HTTP_POST_VARS['sv_allowDownload'] . "\"\n"
."//WWW Download erlauben\n"
."set sv_wwwDownload \"" . $HTTP_POST_VARS['sv_wwwDownload'] . "\"\n\n"
."set sv_wwwBaseURL \"" . $HTTP_POST_VARS['sv_wwwDownload_url'] . "\"\n\n"
."set sv_wwwDlDisconnected \"0\"\n"
."set sv_reconnectlimit \"3\"\n"
."set sv_dl_maxRate \"150000\" \n\n"
."//Voting erlauben\n"
."set g_allowvote \"" . $HTTP_POST_VARS['g_allowvote'] . "\"\n"
."set g_oldvoting \"" . $HTTP_POST_VARS['g_allowvote'] . "\"\n\n"
."//Voice-Server\n"
."set sv_voice \"" . $HTTP_POST_VARS['sv_voice'] . "\"\n\n"
."//Sprachqualitt -- von 1-9 einstellbar\n"
."set sv_voiceQuality \"" . $HTTP_POST_VARS['sv_voiceQuality'] . "\"\n\n"
."//***\n\n"
."//Waffen-Einstellungen:\n"
."//(0 = verbieten, 1 = erlauben):\n\n"
."//Scharfsch¦+tzengewehre:\n"
."set scr_allow_springfield \"" . $HTTP_POST_VARS['scr_allow_springfield'] . "\"\n"
."set scr_allow_svt40 \"" . $HTTP_POST_VARS['scr_allow_svt40'] . "\"\n"
."set scr_allow_kar98ksniper \"" . $HTTP_POST_VARS['scr_allow_kar98ksniper'] . "\"\n"
."set scr_allow_nagantsniper \"" . $HTTP_POST_VARS['scr_allow_nagantsniper'] . "\"\n"
."set scr_allow_enfieldsniper \"" . $HTTP_POST_VARS['scr_allow_enfieldsniper'] . "\"\n\n"
."//Gewehre:\n"
."set scr_allow_enfield \"" . $HTTP_POST_VARS['scr_allow_enfield'] . "\"\n"
."set scr_allow_kar98k \"" . $HTTP_POST_VARS['scr_allow_kar98k'] . "\"\n"
."set scr_allow_m1carbine \"" . $HTTP_POST_VARS['scr_allow_m1carbine'] . "\"\n"
."set scr_allow_m1garand \"" . $HTTP_POST_VARS['scr_allow_m1garand'] . "\"\n"
."set scr_allow_g43 \"" . $HTTP_POST_VARS['scr_allow_g43'] . "\"\n"
."set scr_allow_nagant \"" . $HTTP_POST_VARS['scr_allow_nagant'] . "\"\n\n"
."//Schwere MG's:\n"
."set scr_allow_bar \"" . $HTTP_POST_VARS['scr_allow_bar'] . "\"\n"
."set scr_allow_bren \"" . $HTTP_POST_VARS['scr_allow_bren'] . "\"\n"
."set scr_allow_mp44 \"" . $HTTP_POST_VARS['scr_allow_mp44'] . "\"\n"
."set scr_allow_ppsh \"" . $HTTP_POST_VARS['scr_allow_ppsh'] . "\"\n\n"
."//Leichte MG's:\n"
."set scr_allow_mp40 \"" . $HTTP_POST_VARS['scr_allow_mp40'] . "\"\n"
."set scr_allow_sten \"" . $HTTP_POST_VARS['scr_allow_sten'] . "\"\n"
."set scr_allow_thompson \"" . $HTTP_POST_VARS['scr_allow_thompson'] . "\"\n"
."set scr_allow_pps42 \"" . $HTTP_POST_VARS['scr_allow_pps42'] . "\"\n"
."set scr_allow_greasegun \"" . $HTTP_POST_VARS['scr_allow_greasegun'] . "\"\n\n"
."//Schrotflinte:\n"
."set scr_allow_shotgun \"" . $HTTP_POST_VARS['scr_allow_shotgun'] . "\"\n\n"
."//Granaten:\n"
."set scr_allow_smokegrenades \"" . $HTTP_POST_VARS['scr_allow_smokegrenades'] . "\"\n"
."set scr_allow_fraggrenades \"" . $HTTP_POST_VARS['scr_allow_fraggrenades'] . "\"\n\n"
."//***\n\n"
."//Spiel-Modi-Einstellungen:\n\n"
."//DM (Death Match)\n\n"
."//Punkte-Limit\n"
."set scr_dm_scorelimit \"" . $HTTP_POST_VARS['scr_dm_scorelimit'] . "\"\n\n"
."//Zeit-Limit\n"
."set scr_dm_timelimit \"" . $HTTP_POST_VARS['scr_dm_timelimit'] . "\"\n\n"
."//TDM (Team Deathmatch)\n"
."//Punkte-Limit\n"
."set scr_tdm_scorelimit \"" . $HTTP_POST_VARS['scr_tdm_scorelimit'] . "\"\n\n"
."//Zeit-Limit\n"
."set scr_tdm_timelimit \"" . $HTTP_POST_VARS['scr_tdm_timelimit'] . "\"\n\n"
."//SD (Seach and Destroy)\n"
."//Zeit bis Rundenstart (Sekunden)\n"
."set scr_sd_graceperiod \"" . $HTTP_POST_VARS['scr_sd_graceperiod'] . "\"\n\n"
."//Rundenlnge\n"
."set scr_sd_roundlength \"" . $HTTP_POST_VARS['scr_sd_roundlength'] . "\"\n\n"
."//Runden-Limit\n"
."set scr_sd_roundlimit \"" . $HTTP_POST_VARS['scr_sd_roundlimit'] . "\"\n\n"
."//Punkte-Limit (Runden)\n"
."set scr_sd_scorelimit \"" . $HTTP_POST_VARS['scr_sd_scorelimit'] . "\"\n\n"
."//Zeit-Limit\n"
."set scr_sd_timelimit \"" . $HTTP_POST_VARS['scr_sd_timelimit'] . "\"\n\n"
."//Zeit bis Explosion der Bombe in Sek.\n"
."set scr_sd_bombtimer \"" . $HTTP_POST_VARS['scr_sd_bombtimer'] . "\"\n\n"
."//CTF (Retrival)\n"
."//Punkte-Limit (Runden)\n"
."set scr_ctf_scorelimit \"" . $HTTP_POST_VARS['scr_ctf_scorelimit'] . "\"\n\n"
."//Zeit-Limit\n"
."set scr_ctf_timelimit \"" . $HTTP_POST_VARS['scr_ctf_timelimit'] . "\"\n\n"
."//HQ\n"
."//Punkte-Limit\n"
."set scr_hq_scorelimit \"" . $HTTP_POST_VARS['scr_hq_scorelimit'] . "\"\n\n"
."//Zeit-Limit\n"
."set scr_hq_timelimit \"" . $HTTP_POST_VARS['scr_hq_timelimit'] . "\"\n\n"
."//***\n"
."//Start-Spiel-Modus\n"
."set g_gametype \"" . $HTTP_POST_VARS['g_gametype'] . "\"\n\n";
/*+++++++++++++++++++++++++++++++++*/
/* Mod Configs sollten hier stehen */
/*+++++++++++++++++++++++++++++++++*/
if (isset($HTTP_POST_VARS['extern_cfg']) && $HTTP_POST_VARS['extern_cfg'] !=""){
$confcontent .="//**** Lade externe Config:\n"
."exec \"" . $HTTP_POST_VARS['extern_cfg'] . "\"\n";
}
/*+++++++++++++++++++++++++++++++++*/
/* Maprotation ist was kniffeliger */
/*+++++++++++++++++++++++++++++++++*/
$confcontent .= "set sv_mapRotation \"";
foreach ($HTTP_POST_VARS['map'] as $playmap) {
$confcontent .= "$playmap ";
}
$confcontent .="\"\n\n\n\n";
/*++++++++++++++++++++++++++++++++++++++++++*/
/* Jetzt sollte die Maprotation fertig sein */
/* Weiter wie gewohnt */
/********************************************/
$confcontent .="set sv_mapRotationCurrentmap \"" . $HTTP_POST_VARS['sv_mapRotationCurrentmap'] . "\"\n\n\n"
."wait 250\n"
."map_rotate\n";
$filename = "/home/example/games/cod2-" . $HTTP_POST_VARS['net_port'] . "/main/cod2clanserver.cfg";
unlink ($filename);
touch ($filename);
// Sichergehen, dass die Datei existiert und beschreibbar ist
echo "<html>";
echo "<head>";
echo "<meta http-equiv=\"refresh\" content=\"2;url=https://example.com/index.php\">";
echo "</head>";
echo "<body>";
if (is_writable($filename)) {
if (!$fp = fopen($filename, 'a')) {
print "Cannot open file ($filename)<br />";
exit;
}
// Schreibe $confcontent in die ge-ffnete Datei.
if (!fwrite($fp, $confcontent)) {
print "Cannot write to file ($filename)<br />";
exit;
}
print "Success, wrote to file ($filename)<br />";
fclose($fp);
} else {
print "The file $filename is not writable<br />";
}
echo "<br /><p><strong>Sie werden gleich weitergeleitet</strong></p>";
echo "</body>";
echo "</html>"; |