diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /utils/tfstats/player.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'utils/tfstats/player.h')
| -rw-r--r-- | utils/tfstats/player.h | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/utils/tfstats/player.h b/utils/tfstats/player.h new file mode 100644 index 0000000..d4ffcc2 --- /dev/null +++ b/utils/tfstats/player.h @@ -0,0 +1,94 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Interface of CPlayer +// +// $Workfile: $ +// $Date: $ +// +//------------------------------------------------------------------------------------------------------ +// $Log: $ +// +// $NoKeywords: $ +//=============================================================================// +#pragma warning (disable:4786) +#ifndef PLAYER_H +#define PLAYER_H +#ifdef WIN32 +#pragma once +#endif + +#include <time.h> +#include <map> +#include <string> + +#include "util.h" + +#include "TimeIndexedList.h" +#include "pid.h" +class CMatchInfo; + +class CPlayer +{ +public: + struct plr_per_team_data + { + int kills; + int deaths; + int suicides; + //double rank; + int teamkills; + int teamkilled; + std::map<std::string,int> weaponKills; + std::string faveweapon; + int faveweapkills; + double rank(); + std::string faveWeapon(); + int faveWeapKills(); + plr_per_team_data(){kills=deaths=suicides=teamkills=teamkilled=faveweapkills=0;} + + CTimeIndexedList<player_class> classesplayed; //stores class, indexed by the time when that class was switched to. + + time_t timeon; + time_t timeOn(); + }; + + CTimeIndexedList<player_class> allclassesplayed; //stores class, indexed by the time when that class was switched to. + + CTimeIndexedList<int> teams; + plr_per_team_data perteam[MAX_TEAMS+1]; + + CTimeIndexedList<std::string> aliases; + std::string name; //this will be set to the favourite name of the player + //int team; + int svrPID; + unsigned long WONID; + string ipAddress; + int reconnects; + + + PID pid; + time_t logontime; + time_t logofftime; + time_t totalTimeOn(); + + + + +// int teamID(){return team;} + CPlayer(); + + void nameFound(time_t t, std::string alias); + + + + + + //merge stats from all teams into 5th "team" (all teams) + void merge(); +}; + +#include "pid.h" +typedef std::map<PID,CPlayer> CPlayerList; +typedef CPlayerList::iterator CPlayerListIterator; + +#endif // PLAYER_H |