mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Add total netgame time stat
This commit is contained in:
parent
0cd5a662ce
commit
3ebe235154
5 changed files with 12 additions and 0 deletions
|
|
@ -46,6 +46,7 @@ void srb2::save_ng_gamedata()
|
|||
GamedataJson ng {};
|
||||
|
||||
ng.playtime.total = gamedata->totalplaytime;
|
||||
ng.playtime.netgame = gamedata->totalnetgametime;
|
||||
ng.playtime.race = gamedata->modeplaytime[GDGT_RACE];
|
||||
ng.playtime.battle = gamedata->modeplaytime[GDGT_BATTLE];
|
||||
ng.playtime.prisons = gamedata->modeplaytime[GDGT_PRISONS];
|
||||
|
|
@ -429,6 +430,7 @@ void srb2::load_ng_gamedata()
|
|||
gamedata->evercrashed = dirty;
|
||||
|
||||
gamedata->totalplaytime = js.playtime.total;
|
||||
gamedata->totalnetgametime = js.playtime.netgame;
|
||||
gamedata->modeplaytime[GDGT_RACE] = js.playtime.race;
|
||||
gamedata->modeplaytime[GDGT_BATTLE] = js.playtime.battle;
|
||||
gamedata->modeplaytime[GDGT_PRISONS] = js.playtime.prisons;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ namespace srb2
|
|||
struct GamedataPlaytimeJson final
|
||||
{
|
||||
uint32_t total;
|
||||
uint32_t netgame;
|
||||
uint32_t race;
|
||||
uint32_t battle;
|
||||
uint32_t prisons;
|
||||
|
|
@ -39,6 +40,7 @@ struct GamedataPlaytimeJson final
|
|||
NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(
|
||||
GamedataPlaytimeJson,
|
||||
total,
|
||||
netgame,
|
||||
race,
|
||||
battle,
|
||||
prisons,
|
||||
|
|
|
|||
|
|
@ -652,6 +652,7 @@ void M_ClearStats(void)
|
|||
{
|
||||
UINT8 i;
|
||||
gamedata->totalplaytime = 0;
|
||||
gamedata->totalnetgametime = 0;
|
||||
for (i = 0; i < GDGT_MAX; ++i)
|
||||
gamedata->modeplaytime[i] = 0;
|
||||
gamedata->totalmenutime = 0;
|
||||
|
|
|
|||
|
|
@ -369,6 +369,7 @@ struct gamedata_t
|
|||
|
||||
// PLAY TIME
|
||||
UINT32 totalplaytime;
|
||||
UINT32 totalnetgametime;
|
||||
UINT32 modeplaytime[GDGT_MAX];
|
||||
UINT32 totalmenutime;
|
||||
UINT32 totaltimestaringatstatistics;
|
||||
|
|
|
|||
|
|
@ -944,6 +944,12 @@ void P_Ticker(boolean run)
|
|||
// Keep track of how long they've been playing!
|
||||
gamedata->totalplaytime++;
|
||||
|
||||
// Netgame total time
|
||||
if (netgame)
|
||||
{
|
||||
gamedata->totalnetgametime++;
|
||||
}
|
||||
|
||||
// Per-skin total playtime for all machine-local players
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue