From: Maxim Mamontov <faust.madf@gmail.com>
Date: Sun, 2 Dec 2012 14:51:43 +0000 (+0200)
Subject: Removed redundand code. Fixes #24.
X-Git-Tag: 2.409~394
X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/19684ed5aca4366468f3d9cac0848edd46a1d1cf?ds=inline;hp=-c

Removed redundand code. Fixes #24.
---

19684ed5aca4366468f3d9cac0848edd46a1d1cf
diff --git a/projects/stargazer/plugins/other/rscript/rscript.cpp b/projects/stargazer/plugins/other/rscript/rscript.cpp
index 82ca4f5d..f7f892e5 100644
--- a/projects/stargazer/plugins/other/rscript/rscript.cpp
+++ b/projects/stargazer/plugins/other/rscript/rscript.cpp
@@ -502,35 +502,6 @@ users->CloseSearch(h);
 return false;
 }
 //-----------------------------------------------------------------------------
-void REMOTE_SCRIPT::ChangedIP(USER_PTR u, uint32_t oldIP, uint32_t newIP)
-{
-/*
- * When ip changes process looks like:
- * old => 0, 0 => new
- *
- */
-if (newIP)
-    {
-    RS::USER rsu(IP2Routers(newIP), u);
-    Send(rsu);
-
-    STG_LOCKER lock(&mutex, __FILE__, __LINE__);
-    authorizedUsers.insert(std::make_pair(newIP, rsu));
-    }
-else
-    {
-    STG_LOCKER lock(&mutex, __FILE__, __LINE__);
-    const map<uint32_t, RS::USER>::iterator it(
-            authorizedUsers.find(oldIP)
-            );
-    if (it != authorizedUsers.end())
-        {
-        Send(it->second, true);
-        authorizedUsers.erase(it);
-        }
-    }
-}
-//-----------------------------------------------------------------------------
 std::vector<uint32_t> REMOTE_SCRIPT::IP2Routers(uint32_t ip)
 {
 STG_LOCKER lock(&mutex, __FILE__, __LINE__);
@@ -667,7 +638,6 @@ if (it != authorizedUsers.end())
 //-----------------------------------------------------------------------------
 void RS::IP_NOTIFIER::Notify(const uint32_t & /*oldValue*/, const uint32_t & newValue)
 {
-//rs.ChangedIP(user, oldValue, newValue);
 if (newValue)
     rs.AddRSU(user);
 else
diff --git a/projects/stargazer/plugins/other/rscript/rscript.h b/projects/stargazer/plugins/other/rscript/rscript.h
index e0118638..cbb9f97f 100644
--- a/projects/stargazer/plugins/other/rscript/rscript.h
+++ b/projects/stargazer/plugins/other/rscript/rscript.h
@@ -195,7 +195,6 @@ public:
     void                DelUser(USER_PTR u) { UnSetUserNotifiers(u); }
     void                AddUser(USER_PTR u) { SetUserNotifiers(u); }
 
-    void                ChangedIP(USER_PTR u, uint32_t oldIP, uint32_t newIP);
     void                AddRSU(USER_PTR user);
     void                DelRSU(USER_PTR user);