DayZ 1.24
Loading...
Searching...
No Matches
PlayerStats.c
Go to the documentation of this file.
2{
4};
5
7{
10
11 //ref PlayerStatsPCO_current m_PCO = new PlayerStatsPCO_current();
13
17 string m_System = "Stats"; //debuging tag
18
19 //int m_SystemVersion = 101;
20
22 {
23 Init(player);
24 }
25
26 void Init(Man player)
27 {
29 }
30
31 PlayerStatsPCO_Base GetPCO(int version = -1)
32 {
33 return m_PCOhandler.GetPCO(version);
34 }
35
37 {
38 //if( GetGame() && GetGame().IsDebugActions() ) GatherAllRecords();
39 }
40
41
43 {
45 if (pco)
46 return pco.GetStatObject(id);
47 else
48 return null;
49 }
50
51 /*
52 array<ref PlayerStatBase> Get()
53 {
54 return m_PlayerStats;
55 }
56 */
58 {
60 }
61
63 {
64 return m_AllowLogs;
65 }
66
68 {
69 /*
70 for(int i = 0; i < m_PlayerStats.Count(); i++)
71 {
72 m_PlayerStats.Get(i).SerializeValue(objects, flags);
73 }
74 */
75 }
76
78 {
79 /*
80 FileHandle file = OpenFile("$profile:StatRecords.log", FileMode.WRITE);
81
82 FPrintln(file, "================================================================");
83 FPrintln(file," ================== " + m_Player.ToString() +" ================== ");
84 FPrintln(file, "================================================================");
85
86 for(int i = 0; i < m_PlayerStats.Count(); i++)
87 {
88 array<PlayerStatRecord> records = m_PlayerStats.Get(i).GetRecords();
89
90 FPrintln(file, m_PlayerStats.Get(i).GetLabel() );
91
92 for(int z = 0; z < records.Count(); z++)
93 {
94 PlayerStatRecord record = records.Get(z);
95 string output = record.GetStringOutput();
96 FPrintln(file, output);
97 }
98 }
99 */
100 }
101
103 {
104 int current_version = GetGame().SaveVersion();
106
107 if (pco)
108 {
109 pco.OnStoreSave(ctx);
110 //Print("Saving stats in version: "+ pco.GetVersion());
111 }
112 else
113 return;
114 }
115
116 bool LoadStats(ParamsReadContext ctx, int version)
117 {
118 PlayerStatsPCO_Base pco = GetPCO(version);
119 if (pco && pco.OnStoreLoad(ctx))
120 {
121 //Print("********* LoadStats loading version: " + pco.GetVersion());
122 return true;
123 }
124 else
125 return false;
126
127 }
128
130 {
131 GetPCO().ResetAllStats();
132 }
133}
override Widget Init()
Definition DayZGame.c:120
EPSstatsFlags
Definition PlayerStats.c:2
@ EMPTY
Definition PlayerStats.c:3
void PCOHandlerStats()
void ~PlayerStats()
Definition PlayerStats.c:36
void Init(Man player)
Definition PlayerStats.c:26
string m_System
Definition PlayerStats.c:17
void ResetAllStats()
void SaveStats(ParamsWriteContext ctx)
ref array< ref StatDebugObject > m_PlayerStatsDebug
Definition PlayerStats.c:9
void SetAllowLogs(bool enable)
Definition PlayerStats.c:57
bool LoadStats(ParamsReadContext ctx, int version)
PlayerStatBase GetStatObject(int id)
Definition PlayerStats.c:42
void GetDebugInfo(array< ref StatDebugObject > objects, int flags)
Definition PlayerStats.c:67
bool GetAllowLogs()
Definition PlayerStats.c:62
ref PCOHandlerStats m_PCOhandler
Definition PlayerStats.c:12
bool m_AllowLogs
Definition PlayerStats.c:16
ref Timer m_SyncTimer
Definition PlayerStats.c:14
void GatherAllRecords()
Definition PlayerStats.c:77
void PlayerStats(Man player)
Definition PlayerStats.c:21
ref array< ref PlayerStatBase > m_PlayerStats
Definition PlayerStats.c:8
PlayerStatsPCO_Base GetPCO(int version=-1)
Definition PlayerStats.c:31
Serialization general interface. Serializer API works with:
Definition Serializer.c:56
proto native CGame GetGame()