本文整理汇总了C++中CL_Shutdown函数的典型用法代码示例。如果您正苦于以下问题:C++ CL_Shutdown函数的具体用法?C++ CL_Shutdown怎么用?C++ CL_Shutdown使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CL_Shutdown函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: signal_handler
static void signal_handler( int sig )
{
static int try = 0;
switch( try++ )
{
case 0:
if( sig == SIGINT || sig == SIGTERM )
{
Com_Printf( "Received signal %d, exiting...\n", sig );
Com_Quit();
}
else
{
Com_Error( ERR_FATAL, "Received signal %d\n", sig );
}
break;
case 1:
#ifndef DEDICATED_ONLY
printf( "Received signal %d, exiting...\n", sig );
CL_Shutdown();
_exit( 1 );
break;
case 2:
#endif
printf( "Received signal %d, exiting...\n", sig );
_exit( 1 );
break;
default:
_exit( 1 );
break;
}
}
示例2: Sys_Error
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);
}
示例3: Sys_Quit
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);
}
示例4: Sys_SigHandler
/*
=================
Sys_SigHandler
=================
*/
void Sys_SigHandler( int signal )
{
static qboolean signalcaught = qfalse;
//Com_Printf("signal: %d\n", signal);
if( signalcaught )
{
fprintf( stderr, "DOUBLE SIGNAL FAULT: Received signal %d, exiting...\n",
signal );
}
else
{
signalcaught = qtrue;
VM_Forced_Unload_Start();
fprintf( stderr, "Received signal %d, exiting...\n", signal );
#ifndef DEDICATED
CL_Shutdown();
#endif
SV_Shutdown( "Signal caught" );
VM_Forced_Unload_Done();
}
Sys_Exit( 0 ); // Exit with 0 to avoid recursive signals
}
示例5: Host_Shutdown
//FIXME: this is a callback from Sys_Quit and Sys_Error. It would be better
//to run quit through here before the final handoff to the sys code.
void Host_Shutdown (void)
{
static qbool isdown = false;
if (isdown) {
printf ("recursive shutdown\n");
return;
}
isdown = true;
// on low-end systems quit process may last long time (was about 1 minute for me on old compo),
// at the same time may repeats repeats repeats some sounds, trying preventing this
S_StopAllSounds (true);
S_Update (vec3_origin, vec3_origin, vec3_origin, vec3_origin);
SV_Shutdown ("Server quit\n");
#if (!defined WITH_PNG_STATIC && !defined WITH_JPEG_STATIC)
QLib_Shutdown();
#endif
CL_Shutdown ();
NET_Shutdown ();
Con_Shutdown();
#ifdef WITH_TCL
TCL_Shutdown ();
#endif
qtvlist_deinit();
}
示例6: Com_Quit
/*
* Com_Quit
*
* Both client and server can use this, and it will
* do the apropriate things.
*/
void Com_Quit( void )
{
if( dynvars_initialized )
{
dynvar_t *quit = Dynvar_Lookup( "quit" );
if( quit )
{
// wsw : aiwa : added "quit" event for pluggable clean-up (e.g. IRC shutdown)
Dynvar_CallListeners( quit, NULL );
}
Dynvar_Destroy( quit );
}
SV_Shutdown( "Server quit\n" );
CL_Shutdown();
MM_Shutdown();
if( log_file )
{
FS_FCloseFile( log_file );
log_file = 0;
}
Sys_Quit();
}
示例7: Sys_Quit
void Sys_Quit (void)
{
CL_Shutdown ();
Qcommon_Shutdown ();
fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY);
_exit(0);
}
示例8: Sys_Error
/*
* 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 );
}
示例9: Sys_SigHandler
/*
=================
Sys_SigHandler
=================
*/
void Sys_SigHandler( int signal )
{
static qboolean signalcaught = qfalse;
if( signalcaught )
{
fprintf( stderr, "DOUBLE SIGNAL FAULT: Received signal %d, exiting...\n",
signal );
}
else
{
signalcaught = qtrue;
VM_Forced_Unload_Start();
#ifndef DEDICATED
CL_Shutdown(va("Received signal %d", signal), qtrue, qtrue);
#endif
SV_Shutdown(va("Received signal %d", signal) );
VM_Forced_Unload_Done();
}
if( signal == SIGTERM || signal == SIGINT )
Sys_Exit( 1 );
else
Sys_Exit( 2 );
}
示例10: Sys_Quit
void Sys_Quit (void) {
CL_Shutdown ();
// int on = 1;
// setsockopt(0, SOL_SOCKET, SO_NONBLOCK, &on, sizeof(int));
//jens fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY);
Sys_Exit(0);
}
示例11: Com_Quit_f
/*
=============
Com_Quit_f
Both client and server can use this, and it will
do the apropriate things.
=============
*/
void Com_Quit_f( void ) {
// don't try to shutdown if we are in a recursive error
if ( !com_errorEntered ) {
SV_Shutdown ("Server quit\n");
CL_Shutdown ();
Com_Shutdown ();
}
Sys_Quit ();
}
示例12: main
int main(int argc, char *argv[] )
{
CL_SimplexSolver solver;
CLV frameWidth;
CLV frameHeight;
CLV x;
CLV y;
CL_Constraint cn;
CL_Init();
CL_SetVarMap(CL_VarMapNew());
solver = CL_SimplexSolverNew();
frameWidth = CL_vNew("frameWidth",577,solver);
frameHeight = CL_vNew("frameHeight",651,solver);
CL_SimplexSolverAddStrongStay(solver,frameWidth,10);
CL_SimplexSolverAddStrongStay(solver,frameHeight,10);
x = CL_vNew("x",0,solver);
#ifdef CL_BUILD_FD_SOLVER
y = CL_dvNew("y",4,6,9,15,20,FDN_EOL);
#else
y = CL_vNew("y",4, solver);
#endif
CL_vPrint(x,stdout);
printf("\n");
CL_vPrint(y,stdout);
printf("\n");
printf("x = %g, frameWidth = %g\n",CL_vValue(x),CL_vValue(frameWidth));
cn = CL_ParseConstraint("x = frameWidth/3", "strong");
printf("x = %g, frameWidth = %g\n",CL_vValue(x),CL_vValue(frameWidth));
CL_AddConstraint(solver,cn);
printf("x = %g, frameWidth = %g\n",CL_vValue(x),CL_vValue(frameWidth));
CL_Solve(solver);
printf("x = %g, frameWidth = %g\n",CL_vValue(x),CL_vValue(frameWidth));
printf("\"x\" has Value %g\n", CL_vValue(CL_vLookup("x")));
CL_SolverPrint(solver,stderr);
CL_SimplexSolverSetEditedValue(solver,frameWidth,620);
printf("x = %g, frameWidth = %g\n",CL_vValue(x),CL_vValue(frameWidth));
CL_SolverPrint(solver,stderr);
printf("x = %g, frameWidth = %g\n",CL_vValue(x),CL_vValue(frameWidth));
CL_SimplexSolverSetEditedValue(solver,frameWidth,700);
printf("x = %g, frameWidth = %g\n",CL_vValue(x),CL_vValue(frameWidth));
CL_TableauPrintExternalVariables(solver,stderr);
CL_Shutdown();
return 0;
}
示例13: Com_Error
/*
* Both client and server can use this, and it will
* do the apropriate things.
*/
void
Com_Error(int code, char *fmt, ...)
{
va_list argptr;
static char msg[MAXPRINTMSG];
static qboolean recursive;
if (recursive)
{
Sys_Error("recursive error after: %s", msg);
}
recursive = true;
va_start(argptr, fmt);
vsnprintf(msg, MAXPRINTMSG, fmt, argptr);
va_end(argptr);
if (code == ERR_DISCONNECT)
{
#ifndef DEDICATED_ONLY
CL_Drop();
#endif
recursive = false;
longjmp(abortframe, -1);
}
else if (code == ERR_DROP)
{
Com_Printf("********************\nERROR: %s\n********************\n",
msg);
SV_Shutdown(va("Server crashed: %s\n", msg), false);
#ifndef DEDICATED_ONLY
CL_Drop();
#endif
recursive = false;
longjmp(abortframe, -1);
}
else
{
SV_Shutdown(va("Server fatal crashed: %s\n", msg), false);
#ifndef DEDICATED_ONLY
CL_Shutdown();
#endif
}
if (logfile)
{
fclose(logfile);
logfile = NULL;
}
Sys_Error("%s", msg);
recursive = false;
}
示例14: Com_Error
void QDECL Com_Error( int code, const char *fmt, ... ) {
va_list argptr;
// when we are running automated scripts, make sure we
// know if anything failed
if ( com_buildScript && com_buildScript->integer ) {
code = ERR_FATAL;
}
if ( com_errorEntered ) {
Sys_Error( "recursive error after: %s", com_errorMessage );
}
com_errorEntered = qtrue;
//reset some game stuff here
// SCR_UnprecacheScreenshot();
va_start (argptr,fmt);
Q_vsnprintf (com_errorMessage, sizeof(com_errorMessage), fmt, argptr);
va_end (argptr);
if ( code != ERR_DISCONNECT ) {
Cvar_Get("com_errorMessage", "", CVAR_ROM); //give com_errorMessage a default so it won't come back to life after a resetDefaults
Cvar_Set("com_errorMessage", com_errorMessage);
}
SG_Shutdown(); // close any file pointers
if ( code == ERR_DISCONNECT ) {
SV_Shutdown("Disconnect", qtrue);
CL_Disconnect();
CL_FlushMemory();
CL_StartHunkUsers();
com_errorEntered = qfalse;
throw ("DISCONNECTED\n");
} else if ( code == ERR_DROP ) {
// If loading/saving caused the crash/error - delete the temp file
SG_WipeSavegame("current"); // delete file
SV_Shutdown (va("Server crashed: %s\n", com_errorMessage), qtrue);
CL_Disconnect();
CL_FlushMemory();
CL_StartHunkUsers();
Com_Printf (S_COLOR_RED"********************\n"S_COLOR_MAGENTA"ERROR: %s\n"S_COLOR_RED"********************\n", com_errorMessage);
com_errorEntered = qfalse;
throw ("DROPPED\n");
} else {
CL_Shutdown ();
SV_Shutdown (va(S_COLOR_RED"Server fatal crashed: %s\n", com_errorMessage), qtrue);
}
Com_Shutdown ();
Sys_Error ("%s", com_errorMessage);
}
示例15: Java_com_jeyries_quake2_Quake2_Quake2Quit
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;
}