void Sys_Quit (void) { CL_Shutdown (); Qcommon_Shutdown (); fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY); _exit(0); }
/* * Sys_Quit */ void Sys_Quit( void ) { fcntl( 0, F_SETFL, fcntl( 0, F_GETFL, 0 ) & ~O_NONBLOCK ); Qcommon_Shutdown(); exit( 0 ); }
void Sys_Error(char *error, ...) { va_list argptr; char text[1024]; #ifndef DEDICATED_ONLY CL_Shutdown(); #endif Qcommon_Shutdown(); va_start(argptr, error); vsprintf(text, error, argptr); va_end(argptr); fprintf(stderr, "Error: %s\n", text); MessageBox(NULL, text, "Error", 0 /* MB_OK */); if (qwclsemaphore) { CloseHandle(qwclsemaphore); } /* Close stdout and stderr */ #ifndef DEDICATED_ONLY fclose(stdout); fclose(stderr); #endif exit(1); }
void Sys_Quit(void) { timeEndPeriod(1); #ifndef DEDICATED_ONLY CL_Shutdown(); #endif Qcommon_Shutdown(); CloseHandle(qwclsemaphore); if (dedicated && dedicated->value) { FreeConsole(); } /* Close stdout and stderr */ #ifndef DEDICATED_ONLY fclose(stdout); fclose(stderr); #endif exit(0); }
/* * Sys_Error */ void Sys_Error( const char *format, ... ) { static qboolean recursive = qfalse; va_list argptr; char string[1024]; // change stdin to non blocking fcntl( 0, F_SETFL, fcntl( 0, F_GETFL, 0 ) & ~FNDELAY ); va_start( argptr, format ); Q_vsnprintfz( string, sizeof( string ), format, argptr ); va_end( argptr ); if( recursive ) { fprintf( stderr, "Recursive Sys_Error: %s\n", string ); _exit( 1 ); } recursive = qtrue; fprintf( stderr, "Error: %s\n", string ); CL_Shutdown(); Qcommon_Shutdown(); _exit( 1 ); }
jint EXPORT_ME Java_com_jeyries_quake2_Quake2_Quake2Quit( JNIEnv* env, jobject thiz ) { //Sys_Quit(); CL_Shutdown (); Qcommon_Shutdown (); //fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY); // _exit(0); return 0; }
void Sys_Quit (void) { timeEndPeriod( 1 ); CL_Shutdown(); Qcommon_Shutdown(); Sys_DestroyConsole(); exit (0); }
void Sys_Quit (void) { timeEndPeriod( 1 ); CL_Shutdown(); Qcommon_Shutdown (); CloseHandle (qwclsemaphore); if (dedicated && dedicated->value) FreeConsole (); exit (0); }
/* * Sys_Quit */ void Sys_Quit( void ) { // Qcommon_Shutdown is going destroy the cvar, so backup its value now // and invalidate the pointer nostdout_backup_val = (nostdout && nostdout->integer ? true : false); nostdout = NULL; fcntl( 0, F_SETFL, fcntl( 0, F_GETFL, 0 ) & ~O_NONBLOCK ); Qcommon_Shutdown(); exit( 0 ); }
/** * @brief * @sa Qcommon_Shutdown */ void Sys_Quit (void) { #ifdef COMPILE_UFO CL_Shutdown(); Qcommon_Shutdown(); Sys_ConsoleShutdown(); #elif COMPILE_MAP Mem_Shutdown(); #endif fcntl(STDIN_FILENO, F_SETFL, fcntl(STDIN_FILENO, F_GETFL, 0) & ~FNDELAY); exit(0); }
void Sys_Quit (void) { timeEndPeriod(1); #ifdef COMPILE_UFO CL_Shutdown(); Qcommon_Shutdown(); #elif COMPILE_MAP Mem_Shutdown(); #endif /* exit(0) */ ExitProcess(0); }
void Sys_Quit (void) { timeEndPeriod( 1 ); CL_Shutdown(); Qcommon_Shutdown (); CloseHandle (qwclsemaphore); if (dedicated && dedicated->value) FreeConsole (); // shut down QHOST hooks if necessary DeinitConProc (); exit (0); }
/** * @note Both client and server can use this, and it will * do the appropriate things. */ void Com_Error (int code, const char* fmt, ...) { va_list argptr; static char msg[MAXPRINTMSG]; static bool recursive = false; if (recursive) Sys_Error("recursive error after: %s", msg); recursive = true; va_start(argptr, fmt); Q_vsnprintf(msg, sizeof(msg), fmt, argptr); va_end(argptr); switch (code) { case ERR_DISCONNECT: Com_Printf("%s\n", msg); CL_Drop(); recursive = false; Com_Drop(); case ERR_DROP: Com_Printf("********************\n"); Com_Printf("ERROR: %s\n", msg); Com_Printf("********************\n"); Sys_Backtrace(); SV_Shutdown("Server crashed.", false); CL_Drop(); recursive = false; Com_Drop(); default: Com_Printf("%s\n", msg); SV_Shutdown("Server fatal crashed", false); /* send an receive net messages a last time */ NET_Wait(0); FS_CloseFile(&logfile); if (pipefile.f != nullptr) { FS_CloseFile(&pipefile); FS_RemoveFile(va("%s/%s", FS_Gamedir(), pipefile.name)); } CL_Shutdown(); Qcommon_Shutdown(); Sys_Error("Shutdown"); } }
void Sys_Quit( void ) { timeEndPeriod( 1 ); SV_Shutdown( "Server quit\n" ); CL_Shutdown(); if( dedicated && dedicated->integer ) FreeConsole(); // shut down QHOST hooks if necessary DeinitConProc(); Qcommon_Shutdown(); exit( 0 ); }
void Sys_Error(char *error, ...){ va_list argptr; char string[1024]; /* change stdin to non blocking */ fcntl(0, F_SETFL, fcntl(0, F_GETFL, 0) & ~FNDELAY); CL_Shutdown(); Qcommon_Shutdown(); va_start(argptr, error); vsnprintf(string, 1024, error, argptr); va_end(argptr); fprintf(stderr, "Error: %s\n", string); _exit(1); }
void Sys_Error( const char *format, ... ) { va_list argptr; char msg[1024]; CL_Shutdown(); va_start( argptr, format ); Q_vsnprintfz( msg, sizeof( msg ), format, argptr ); va_end( argptr ); SDL_ShowSimpleMessageBox( SDL_MESSAGEBOX_ERROR, APPLICATION, msg, NULL ); Qcommon_Shutdown(); exit( 1 ); }
void Sys_Error (const char *error, ...) { va_list argptr; char text[1024]; va_start (argptr, error); vsnprintf (text, sizeof(text), error, argptr); va_end (argptr); timeEndPeriod( 1 ); CL_Shutdown (); Qcommon_Shutdown (); if (qDedConsole) { MSG msg; BOOL bRet; Conbuf_AppendText( text ); Conbuf_AppendText( "\n" ); Sys_SetErrorText( text ); Sys_ShowConsole( 1, true ); // wait for the user to quit while ((bRet = GetMessage(&msg, NULL, 0, 0)) != 0) { if (bRet == -1) break; TranslateMessage (&msg); DispatchMessage (&msg); Sleep(25); } } else { MessageBox(NULL, text, "Error", 0 /* MB_OK */ ); } Sys_DestroyConsole(); exit (1); }
void Sys_Quit(void) { #ifndef DEDICATED_ONLY CL_Shutdown(); #endif if (logfile) { fclose(logfile); logfile = NULL; } Qcommon_Shutdown(); fcntl(0, F_SETFL, fcntl(0, F_GETFL, 0) & ~FNDELAY); printf("------------------------------------\n"); exit(0); }
void Sys_Error (char *error, ...) { va_list argptr; char text[1024]; CL_Shutdown (); Qcommon_Shutdown (); va_start (argptr, error); _vsnprintf (text, sizeof(text), error, argptr); va_end (argptr); text[sizeof(text)-1] = 0; MessageBox(NULL, text, "Error", 0 /* MB_OK */ ); if (qwclsemaphore) CloseHandle (qwclsemaphore); exit (1); }
void Sys_Error (char *error, ...) { va_list argptr; char text[1024]; CL_Shutdown (); Qcommon_Shutdown (); va_start (argptr, error); vsprintf (text, error, argptr); va_end (argptr); MessageBox(NULL, text, "Error", 0 /* MB_OK */ ); if (qwclsemaphore) CloseHandle (qwclsemaphore); // shut down QHOST hooks if necessary DeinitConProc (); exit (1); }
/** * @brief This is the function that is called directly from main() * @sa main * @sa Qcommon_Init * @sa Qcommon_Shutdown * @sa SV_Frame * @sa CL_Frame */ void Qcommon_Frame (void) { try { /* If the next event is due... */ ScheduleEventPtr event = Dequeue_Event(Sys_Milliseconds()); if (event) { /* Dispatch the event */ event->func(event->when, event->data); } } catch (comRestart_t const& restart) { SV_Shutdown("Restart.", false); CL_Shutdown(); Qcommon_Shutdown(); CL_FilterEventQueue(&Event_FilterAll); if (restart.gamedir != nullptr) { const char* restartArgv[] = {"", "+set", "fs_gamedir", restart.gamedir}; Qcommon_Init(4, const_cast<char** >(restartArgv)); } else { Qcommon_Init(0, nullptr); } } catch (comDrop_t const&) { return; } /* Now we spend time_to_next milliseconds working on whatever * IO is ready (but always try at least once, to make sure IO * doesn't stall) */ int time_to_next; do { time_to_next = !eventQueue.empty() ? (eventQueue.begin()->get()->when - Sys_Milliseconds()) : 1000; if (time_to_next < 0) time_to_next = 0; NET_Wait(time_to_next); } while (time_to_next > 0); }
void Sys_Quit( void ) { Qcommon_Shutdown(); exit( 0 ); }