Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
playerstats.c
Go to the documentation of this file.
1
enum
EPSstatsFlags
2
{
3
EMPTY
= 0,
4
SYNCED
= 1,
5
}
6
7
class
PlayerStats
8
{
9
ref
array<ref PlayerStatBase>
m_PlayerStats
;
10
ref
array<ref StatDebugObject>
m_PlayerStatsDebug
;
11
12
ref
PCOHandlerStats
m_PCOhandler
;
13
14
ref
Timer
m_SyncTimer
;
15
Man
m_Player
;
16
bool
m_AllowLogs
;
17
string
m_System
=
"Stats"
;
//debuging tag
18
19
void
PlayerStats
(Man player)
20
{
21
Init
(player);
22
m_PCOhandler
=
new
PCOHandlerStats
(player);
23
}
24
25
void
Init
(Man player)
26
{
27
m_Player
= player;
28
}
29
30
PlayerStatsPCO_Base
GetPCO
(
int
version = -1 )
31
{
32
return
m_PCOhandler
.GetPCO(version);
33
}
34
35
void
~PlayerStats
()
36
{
37
//if( g_Game && g_Game.IsDebugActions() ) GatherAllRecords();
38
}
39
40
41
PlayerStatBase
GetStatObject
(
int
id
)
42
{
43
PlayerStatsPCO_Base
pco =
GetPCO
();
44
if
( pco )
45
{
46
return
pco.GetStatObject(
id
);
47
}
48
else
49
{
50
return
null;
51
}
52
}
53
54
void
SetAllowLogs
(
bool
enable)
55
{
56
m_AllowLogs
= enable;
57
}
58
59
bool
GetAllowLogs
()
60
{
61
return
m_AllowLogs
;
62
}
63
64
void
GetDebugInfo
(
array<ref StatDebugObject>
objects,
int
flags )
65
{
66
/*
67
for(int i = 0; i < m_PlayerStats.Count(); i++)
68
{
69
m_PlayerStats.Get(i).SerializeValue(objects, flags);
70
}
71
*/
72
}
73
74
void
GatherAllRecords
()
75
{
76
/*
77
FileHandle file = OpenFile("$profile:StatRecords.log", FileMode.WRITE);
78
79
FPrintln(file, "================================================================");
80
FPrintln(file," ================== " + m_Player.ToString() +" ================== ");
81
FPrintln(file, "================================================================");
82
83
for(int i = 0; i < m_PlayerStats.Count(); i++)
84
{
85
array<PlayerStatRecord> records = m_PlayerStats.Get(i).GetRecords();
86
87
FPrintln(file, m_PlayerStats.Get(i).GetLabel() );
88
89
for(int z = 0; z < records.Count(); z++)
90
{
91
PlayerStatRecord record = records.Get(z);
92
string output = record.GetStringOutput();
93
FPrintln(file, output);
94
}
95
}
96
*/
97
}
98
99
void
SaveStats
(
ParamsWriteContext
ctx )
100
{
101
int
current_version =
g_Game
.SaveVersion();
102
PlayerStatsPCO_Base
pco =
GetPCO
(current_version);
103
104
if
( pco )
105
{
106
pco.OnStoreSave(ctx);
107
//Print("Saving stats in version: "+ pco.GetVersion());
108
}
109
else
110
{
111
return
;
112
}
113
}
114
115
bool
LoadStats
(
ParamsReadContext
ctx,
int
version )
116
{
117
PlayerStatsPCO_Base
pco =
GetPCO
(version);
118
if
(pco && pco.OnStoreLoad(ctx))
119
{
120
//Print("********* LoadStats loading version: " + pco.GetVersion());
121
return
true
;
122
}
123
else
124
{
125
return
false
;
126
}
127
128
}
129
130
void
ResetAllStats
()
131
{
132
GetPCO
().ResetAllStats();
133
}
134
135
void
OnRPC
(
ParamsReadContext
ctx)
136
{
137
GetPCO
().OnRPC(ctx);
138
}
139
140
void
OnAfterStoreLoad
()
141
{
142
GetPCO
().OnAfterStoreLoad();
143
}
144
}
m_Player
map m_Player
EMPTY
const string EMPTY
Lists loot spawns that are not abandoned but have no loot.
Definition
centraleconomy.c:256
PCOHandlerStats
Definition
playerstatspco.c:2
PlayerStatBase
Definition
playerstatbase.c:2
PlayerStatsPCO_Base
Definition
playerstatspco.c:156
Timer
Definition
dayzplayerimplement.c:39
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition
isboxcollidinggeometryproxyclasses.c:28
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
Init
override Widget Init()
Definition
dayzgame.c:127
ParamsReadContext
Serializer ParamsReadContext
Definition
gameplay.c:15
ParamsWriteContext
Serializer ParamsWriteContext
Definition
gameplay.c:16
m_System
string m_System
the manager instance
Definition
modifierbase.c:12
OnAfterStoreLoad
override void OnAfterStoreLoad()
engine reaction to load from database originates in: engine - Person::BinLoad script - PlayerBase....
Definition
playerstatbase.c:189
OnRPC
override void OnRPC(ParamsReadContext ctx)
Definition
playerstatbase.c:69
m_PlayerStatsDebug
ref array< ref StatDebugObject > m_PlayerStatsDebug
Definition
playerstats.c:10
LoadStats
bool LoadStats(ParamsReadContext ctx, int version)
Definition
playerstats.c:115
GatherAllRecords
void GatherAllRecords()
Definition
playerstats.c:74
SetAllowLogs
void SetAllowLogs(bool enable)
Definition
playerstats.c:54
SaveStats
void SaveStats(ParamsWriteContext ctx)
Definition
playerstats.c:99
~PlayerStats
void ~PlayerStats()
Definition
playerstats.c:35
PlayerStats
void PlayerStats(Man player)
Definition
playerstats.c:19
GetDebugInfo
void GetDebugInfo(array< ref StatDebugObject > objects, int flags)
Definition
playerstats.c:64
EPSstatsFlags
EPSstatsFlags
Definition
playerstats.c:2
SYNCED
@ SYNCED
Definition
playerstats.c:4
m_PlayerStats
enum EPSstatsFlags m_PlayerStats
GetAllowLogs
bool GetAllowLogs()
Definition
playerstats.c:59
m_PCOhandler
ref PCOHandlerStats m_PCOhandler
Definition
playerstats.c:12
m_AllowLogs
bool m_AllowLogs
Definition
playerstats.c:16
m_SyncTimer
ref Timer m_SyncTimer
Definition
playerstats.c:14
ResetAllStats
void ResetAllStats()
Definition
playerstats.c:130
GetPCO
PlayerStatsPCO_Base GetPCO(int version=-1)
Definition
playerstats.c:30
GetStatObject
PlayerStatBase GetStatObject(int id)
Definition
playerstats.c:41
Games
Dayz
scripts
4_world
classes
playerstats
playerstats.c
Generated by
1.17.0