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.");
97 #ifndef STARSHATTER_DEMO_RELEASE
147 return Game::Init(hi, hpi, cmdline, nCmdShow);
182 ::Print(
"\n\n\nStarshatter Server Init\n");
183 ::Print(
"-----------------------\n");
184 ::Print(
"Server Name: %s\n", (
const char*) server_config->
Name());
188 ::
Print(
"Server Mission: %s\n", (
const char*) server_config->
GetMission());
192 ::Print(
"-----------------------\n");
213 Print(
" game_mode = LOAD_MODE\n");
218 Print(
" game_mode = PLAY_MODE\n");
232 Print(
" game_mode = MENU_MODE\n");
262 Sim* sim =
new(__FILE__,__LINE__)
Sim(0);
264 Print(
" World Created.\n");
284 if (current_mission) {
289 Print(
" Mission Instantiated.\n");
293 Print(
" *** WARNING: StarServer::InstantiateMission() - no mission selected ***\n");
340 frame_time = new_time;
362 static DWORD refresh_time = 0;
363 if (
RealTime() - refresh_time > 1000) {
365 RedrawWindow(
hwnd, 0, 0, RDW_ERASE|RDW_INVALIDATE);
413 PAINTSTRUCT paintstruct;
414 HDC hdc = BeginPaint(
hwnd, &paintstruct);
457 TextOut(hdc, 4, 4, txt_title, txt_title.
length());
458 TextOut(hdc, 4, 22, txt_mode, txt_mode.
length());
459 TextOut(hdc, 4, 40, txt_users, txt_users.
length());
462 if (sim && sim->GetMission()) {
463 Mission* mission = sim->GetMission();
465 txt_msn += mission->
Name();
466 TextOut(hdc, 4, 58, txt_msn, txt_msn.
length());
469 EndPaint(
hwnd, &paintstruct);
486 return (DWORD) E_POINTER;
495 #ifdef STARSHATTER_DEMO_RELEASE
499 strcpy_s(cmdline,
"StarDemo -server");
502 ZeroMemory(&s,
sizeof(s));
505 PROCESS_INFORMATION pi;
506 ZeroMemory(&pi,
sizeof(pi));
508 CreateProcess(
"StarDemo.exe", cmdline, 0, 0, 0, 0, 0, 0, &s, &pi);
517 strcpy_s(cmdline,
"stars -server");
520 ZeroMemory(&s,
sizeof(s));
523 PROCESS_INFORMATION pi;
524 ZeroMemory(&pi,
sizeof(pi));
526 CreateProcess(
"stars.exe", cmdline, 0, 0, 0, 0, 0, 0, &s, &pi);
528 CloseHandle( pi.hProcess );
529 CloseHandle( pi.hThread );
535 return (DWORD) E_POINTER;