]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/other/rscript/rscript.cpp
Added Splice method for resetables.
[stg.git] / projects / stargazer / plugins / other / rscript / rscript.cpp
index 936f0c9efc90d8b4da89c01cd9449ac5015e4c4d..3bc90792276152606e274fb5258b2554ff956198 100644 (file)
@@ -325,6 +325,7 @@ std::for_each(authorizedUsers.begin(),
               UpdateRouter(*this));
 
 logger("%s reloaded successfully.", rsSettings.GetMapFileName().c_str());
               UpdateRouter(*this));
 
 logger("%s reloaded successfully.", rsSettings.GetMapFileName().c_str());
+printfd(__FILE__, "REMOTE_SCRIPT::Reload() %s reloaded successfully.\n");
 
 return 0;
 }
 
 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__);
 void REMOTE_SCRIPT::DelRSU(USER_PTR user)
 {
 STG_LOCKER lock(&mutex, __FILE__, __LINE__);
-const std::map<uint32_t, RS::USER>::iterator it(
+std::map<uint32_t, RS::USER>::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<uint32_t, RS::USER>::iterator it(
         authorizedUsers.find(user->GetCurrIP())
         );
 if (it != authorizedUsers.end())
     {
     Send(it->second, true);
     authorizedUsers.erase(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)
 }
 //-----------------------------------------------------------------------------
 void RS::IP_NOTIFIER::Notify(const uint32_t & /*oldValue*/, const uint32_t & newValue)