- up = us.up;
- down = us.down;
- return * this;
- };
- operator USER_STAT() 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;
- return us;
- };
-
- RESETABLE<double> cash;
- RESETABLE<double> freeMb;
- RESETABLE<double> lastCashAdd;
- RESETABLE<time_t> lastCashAddTime;
- RESETABLE<time_t> passiveTime;
- RESETABLE<time_t> lastActivityTime;
- RESETABLE<DIR_TRAFF> up;
- RESETABLE<DIR_TRAFF> down;
+ sessionUp = us.sessionUp;
+ sessionDown = us.sessionDown;
+ monthUp = us.monthUp;
+ monthDown = us.monthDown;
+ return *this;
+ }
+
+ UserStatOpt(const UserStatOpt&) = default;
+ UserStatOpt& operator=(const UserStatOpt&) = default;
+ UserStatOpt(UserStatOpt&&) = default;
+ UserStatOpt& operator=(UserStatOpt&&) = default;
+
+ std::optional<double> cash;
+ std::optional<CashInfo> cashAdd;
+ std::optional<CashInfo> cashSet;
+ std::optional<double> freeMb;
+ std::optional<double> lastCashAdd;
+ std::optional<time_t> lastCashAddTime;
+ std::optional<time_t> passiveTime;
+ std::optional<time_t> lastActivityTime;
+ DirTraffOpt sessionUp;
+ DirTraffOpt sessionDown;
+ DirTraffOpt monthUp;
+ DirTraffOpt monthDown;