示例#1
0
void CmdCommandList_f()
{
	gConsole.Output("Full command list:");
	for (int i=0;i<gConsole.m_CommandList.Size();i++)
	{
		if ( gConsole.m_CommandList[i]->IsCommand() )
		{
			gConsole.Output("    %s", gConsole.m_CommandList[i]->GetName() );
		}
	}
}
示例#2
0
void CmdCvarList_f()
{
	gConsole.Output("Full CVar list:");
	for (int i=0;i<gConsole.m_CommandList.Size();i++)
	{
		if ( !gConsole.m_CommandList[i]->IsCommand() )
		{
			gConsole.Output("    %s = %s", ((CVar*)gConsole.m_CommandList[i])->GetName(), ((CVar*)gConsole.m_CommandList[i])->GetString() );
		}
	}
}
示例#3
0
int __cdecl CP_vprintf( int iDebugLevel, const char *format, va_list args) {
  int iRet;

  if( (iDebugLevel < DEBUG_THRESHOLD) || 
      (iDebugLevel < 0) || (iDebugLevel >= N_PRINT_LEVELS))  return 0;

  iRet = _vsnprintf( x_szTmp, MAX_STR_LEN, format, args);  
  // Did some error, but not buffer overflow occur?
  if( (iRet < 0) && (iRet != -1) ) { 
    return iRet;
  }
  // Set text color
  x_CmdWnd.Color( x_awDebugColors[iDebugLevel] );
  x_CmdWnd.Output(x_szTmp);

//  strcat( g_szLogBuffer, x_szTmp );  // add to the log string
  return iRet; 

}
示例#4
0
void CmdExec_f()
{
	if ( gConsole.GetArgumentCount() < 2 )
		return;

	std::ifstream file( gConsole.GetArgument(1), ios::in );

	if ( !file.is_open() )
	{
		gConsole.Output("Unable to exec '%s'", gConsole.GetArgument(1) );
		return;
	}

	std::string str((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
	gConsole.AddCommand("\n");
	gConsole.AddCommand( (char*)str.c_str());
	gConsole.AddCommand("\n");
	
	file.close();
}
示例#5
0
void CmdEcho_f()
{
	if ( gConsole.GetArgumentCount() < 2 )
		return;
	gConsole.Output( gConsole.GetArgument(1) );
}