X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/9701b7ab4dc4cd709ad4dcaa750fc0021f15e231..a481c1e57ecc91e87e24f8074602f5ed3de77a07:/include/stg/user_stat.h diff --git a/include/stg/user_stat.h b/include/stg/user_stat.h index 42d436fd..4c06155d 100644 --- a/include/stg/user_stat.h +++ b/include/stg/user_stat.h @@ -113,20 +113,23 @@ struct STAT_NODE //----------------------------------------------------------------------------- struct USER_STAT { - //USER_STAT & operator= (const USER_STAT_RES & usr); USER_STAT() - : up(), - down(), + : sessionUp(), + sessionDown(), + monthUp(), + monthDown(), cash(0), freeMb(0), lastCashAdd(0), lastCashAddTime(0), passiveTime(0), lastActivityTime(0) - {}; + {} - DIR_TRAFF up; - DIR_TRAFF down; + DIR_TRAFF sessionUp; + DIR_TRAFF sessionDown; + DIR_TRAFF monthUp; + DIR_TRAFF monthDown; double cash; double freeMb; double lastCashAdd; @@ -146,8 +149,10 @@ struct USER_STAT_RES lastCashAddTime(), passiveTime(), lastActivityTime(), - up(), - down() + sessionUp(), + sessionDown(), + monthUp(), + monthDown() {} USER_STAT_RES & operator= (const USER_STAT & us) @@ -158,23 +163,27 @@ struct USER_STAT_RES lastCashAddTime = us.lastCashAddTime; passiveTime = us.passiveTime; lastActivityTime = us.lastActivityTime; - up = us.up; - down = us.down; - return * this; - }; - operator USER_STAT() const + sessionUp = us.sessionUp; + sessionDown = us.sessionDown; + monthUp = us.monthUp; + monthDown = us.monthDown; + return *this; + } + USER_STAT GetData() const { USER_STAT us; - us.cash = cash; - us.freeMb = freeMb; - us.lastCashAdd = lastCashAdd; - us.lastCashAddTime = lastCashAddTime; - us.passiveTime = passiveTime; - us.lastActivityTime = lastActivityTime; - us.up = up; - us.down = down; + us.cash = cash.data(); + us.freeMb = freeMb.data(); + us.lastCashAdd = lastCashAdd.data(); + us.lastCashAddTime = lastCashAddTime.data(); + us.passiveTime = passiveTime.data(); + us.lastActivityTime = lastActivityTime.data(); + us.sessionUp = sessionUp.GetData(); + us.sessionDown = sessionDown.GetData(); + us.monthUp = monthUp.GetData(); + us.monthDown = monthDown.GetData(); return us; - }; + } RESETABLE cash; RESETABLE freeMb; @@ -182,8 +191,10 @@ struct USER_STAT_RES RESETABLE lastCashAddTime; RESETABLE passiveTime; RESETABLE lastActivityTime; - RESETABLE up; - RESETABLE down; + DIR_TRAFF_RES sessionUp; + DIR_TRAFF_RES sessionDown; + DIR_TRAFF_RES monthUp; + DIR_TRAFF_RES monthDown; }; //----------------------------------------------------------------------------- #endif