Pyrogenesis
13997
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
source
ps
UserReport.h
Go to the documentation of this file.
1
/* Copyright (C) 2011 Wildfire Games.
2
* This file is part of 0 A.D.
3
*
4
* 0 A.D. is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 2 of the License, or
7
* (at your option) any later version.
8
*
9
* 0 A.D. is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#ifndef INCLUDED_USERREPORT
19
#define INCLUDED_USERREPORT
20
21
class
CUserReporterWorker
;
22
23
class
CUserReporter
24
{
25
public
:
26
CUserReporter
();
27
~CUserReporter
();
28
29
void
Initialize
();
30
void
Deinitialize
();
31
32
/**
33
* Must be called frequently (preferably every frame), to update some
34
* internal reconnection timers.
35
*/
36
void
Update
();
37
38
// Functions for the GUI to control the reporting:
39
bool
IsReportingEnabled
();
40
void
SetReportingEnabled
(
bool
enabled);
41
std::string
GetStatus
();
42
43
/**
44
* Submit a report to be transmitted to the online server.
45
* Nothing will be transmitted until reporting is enabled by the user, so
46
* you don't need to check for that first.
47
* @param type short string identifying the type of data ("hwdetect", "message", etc)
48
* @param version positive integer that should be incremented if the data is changed in
49
* a non-compatible way and the server will have to distinguish old and new formats
50
* @param data the actual data (typically UTF-8-encoded text, or JSON, but could be binary)
51
*/
52
void
SubmitReport
(
const
char
* type,
int
version,
const
std::string& data);
53
54
private
:
55
std::string
LoadUserID
();
56
57
CUserReporterWorker
*
m_Worker
;
58
};
59
60
extern
CUserReporter
g_UserReporter
;
61
62
#endif // INCLUDED_USERREPORT
CUserReporter::Update
void Update()
Must be called frequently (preferably every frame), to update some internal reconnection timers...
Definition:
UserReport.cpp:610
g_UserReporter
CUserReporter g_UserReporter
Definition:
UserReport.cpp:73
CUserReporter::GetStatus
std::string GetStatus()
Definition:
UserReport.cpp:564
CUserReporter::m_Worker
CUserReporterWorker * m_Worker
Definition:
UserReport.h:57
CUserReporter::SubmitReport
void SubmitReport(const char *type, int version, const std::string &data)
Submit a report to be transmitted to the online server.
Definition:
UserReport.cpp:616
CUserReporter::~CUserReporter
~CUserReporter()
Definition:
UserReport.cpp:513
CUserReporter
Definition:
UserReport.h:23
CUserReporter::CUserReporter
CUserReporter()
Definition:
UserReport.cpp:508
CUserReporter::LoadUserID
std::string LoadUserID()
Definition:
UserReport.cpp:518
CUserReporter::SetReportingEnabled
void SetReportingEnabled(bool enabled)
Definition:
UserReport.cpp:554
CUserReporterWorker
Definition:
UserReport.cpp:83
CUserReporter::Initialize
void Initialize()
Definition:
UserReport.cpp:573
CUserReporter::IsReportingEnabled
bool IsReportingEnabled()
Definition:
UserReport.cpp:547
CUserReporter::Deinitialize
void Deinitialize()
Definition:
UserReport.cpp:590
Generated on Mon Oct 14 2013 00:58:08 for Pyrogenesis by
1.8.5