]> git.stg.codes - stg.git/commitdiff
Removed redundand code. Fixes #24.
authorMaxim Mamontov <faust.madf@gmail.com>
Sun, 2 Dec 2012 14:51:43 +0000 (16:51 +0200)
committerMaxim Mamontov <faust.madf@gmail.com>
Sun, 2 Dec 2012 14:51:43 +0000 (16:51 +0200)
projects/stargazer/plugins/other/rscript/rscript.cpp
projects/stargazer/plugins/other/rscript/rscript.h

index 82ca4f5d557c4ec90b22047cf3b237da563bfbfb..f7f892e5157de37a2e4814af15b2d691e59d40e5 100644 (file)
@@ -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
index e0118638a8d5ac21f0c5966c4ba79fcf7f2f22aa..cbb9f97f814c5aeab870872613e96dd5bef5c390 100644 (file)
@@ -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);