X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/27ac6cd34ada410ecfb322007fa0a9f16a777a89..7738215c4ff5b9a96839437b37db6557567818c7:/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 936f0c9e..3bc90792 100644 --- a/projects/stargazer/plugins/other/rscript/rscript.cpp +++ b/projects/stargazer/plugins/other/rscript/rscript.cpp @@ -325,6 +325,7 @@ std::for_each(authorizedUsers.begin(), UpdateRouter(*this)); logger("%s reloaded successfully.", rsSettings.GetMapFileName().c_str()); +printfd(__FILE__, "REMOTE_SCRIPT::Reload() %s reloaded successfully.\n"); return 0; } @@ -628,14 +629,25 @@ authorizedUsers.insert(std::make_pair(user->GetCurrIP(), rsu)); void REMOTE_SCRIPT::DelRSU(USER_PTR user) { STG_LOCKER lock(&mutex, __FILE__, __LINE__); -const std::map::iterator it( +std::map::iterator it(authorizedUsers.begin()); +while (it != authorizedUsers.end()) + { + if (it->second.user == user) + { + Send(it->second, true); + authorizedUsers.erase(it); + return; + } + ++it; + } +/*const std::map::iterator it( authorizedUsers.find(user->GetCurrIP()) ); if (it != authorizedUsers.end()) { Send(it->second, true); authorizedUsers.erase(it); - } + }*/ } //----------------------------------------------------------------------------- void RS::IP_NOTIFIER::Notify(const uint32_t & /*oldValue*/, const uint32_t & newValue)