X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/f4333737c7e347efe9258ccf85c1237e03be619c..1cd2b12bd4e4d86f6cd099240795f3ebeb3852b3:/projects/stargazer/plugins/other/rscript/rscript.cpp diff --git a/projects/stargazer/plugins/other/rscript/rscript.cpp b/projects/stargazer/plugins/other/rscript/rscript.cpp index e675d488..f8dc9d99 100644 --- a/projects/stargazer/plugins/other/rscript/rscript.cpp +++ b/projects/stargazer/plugins/other/rscript/rscript.cpp @@ -160,8 +160,6 @@ REMOTE_SCRIPT::REMOTE_SCRIPT() isRunning(false), users(nullptr), sock(0), - onAddUserNotifier(*this), - onDelUserNotifier(*this), logger(STG::PluginLogger::get("rscript")) { } @@ -201,8 +199,8 @@ netRouters = rsSettings.GetSubnetsMap(); InitEncrypt(rsSettings.GetPassword()); -users->AddNotifierUserAdd(&onAddUserNotifier); -users->AddNotifierUserDel(&onDelUserNotifier); +m_onAddUserConn = users->onAdd([this](auto user){ AddUser(user); }); +m_onDelUserConn = users->onDel([this](auto user){ DelUser(user); }); if (GetUsers()) return -1; @@ -242,9 +240,6 @@ if (isRunning) } } -users->DelNotifierUserDel(&onDelUserNotifier); -users->DelNotifierUserAdd(&onAddUserNotifier); - if (isRunning) { logger("Cannot stop thread."); @@ -522,7 +517,7 @@ if (it != authorizedUsers.end()) }*/ } //----------------------------------------------------------------------------- -void RS::IP_NOTIFIER::Notify(const uint32_t & /*oldValue*/, const uint32_t & newValue) +void RS::IP_NOTIFIER::notify(const uint32_t & /*oldValue*/, const uint32_t & newValue) { if (newValue != 0) rs.AddRSU(user); @@ -530,7 +525,7 @@ else rs.DelRSU(user); } //----------------------------------------------------------------------------- -void RS::CONNECTED_NOTIFIER::Notify(const bool & /*oldValue*/, const bool & newValue) +void RS::CONNECTED_NOTIFIER::notify(const bool & /*oldValue*/, const bool & newValue) { if (newValue) rs.AddRSU(user);