summaryrefslogtreecommitdiff
path: root/utils/tfstats/cvars.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/tfstats/cvars.cpp')
-rw-r--r--utils/tfstats/cvars.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/utils/tfstats/cvars.cpp b/utils/tfstats/cvars.cpp
new file mode 100644
index 0000000..ce0c36b
--- /dev/null
+++ b/utils/tfstats/cvars.cpp
@@ -0,0 +1,63 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: Implementation of CCVarList
+//
+// $Workfile: $
+// $Date: $
+//
+//------------------------------------------------------------------------------------------------------
+// $Log: $
+//
+// $NoKeywords: $
+//=============================================================================//
+#include "cvars.h"
+
+//------------------------------------------------------------------------------------------------------
+// Function: CCVarList::writeHTML
+// Purpose: generates and writes the report. generate() is not used in this object
+// because there is no real intermediate data. Really data is just taken from the
+// event list, massaged abit, and written out to the html file. There is no calculation
+// of stats or figures so no intermedidate data creation is needed.
+// Input: html - the html file that we want to write to.
+//------------------------------------------------------------------------------------------------------
+void CCVarList::writeHTML(CHTMLFile& html)
+{
+ CEventListIterator it;
+ html.write("<table border=0 width=100%% cols=%li><tr>\n",HTML_TABLE_NUM_COLS);
+ bool startOfRow=true;
+ for (it=g_pMatchInfo->eventList()->begin(); it != g_pMatchInfo->eventList()->end(); ++it)
+ {
+ if ((*it)->getType()==CLogEvent::CVAR_ASSIGN)
+ {
+ char var[100];
+ char val[100];
+
+ if (!(*it)->getArgument(0) || !(*it)->getArgument(1))
+ return;
+
+ (*it)->getArgument(0)->getStringValue(var);
+ (*it)->getArgument(1)->getStringValue(val);
+
+
+ //mask off any passwords that the server op may not want to be displayed
+ if (stricmp(var,"rcon_password")==0 || stricmp(var,"sv_password")==0 || stricmp(var,"password")==0)
+ {
+ html.write("<!-- %s not shown! -->\n",var);
+ continue;
+ }
+
+ if (startOfRow)
+ {
+ html.write("</tr>\n<tr>");
+ startOfRow=false;
+ }
+ else
+ startOfRow=true;
+
+ html.write("\t<td><font class=cvar> %s = %s </font> </td>\n",var,val);
+
+ }
+ }
+ html.write("</tr></table>");
+}
+