summaryrefslogtreecommitdiff
path: root/utils/tfstats/tfstatsreport.h
blob: b2d8c774319f9602248af522813bbbff1923f95b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Interface of CTFStatsReport
//
// $Workfile:     $
// $Date:         $
//
//------------------------------------------------------------------------------------------------------
// $Log: $
//
// $NoKeywords: $
//=============================================================================//
#ifndef TFSTATSREPORT_H
#define TFSTATSREPORT_H
#ifdef WIN32
#pragma once
#endif
#ifndef __TFSTATSREPORT_H
#define __TFSTATSREPORT_H
#pragma warning(disable:4786)
#include <time.h>
#include "BinaryResource.h"
#include "MatchInfo.h"
#include "HTML.h"
#include "util.h"	

//------------------------------------------------------------------------------------------------------
// Purpose:  This class is reponsible for generating the top and nav frames of the
//	report. also for generating all the resources such as jpgs, gifs, javascripts and
//	style sheets
//------------------------------------------------------------------------------------------------------
class CTFStatsReport  
{
private:
	time_t matchstart;
	time_t matchend;
	int matchhours;
	int matchminutes;
	int matchseconds;

	bool valid;
	void init();

/*
	const char* makeDurationString();
	char DurationString[300];
*/


	void generate();

	static char* javaScriptSource;
	static char* styleSheetSource;
	//CMatchInfo* pMatchInfo;


	static CBinaryResource gifAwards;
	static CBinaryResource jpgBgLeft;
	static CBinaryResource jpgBgTop;
	static CBinaryResource gifBoxScore;
	static CBinaryResource gifGameDialogOff;
	static CBinaryResource gifGameDialogOn;
	static CBinaryResource gifMatchStatsOff;
	static CBinaryResource gifMatchStatsOn;
	static CBinaryResource gifScores;
	static CBinaryResource gifServerSettingsOff;
	static CBinaryResource gifServerSettingsOn;
	static CBinaryResource gifDetailedScores;
	static CBinaryResource gifPlayerStatsMatchOff;
	static CBinaryResource gifPlayerStatsMatchOn;
	static CBinaryResource gifPlayerStatsServerOff;
	static CBinaryResource gifPlayerStatsServerOn;


	
public:

	explicit CTFStatsReport();
	
	void genImages();
	void genJavaScript();
	void genStyleSheet();
	void genAllPlayersStyleSheet();
	void genIndex();
	void genTopFrame();
	void genNavFrame();

	virtual ~CTFStatsReport();

};

#endif 
#endif // TFSTATSREPORT_H