From: Maxim Mamontov Date: Tue, 8 Oct 2013 16:01:48 +0000 (+0300) Subject: Changed USER_STAT_RES. X-Git-Tag: 2.409~332 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/627ef2adbb12c066764d6bd618147f6adb2b9cac?ds=inline Changed USER_STAT_RES. --- diff --git a/include/stg/user_stat.h b/include/stg/user_stat.h index 7775c3b5..84fbba78 100644 --- a/include/stg/user_stat.h +++ b/include/stg/user_stat.h @@ -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 lastCashAddTime; RESETABLE passiveTime; RESETABLE lastActivityTime; - RESETABLE up; - RESETABLE down; + DIR_TRAFF_RES up; + DIR_TRAFF_RES down; }; //----------------------------------------------------------------------------- #endif diff --git a/include/stg/user_traff.h b/include/stg/user_traff.h index 133cb54c..41c6c23f 100644 --- a/include/stg/user_traff.h +++ b/include/stg/user_traff.h @@ -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; diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser.cpp b/projects/stargazer/plugins/configuration/sgconfig/parser.cpp index 449d3985..1ac4828a 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/parser.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/parser.cpp @@ -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();