Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Implementation of CCVarList
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //------------------------------------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #include "cvars.h"
  14. //------------------------------------------------------------------------------------------------------
  15. // Function: CCVarList::writeHTML
  16. // Purpose: generates and writes the report. generate() is not used in this object
  17. // because there is no real intermediate data. Really data is just taken from the
  18. // event list, massaged abit, and written out to the html file. There is no calculation
  19. // of stats or figures so no intermedidate data creation is needed.
  20. // Input: html - the html file that we want to write to.
  21. //------------------------------------------------------------------------------------------------------
  22. void CCVarList::writeHTML(CHTMLFile& html)
  23. {
  24. CEventListIterator it;
  25. html.write("<table border=0 width=100%% cols=%li><tr>\n",HTML_TABLE_NUM_COLS);
  26. bool startOfRow=true;
  27. for (it=g_pMatchInfo->eventList()->begin(); it != g_pMatchInfo->eventList()->end(); ++it)
  28. {
  29. if ((*it)->getType()==CLogEvent::CVAR_ASSIGN)
  30. {
  31. char var[100];
  32. char val[100];
  33. if (!(*it)->getArgument(0) || !(*it)->getArgument(1))
  34. return;
  35. (*it)->getArgument(0)->getStringValue(var);
  36. (*it)->getArgument(1)->getStringValue(val);
  37. //mask off any passwords that the server op may not want to be displayed
  38. if (stricmp(var,"rcon_password")==0 || stricmp(var,"sv_password")==0 || stricmp(var,"password")==0)
  39. {
  40. html.write("<!-- %s not shown! -->\n",var);
  41. continue;
  42. }
  43. if (startOfRow)
  44. {
  45. html.write("</tr>\n<tr>");
  46. startOfRow=false;
  47. }
  48. else
  49. startOfRow=true;
  50. html.write("\t<td><font class=cvar> %s = %s </font> </td>\n",var,val);
  51. }
  52. }
  53. html.write("</tr></table>");
  54. }