]> git.stg.codes - stg.git/blobdiff - projects/stargazer/user_impl.h
Added notifiers for the "disabled" property.
[stg.git] / projects / stargazer / user_impl.h
index 3701bdd0f8834c5f165ba3aa540afbdc38397dd2..6ee7e4d8f5b4a64a3abb67ba76649cca590d686c 100644 (file)
@@ -67,6 +67,16 @@ public:
     CHG_PASSIVE_NOTIFIER(USER_IMPL * u) : user(u) {}
     void Notify(const int & oldPassive, const int & newPassive);
 
+private:
+    USER_IMPL * user;
+};
+//-----------------------------------------------------------------------------
+class CHG_DISABLED_NOTIFIER : public PROPERTY_NOTIFIER_BASE<int>,
+                             private NONCOPYABLE {
+public:
+    CHG_DISABLED_NOTIFIER(USER_IMPL * u) : user(u) {}
+    void Notify(const int & oldValue, const int & newValue);
+
 private:
     USER_IMPL * user;
 };
@@ -103,6 +113,7 @@ private:
 //-----------------------------------------------------------------------------
 class USER_IMPL : public USER {
 friend class CHG_PASSIVE_NOTIFIER;
+friend class CHG_DISABLED_NOTIFIER;
 friend class CHG_TARIFF_NOTIFIER;
 friend class CHG_CASH_NOTIFIER;
 friend class CHG_IPS_NOTIFIER;
@@ -196,7 +207,6 @@ public:
 
     void            MidnightResetSessionStat();
     void            ProcessDayFee();
-    void            SetPrepaidTraff();
     void            ProcessDayFeeSpread();
     void            ProcessNewMonth();
 
@@ -207,6 +217,8 @@ public:
     void            OnDelete();
 
 private:
+    USER_IMPL & operator=(const USER_IMPL & rvalue);
+
     const USERS *   users;
     USER_PROPERTIES property;
     STG_LOGGER &    WriteServLog;
@@ -215,6 +227,8 @@ private:
     void            Disconnect(bool fakeDisconnect, const std::string & reason);
     int             SaveMonthStat(int month, int year);
 
+    void            SetPrepaidTraff();
+
     int             SendMessage(STG_MSG & msg) const;
     void            ScanMessage();
 
@@ -302,9 +316,10 @@ private:
     DIR_TRAFF                sessionDownload;
 
     CHG_PASSIVE_NOTIFIER     passiveNotifier;
+    CHG_DISABLED_NOTIFIER    disabledNotifier;
     CHG_TARIFF_NOTIFIER      tariffNotifier;
     CHG_CASH_NOTIFIER        cashNotifier;
-    CHG_IPS_NOTIFIER          ipNotifier;
+    CHG_IPS_NOTIFIER         ipNotifier;
 
     mutable pthread_mutex_t  mutex;