]> git.stg.codes - stg.git/commitdiff
Changed USER_STAT_RES.
authorMaxim Mamontov <faust.madf@gmail.com>
Tue, 8 Oct 2013 16:01:48 +0000 (19:01 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Fri, 9 Jan 2015 19:43:27 +0000 (21:43 +0200)
include/stg/user_stat.h
include/stg/user_traff.h
projects/stargazer/plugins/configuration/sgconfig/parser.cpp

index 7775c3b51ac1d4855d1adac8d18b494aedb60df3..84fbba78d578d5ef5670705f020c56c8039149c5 100644 (file)
@@ -157,9 +157,9 @@ struct USER_STAT_RES
         lastCashAddTime  = us.lastCashAddTime;
         passiveTime      = us.passiveTime;
         lastActivityTime = us.lastActivityTime;
-        up = us.up;
-        down = us.down;
-        return * this;
+        up               = us.up;
+        down             = us.down;
+        return *this;
     }
     USER_STAT GetData() const
     {
@@ -170,8 +170,8 @@ struct USER_STAT_RES
         us.lastCashAddTime  = lastCashAddTime.data();
         us.passiveTime      = passiveTime.data();
         us.lastActivityTime = lastActivityTime.data();
-        us.up               = up.data();
-        us.down             = down.data();
+        us.up               = up.GetData();
+        us.down             = down.GetData();
         return us;
     }
 
@@ -181,8 +181,8 @@ struct USER_STAT_RES
     RESETABLE<time_t>      lastCashAddTime;
     RESETABLE<time_t>      passiveTime;
     RESETABLE<time_t>      lastActivityTime;
-    RESETABLE<DIR_TRAFF>   up;
-    RESETABLE<DIR_TRAFF>   down;
+    DIR_TRAFF_RES          up;
+    DIR_TRAFF_RES          down;
 };
 //-----------------------------------------------------------------------------
 #endif
index 133cb54c9fca665877baf49855cf7bcbf955a799..41c6c23fe63814c37c1da51a9a49a43ddbd1ccde 100644 (file)
@@ -86,6 +86,14 @@ public:
     }
     const ValueType & operator[](IndexType idx) const { return traff[idx]; }
     ValueType & operator[](IndexType idx) { return traff[idx]; }
+    DIR_TRAFF GetData() const
+    {
+    DIR_TRAFF res(traff.size());
+    for (IndexType i = 0; i < traff.size(); ++i)
+        if (!traff[i].empty())
+            res[i] = traff[i].data();
+    return res;
+    }
 
 private:
     ContainerType traff;
index 449d3985bf7d3e2a2e0b2fa47a8a86f2857213c3..1ac4828ada17750e86836f4fab0f4f298cceede6 100644 (file)
@@ -943,8 +943,6 @@ else
                 }
             j+=2;
             }
-        usr->down = dtd;
-        usr->up = dtu;
         return 0;
         }
 
@@ -1210,15 +1208,6 @@ if (downCount)
     if (!u->GetProperty().down.Set(down, currAdmin, login, store))
         res = -1;
 
-/*if (!usr->down.empty())
-    {
-    u->GetProperty().down.Set(usr->down.const_data(), currAdmin, login, store);
-    }
-if (!usr->up.empty())
-    {
-    u->GetProperty().up.Set(usr->up.const_data(), currAdmin, login, store);
-    }*/
-
 u->WriteConf();
 u->WriteStat();