added coredump commands for all progs types

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1233 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2005-08-16 18:35:43 +00:00
parent a355262f11
commit b3ba498aad
4 changed files with 64 additions and 0 deletions

View File

@ -2312,6 +2312,9 @@ void CL_Init (void)
// register our commands
//
CLSCR_Init();
#ifdef MENU_DAT
MP_RegisterCvarsAndCmds();
#endif
#ifdef CSQC_DAT
CSQC_RegisterCvarsAndThings();
#endif

View File

@ -3582,8 +3582,28 @@ qboolean CSQC_Init (unsigned int checksum)
return true; //success!
}
void CSQC_CoreDump(void)
{
if (!csqcprogs)
{
Con_Printf("Can't core dump, you need to be running the CSQC progs first.");
return;
}
{
int size = 1024*1024*8;
char *buffer = BZ_Malloc(size);
csqcprogs->save_ents(csqcprogs, buffer, &size, 3);
COM_WriteFile("csqccore.txt", buffer, size);
BZ_Free(buffer);
}
}
void CSQC_RegisterCvarsAndThings(void)
{
Cmd_AddCommand("coredump_csqc", CSQC_CoreDump);
Cvar_Register(&pr_csmaxedicts, "csqc");
Cvar_Register(&cl_csqcdebug, "csqc");
}

View File

@ -1444,6 +1444,28 @@ void MP_Init (void)
}
}
void MP_CoreDump(void)
{
if (!menuprogs)
{
Con_Printf("Can't core dump, you need to be running the CSQC progs first.");
return;
}
{
int size = 1024*1024*8;
char *buffer = BZ_Malloc(size);
menuprogs->save_ents(menuprogs, buffer, &size, 3);
COM_WriteFile("menucore.txt", buffer, size);
BZ_Free(buffer);
}
}
void MP_RegisterCvarsAndCmds(void)
{
Cmd_AddCommand("coredump_menuqc", MP_CoreDump);
}
void MP_Draw(void)
{
if (setjmp(mp_abort))

View File

@ -801,6 +801,24 @@ void PR_BreakPoint_f(void)
Con_Printf("Breakpoint has been cleared\n");
}
void PR_SSCoreDump_f(void)
{
if (!svprogfuncs)
{
Con_Printf("Progs not running, you need to start a server first\n");
return;
}
{
int size = 1024*1024*8;
char *buffer = BZ_Malloc(size);
svprogfuncs->save_ents(svprogfuncs, buffer, &size, 3);
COM_WriteFile("ssqccore.txt", buffer, size);
BZ_Free(buffer);
}
}
/*
#ifdef _DEBUG
void QCLibTest(void)
@ -824,6 +842,7 @@ void PR_Init(void)
Cmd_AddCommand ("decompile", PR_Decompile_f);
Cmd_AddCommand ("compile", PR_Compile_f);
Cmd_AddCommand ("applycompile", PR_ApplyCompilation_f);
Cmd_AddCommand ("coredump_ssqc", PR_SSCoreDump_f);
/*
#ifdef _DEBUG
Cmd_AddCommand ("svtestprogs", QCLibTest);