48 Text admin_name =
"system";
49 Text admin_pass =
"manager";
63 response.
SetHeader(
"MIME-Version",
"1.0");
64 response.
SetHeader(
"Content-Type",
"text/html");
65 response.
SetHeader(
"Cache-Control",
"no-cache");
70 "<body><br>You are already logged in.<br>" +
74 else if (name == admin_name && pass == admin_pass) {
84 response.
SetHeader(
"MIME-Version",
"1.0");
85 response.
SetHeader(
"Content-Type",
"text/html");
86 response.
SetHeader(
"Cache-Control",
"no-cache");
91 "<body><br>You have successfully logged in.<br>" +
97 response.
SetHeader(
"MIME-Version",
"1.0");
98 response.
SetHeader(
"Content-Type",
"text/html");
99 response.
SetHeader(
"Cache-Control",
"no-cache");
103 GetTitleBar(0,
"onLoad=\"self.focus();document.loginForm.user.focus();\"") +
112 " <table border=\"0\" cellspacing=\"0\" cellpadding=\"4\" align=\"left\" width =\"100%\">\n\
114 <td width=\"100\"> </td>\n\
115 <td valign=\"top\" align=\"left\" width=\"400\"><br><br>\n\
116 <span class=\"subhead\">Welcome to the Starshatter Server!</span><br><br>\n\
117 <span class=\"std\">Login to access the server <b>";
121 content += config->
Name();
125 content +=
"</b></span><br>\n\
126 <form name=\"loginForm\" method=\"get\" action=\"/login\">\n\
127 <table border=\"0\" cellspacing=\"0\" cellpadding=\"4\" width=\"100\">\n\
129 <td align=\"left\" valign=\"middle\" width=\"80\"><span class=\"std\">Username:</span></td>\n\
130 <td align=\"left\" valign=\"middle\"><input type=\"text\" name=\"user\" size=\"25\"></td>\n\
133 <td align=\"left\" valign=\"middle\" width=\"80\"><span class=\"std\">Password:</span></td>\n\
134 <td align=\"left\" valign=\"middle\"><input type=\"password\" name=\"pass\" size=\"25\"></td>\n\
138 <td align=\"right\"><input type=\"submit\" value=\"Login\"></td>\n\
165 bool completed =
false;
167 if (action ==
"restart") {
175 response.
SetHeader(
"MIME-Version",
"1.0");
176 response.
SetHeader(
"Content-Type",
"text/html");
177 response.
SetHeader(
"Cache-Control",
"no-cache");
182 "<div class=\"content\"><b>The Starshatter Server will restart in three (3) seconds.</b><br></div>" +
187 else if (action ==
"shutdown") {
195 response.
SetHeader(
"MIME-Version",
"1.0");
196 response.
SetHeader(
"Content-Type",
"text/html");
197 response.
SetHeader(
"Cache-Control",
"no-cache");
202 "<div class=\"content\"><b>The Starshatter Server will shutdown in three (3) seconds.</b><br></div>" +
209 response.
SetHeader(
"MIME-Version",
"1.0");
210 response.
SetHeader(
"Content-Type",
"text/html");
211 response.
SetHeader(
"Cache-Control",
"no-cache");
216 "<body><br>Unknown Action.<br>" +
255 content =
Text((
const char*) buffer, len);
265 response.
AddHeader(
"MIME-Version",
"1.0");
266 response.
AddHeader(
"Cache-Control",
"no-cache");
268 response.
AddHeader(
"Content-Type",
"text/plain");
288 response.
SetHeader(
"MIME-Version",
"1.0");
289 response.
SetHeader(
"Content-Type",
"text/html");
290 response.
SetHeader(
"Cache-Control",
"no-cache");
304 "<script LANGUAGE=\"JavaScript\">\n\
306 function doConfirm() {\n\
307 return confirm(\"Are you sure you want to ban this player?\");\n\
311 <div class=\"content\">\n\
312 <table border=\"0\" width=\"95%\">\n\
313 <tr class=\"heading\">\n\
314 <td nowrap valign=\"middle\" align=\"left\">\n\
315 <span class=\"heading\"> User List</span>\n\
321 " <table border=\"0\" width=\"95%\" class=\"std\">\n\
323 <td nowrap width=\"1%\"> </td>\n\
324 <td nowrap width=\"20%\" valign=\"middle\" align=\"left\"><b>Name</b></td>\n\
325 <td nowrap width=\"10%\" valign=\"middle\" align=\"left\"><b>Address</b></td>\n\
326 <td nowrap width=\"10%\" valign=\"middle\" align=\"center\"><b>Is Host</b></td>\n\
327 <td nowrap width=\"20%\" valign=\"middle\" align=\"left\"><b>Squadron</b></td>\n\
328 <td nowrap width=\"20%\" valign=\"middle\" align=\"center\"><b>Stats</b></td>\n\
329 <td nowrap width=\"19%\" valign=\"middle\" align=\"center\"><b>Ban</b></td>\n\
341 char addr_dotted[32];
345 sprintf_s(addr_dotted,
"%d.%d.%d.%d", a.
B1(), a.
B2(), a.
B3(), a.
B4());
346 sprintf_s(addr_hex,
"%08x", a.
IPAddr());
349 content +=
"<tr>\n<td nowrap width=\"1%\"> </td>\n\
350 <td nowrap valign=\"middle\" align=\"left\">";
351 content += u->
Name();
352 content +=
"</td><td nowrap valign=\"middle\" align=\"left\">";
353 content += addr_dotted;
354 content +=
"</td><td nowrap valign=\"middle\" align=\"center\">";
355 content += u->
IsHost() ?
"*" :
" ";
356 content +=
"</td><td nowrap valign=\"middle\" align=\"left\">";
358 content +=
"</td><td nowrap valign=\"middle\" align=\"center\">";
359 content += user_stats;
360 content +=
"</td><td nowrap valign=\"middle\" align=\"center\">";
361 content +=
"<a onclick=\"return doConfirm()\" href=\"/ban?name=";
365 content +=
"\">BAN</a></td></tr>\n";
369 content +=
" </table>\n\n";
371 content +=
"</div>\n\n";
390 bool completed =
false;
396 while (++u_iter && !completed) {
399 if (u->
Name() == name) {
411 response.
SetHeader(
"MIME-Version",
"1.0");
412 response.
SetHeader(
"Content-Type",
"text/html");
413 response.
SetHeader(
"Cache-Control",
"no-cache");
415 response.
SetHeader(
"Location",
"/users");
419 "<div class=\"content\">User Banned.<br></div>" +
436 if (!net_Admin_server && port > 0)
439 return net_Admin_server;
450 if (net_Admin_server ==
this)
451 net_Admin_server = 0;
462 if (path.
indexOf(
"/login") == 0)
465 if (path.
indexOf(
"/chat") == 0)
468 if (path.
indexOf(
"/server") == 0)
471 if (path.
indexOf(
"/file") == 0)
474 if (path.
indexOf(
"/user") == 0)
488 if (user && msg && *msg) {
575 while (++s_iter && !found) {
605 if (request.
URI() ==
"/home")
610 response.
SetHeader(
"MIME-Version",
"1.0");
611 response.
SetHeader(
"Content-Type",
"text/html");
612 response.
SetHeader(
"Cache-Control",
"no-cache");
636 response.
SetHeader(
"MIME-Version",
"1.0");
637 response.
SetHeader(
"Content-Type",
"text/plain");
638 response.
SetHeader(
"Cache-Control",
"no-cache");
640 response.
SetHeader(
"Location",
"/login");
641 response.
SetContent(
"You are not logged in.");
655 "body { font-family:arial,helvetica,sans-serif; color:black; background-color:white }\n\
656 a:link { text-decoration:none; font-weight:normal; font-size:10pt; color:black }\n\
657 a:visited { text-decoration:none; font-weight:normal; font-size:10pt; color:black }\n\
658 a:hover { text-decoration:underline; font-weight:normal; font-size:10pt; color:black }\n\
659 .std { font-size:10pt }\n\
660 .tiny { font-size:8pt }\n\
661 .heading { font-size:14pt; font-weight:bold; background-color:#99BBEE }\n\
662 .subhead { font-size:11pt; font-weight:bold }\n\
663 .status { font-size:10pt; color:white }\n\
664 .content { padding-right: 4pt; padding-left: 4pt; padding-bottom: 4pt; padding-top: 4pt; margin: 4pt; }\n\
665 .copy { font-size:8pt; }\n\
666 .top-bar { color: white; background-color: #336699 }\n\
667 .top-line { color: yellow; background-color: black }\n\
668 .topbarbig { line-height:24px; color:white; font-size:18px; font-weight:bold; }\n\
669 .topbarsmall { line-height:18px; color:white; font-size:14px; }\n";
675 Text head =
"<html>\n<head>\n<title>Starshatter Server";
677 if (title && *title) {
682 head +=
"</title>\n<style type=\"text/css\" media=\"screen\">\n";
684 head +=
"</style>\n</head>\n";
702 if (onload && *onload)
705 bar +=
" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n\
706 <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" class=\"top-bar\">\n\
707 <tr height=\"50\">\n\
709 <td valign=\"middle\" align=\"left\">\n\
710 <span class=\"topbarsmall\">Administration Console</span><br>\n";
713 bar +=
"<a href=\"/home\">";
716 bar +=
"<span class=\"topbarbig\">Starshatter Server ";
727 <tr class=\"top-line\">\n\
730 if (statline && *statline)
748 " <table width=\"100%\" cellspacing=\"0\" cellpadding=\"2\" border=\"0\">\n\
750 <td nowrap width=\"33%\" class=\"top-line\" align=\"left\">\n\
751 <span class=\"status\"> Connected to <b>";
757 line +=
"</b></span>\n\
759 <td nowrap width=\"34%\" class=\"top-line\" align=\"center\">\n\
760 <span class=\"status\">Server Mode: <b>";
778 line +=
"</b></span>\n\
780 <td nowrap width=\"33%\" class=\"top-line\" align=\"right\">\n\
781 <span class=\"status\">";
785 line +=
" </span>\n\
797 "<script LANGUAGE=\"JavaScript\">\n\
799 function doConfirm() {\n\
800 return confirm(\"Are you sure you want to do this?\");\n\
804 <div class=\"content\">\n\
805 <table border=\"0\" width=\"95%\">\n\
806 <tr class=\"heading\">\n\
807 <td nowrap valign=\"middle\" align=\"left\">\n\
808 <span class=\"heading\"> Game Admin Functions</span>\n\
812 <table border=\"0\" width=\"95%\">\n\
814 <td nowrap width=\"1%\"> </td>\n\
815 <td nowrap width=\"33%\" valign=\"middle\" align=\"left\">\n\
816 <a href=\"/chat\">Lobby Chat</a>\n\
818 <td nowrap width=\"33%\" valign=\"middle\" align=\"left\">\n\
819 <a href=\"/home\">Mission List</a>\n\
824 <td nowrap width=\"1%\"> </td>\n\
825 <td nowrap width=\"33%\" valign=\"middle\" align=\"left\">\n\
826 <a href=\"/file?name=errlog.txt\">View Error Log</a>\n\
828 <td nowrap width=\"33%\" valign=\"middle\" align=\"left\">\n\
829 <a href=\"/users\">Player List</a>\n\
834 <td nowrap width=\"1%\"> </td>\n\
835 <td nowrap width=\"33%\" valign=\"middle\" align=\"left\">\n\
836 <a href=\"/file?name=serverlog.txt\">View Server Log</a>\n\
838 <td nowrap width=\"33%\" valign=\"middle\" align=\"left\">\n\
839 <a href=\"/home\">Ban List</a>\n\
844 <td nowrap width=\"1%\"> </td>\n\
845 <td nowrap width=\"33%\" valign=\"middle\" align=\"left\"></td>\n\
846 <td nowrap width=\"33%\" valign=\"middle\" align=\"left\"></td>\n\
852 " <table border=\"0\" width=\"95%\">\n\
853 <tr class=\"heading\">\n\
854 <td nowrap valign=\"middle\" align=\"left\">\n\
855 <span class=\"heading\"> Server Admin Functions</span>\n\
859 <table border=\"0\" width=\"95%\">\n\
861 <td nowrap width=\"1%\"> </td>\n\
862 <td nowrap width=\"33%\" valign=\"middle\" align=\"left\">\n\
863 <a onclick=\"return doConfirm()\" href=\"/server?action=restart\">Restart Server</a>\n\
865 <td nowrap width=\"33%\" valign=\"middle\" align=\"left\">\n\
866 <a onclick=\"return doConfirm()\" href=\"/server?action=shutdown\">Shutdown Server</a>\n\
872 content +=
"</div>\n\n";
880 return "\n\n</body>\n</html>\n";
886 return "<br><span class=\"copy\"> Copyright © 1997-2004 Destroyer Studios. All rights reserved.</span><br>";