-struct RS_USER {
-RS_USER();
-RS_USER(const std::vector<uint32_t> & r, USER_PTR it);
-
-time_t lastSentTime;
-USER_PTR user;
-std::vector<uint32_t> routers;
-int shortPacketsCount;
+class CONNECTED_NOTIFIER: public STG::PropertyNotifierBase<bool> {
+public:
+ CONNECTED_NOTIFIER(REMOTE_SCRIPT & r, UserPtr u)
+ : user(u), rs(r) { user->AddConnectedAfterNotifier(this); }
+ CONNECTED_NOTIFIER(const CONNECTED_NOTIFIER & rhs)
+ : user(rhs.user), rs(rhs.rs) { user->AddConnectedAfterNotifier(this); }
+ ~CONNECTED_NOTIFIER() { user->DelConnectedAfterNotifier(this); }
+
+ CONNECTED_NOTIFIER & operator=(const CONNECTED_NOTIFIER & rhs)
+ {
+ user->DelConnectedAfterNotifier(this);
+ user = rhs.user;
+ user->AddConnectedAfterNotifier(this);
+ return *this;
+ }
+
+ void Notify(const bool & oldValue, const bool & newValue);
+ UserPtr GetUser() const { return user; }
+
+private:
+
+ UserPtr user;
+ REMOTE_SCRIPT & rs;