summaryrefslogtreecommitdiff
path: root/utils/tfstats/plrpersist.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/plrpersist.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'utils/tfstats/plrpersist.h')
-rw-r--r--utils/tfstats/plrpersist.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/utils/tfstats/plrpersist.h b/utils/tfstats/plrpersist.h
new file mode 100644
index 0000000..a6302cd
--- /dev/null
+++ b/utils/tfstats/plrpersist.h
@@ -0,0 +1,91 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//
+//=============================================================================//
+#pragma warning (disable:4786)
+//=========== (C) Copyright 1999 Valve, L.L.C. All rights reserved. ===========
+//
+// The copyright to the contents herein is the property of Valve, L.L.C.
+// The contents may be used and/or copied only with the written permission of
+// Valve, L.L.C., or in accordance with the terms and conditions stipulated in
+// the agreement/contract under which the contents have been supplied.
+//
+// Purpose:
+//
+// $Workfile: $
+// $Date: $
+//
+//------------------------------------------------------------------------------------------------------
+// $Log: $
+//
+// $NoKeywords: $
+//=============================================================================
+#ifndef PLRPERSIST_H
+#define PLRPERSIST_H
+#ifdef WIN32
+#pragma once
+#endif
+#include <time.h>
+#include <map>
+#include <string>
+#include <list>
+#include <utility>
+#include "TimeIndexedList.h"
+#include "Player.h"
+#include "TextFile.h"
+using namespace std;
+
+//------------------------------------------------------------------------------------------------------
+// Purpose: Represents persistent player data. This class is used to save and load
+// Player data from the disk.
+//------------------------------------------------------------------------------------------------------
+class CPlrPersist
+{
+public:
+ unsigned long WONID;
+ int kills;
+ int deaths;
+ time_t timeon;
+
+ bool valid;
+
+ string faveString(map<string,int>& theMap);
+
+ map<string,int> nickmap;
+ string faveName();
+ map<string,int> weapmap;
+ string faveWeap();
+ map<string,int> classmap;
+ string faveClass();
+ list<pair<time_t,time_t> > playtimes;
+
+ time_t lastplayed;
+
+ int matches;
+ int suicides;
+ int faveweapkills;
+ double rank();
+
+
+ CPlrPersist()
+ {
+ kills=deaths=suicides=faveweapkills=matches=0;WONID=-1;
+ }
+
+
+
+ void read(unsigned long WONID);
+ void read(CTextFile& f);
+ void merge(CPlrPersist& cpp,bool mergeOverlaps=false);
+ void generate(CPlayer& cp);
+ void write();
+
+ list<pair<time_t,time_t> >::iterator timesOverlap(time_t start, time_t end,bool testself=true);
+};
+
+
+
+#endif // PLRPERSIST_H