summaryrefslogtreecommitdiff
path: root/utils/tfstats/logevent.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /utils/tfstats/logevent.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'utils/tfstats/logevent.h')
-rw-r--r--utils/tfstats/logevent.h144
1 files changed, 144 insertions, 0 deletions
diff --git a/utils/tfstats/logevent.h b/utils/tfstats/logevent.h
new file mode 100644
index 0000000..02fb187
--- /dev/null
+++ b/utils/tfstats/logevent.h
@@ -0,0 +1,144 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: Interface of CLogEvent
+//
+// $Workfile: $
+// $Date: $
+//
+//------------------------------------------------------------------------------------------------------
+// $Log: $
+//
+// $NoKeywords: $
+//=============================================================================//
+#ifndef LOGEVENT_H
+#define LOGEVENT_H
+#ifdef WIN32
+#pragma once
+#endif
+#pragma warning(disable :4786)
+
+
+#include "Argument.h"
+
+#ifdef WIN32
+//#include <strstrea.h>
+#else
+//#include <strstream.h>
+#endif
+#include <time.h>
+//#include <iostream.h>
+
+#include <stdio.h>
+
+
+
+//------------------------------------------------------------------------------------------------------
+// Purpose: CLogEvent represents an event in the log file. e.g. one line.
+// It can have one of several types (enumerated below) and a list of arguments
+// is attached as well.
+//------------------------------------------------------------------------------------------------------
+class CLogEvent
+{
+public:
+ enum Type
+ {
+ NOTYPE =0,
+ INVALID = 0,
+ LOG_FILE_INIT,
+ SERVER_SPAWN,
+ SERVER_SHUTDOWN,
+ LOG_CLOSED,
+ SERVER_MISC,
+ SERVER_NAME,
+ TEAM_RENAME,
+ LEVEL_CHANGE,
+ CVAR_ASSIGN,
+ MAP_CRC,
+ TEAM_JOIN,
+ CONNECT,
+ ENTER_GAME,
+ DISCONNECT,
+ NAME_CHANGE,
+ FRAG,
+ TEAM_FRAG,
+ SUICIDE,
+ KILLED_BY_WORLD,
+ BUILD,
+ MATCH_RESULTS_MARKER,
+ MATCH_DRAW,
+ MATCH_VICTOR,
+ MATCH_TEAM_RESULTS,
+ SAY,
+ SAY_TEAM,
+ CURE,
+ NAMED_GOAL_ACTIVATE,
+ ANON_GOAL_ACTIVATE,
+ NAMED_BROADCAST,
+ ANON_BROADCAST,
+ CLASS_CHANGE,
+ NUM_TYPES
+ };
+
+ char* m_StrippedText;
+private:
+ ArgVector m_args;
+
+ char m_EventCode;
+
+ time_t m_EventTime;
+
+ bool m_Valid;
+ char* m_EventMessage;
+ Type m_EventType;
+
+
+ bool keywordsOccur(char* s1,char* s2=NULL,char* s3=NULL);
+ void parseArgs();
+// void readEventTime(istream& is);
+// void readEventCode(istream& is);
+// void readEventMessage(istream& is);
+ void parseArgument(const char*& raw); //ref to pointer to constant char, gotta love it.
+ void determineType();
+
+public:
+ CLogEvent* m_Next;
+
+ CLogEvent();
+ ~CLogEvent();
+ bool isValid(){return m_Valid;}
+
+// explicit CLogEvent(istream& is);
+// virtual void readEvent(istream& is);
+// virtual void print(ostream& os);
+
+
+
+
+ CLogEvent::Type getType() const {return m_EventType;}
+ time_t getTime() const {return m_EventTime;}
+ const CLogEventArgument* getArgument(int i) const;
+
+ const char* getFullMessage() const {return m_EventMessage;}
+
+
+
+
+ static const char* TypeNames[];
+
+
+ //unused stuff
+protected:
+ void readEventTime(FILE* f);
+ void readEventCode(FILE* f);
+ void readEventMessage(FILE* f);
+
+public:
+ explicit CLogEvent(FILE* f);
+ virtual void readEvent(FILE* f);
+ virtual void print(FILE* f=stdout);
+
+};
+
+
+
+#endif // LOGEVENT_H