60 static Mission* current_mission = 0;
61 static double time_til_change = 0;
62 static bool exit_latch =
true;
69 : loader(0), time_mark(0), minutes(0), game_mode(MENU_MODE),
70 admin_server(0), lobby_server(0)
88 "The file 'shatter.dat' appears to have been damaged. Please re-install Starshatter." :
89 "Starshatter cannot open the file 'shatter.dat'. Please re-install Starshatter.";
91 ::MessageBox(
hwnd, err_msg,
"Starshatter - Error", MB_OK);
93 ::Print(
"\n\nFATAL ERROR: EXIT.");
145 return Game::Init(hi, hpi, cmdline, nCmdShow);
180 ::Print(
"\n\n\nStarshatter Server Init\n");
181 ::Print(
"-----------------------\n");
182 ::Print(
"Server Name: %s\n", (
const char*) server_config->
Name());
186 ::
Print(
"Server Mission: %s\n", (
const char*) server_config->
GetMission());
190 ::Print(
"-----------------------\n");
211 Print(
" game_mode = LOAD_MODE\n");
216 Print(
" game_mode = PLAY_MODE\n");
230 Print(
" game_mode = MENU_MODE\n");
260 Sim* sim =
new(__FILE__,__LINE__)
Sim(0);
262 Print(
" World Created.\n");
282 if (current_mission) {
287 Print(
" Mission Instantiated.\n");
291 Print(
" *** WARNING: StarServer::InstantiateMission() - no mission selected ***\n");
338 frame_time = new_time;
360 static DWORD refresh_time = 0;
361 if (
RealTime() - refresh_time > 1000) {
363 RedrawWindow(
hwnd, 0, 0, RDW_ERASE|RDW_INVALIDATE);
411 PAINTSTRUCT paintstruct;
412 HDC hdc = BeginPaint(
hwnd, &paintstruct);
455 TextOut(hdc, 4, 4, txt_title, txt_title.
length());
456 TextOut(hdc, 4, 22, txt_mode, txt_mode.
length());
457 TextOut(hdc, 4, 40, txt_users, txt_users.
length());
460 if (sim && sim->GetMission()) {
461 Mission* mission = sim->GetMission();
463 txt_msn += mission->
Name();
464 TextOut(hdc, 4, 58, txt_msn, txt_msn.
length());
467 EndPaint(
hwnd, &paintstruct);
484 return (DWORD) E_POINTER;
495 strcpy_s(cmdline,
"stars -server");
498 ZeroMemory(&s,
sizeof(s));
501 PROCESS_INFORMATION pi;
502 ZeroMemory(&pi,
sizeof(pi));
504 CreateProcess(
"stars.exe", cmdline, 0, 0, 0, 0, 0, 0, &s, &pi);
506 CloseHandle( pi.hProcess );
507 CloseHandle( pi.hThread );
511 return (DWORD) E_POINTER;