X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/50769b45008e7da2cce41d918ec2f0fd5204fe46..63ec10fdcc402bf07f7a8c0dfb326feb60249038:/projects/stargazer/users.cpp diff --git a/projects/stargazer/users.cpp b/projects/stargazer/users.cpp index 9a219be6..f97a029f 100644 --- a/projects/stargazer/users.cpp +++ b/projects/stargazer/users.cpp @@ -352,9 +352,6 @@ return NULL; //----------------------------------------------------------------------------- void USERS::NewMinute(const struct tm * t) { -int usersCnt = 0; -list::iterator usr; - //Write traff, reset session traff. Fake disconnect-connect if (t->tm_hour == 23 && t->tm_min == 59) { @@ -365,11 +362,10 @@ if (t->tm_hour == 23 && t->tm_min == 59) if (TimeToWriteDetailStat(t)) { //printfd(__FILE__, "USER::WriteInetStat\n"); - //for_each(users.begin(), users.end(), mem_fun_ref(&USER::SwapDetailStat)); - usersCnt = 0; + int usersCnt = 0; // ðÉÛÅÍ ÀÚÅÒÏ× ÞÁÓÔÑÍÉ. ÷ ÐÅÒÅÒÙ×ÁÈ ×ÙÚÙ×ÁÅÍ USER::Run - usr = users.begin(); + list::iterator usr = users.begin(); while (usr != users.end()) { usersCnt++; @@ -378,8 +374,6 @@ if (TimeToWriteDetailStat(t)) if (usersCnt % 10 == 0) for_each(users.begin(), users.end(), mem_fun_ref(&USER::Run)); } - - //for_each(users.begin(), users.end(), mem_fun_ref(&USER::ResetDetailStat)); } RealDelUser(); @@ -495,8 +489,13 @@ if (isRunning) printfd(__FILE__, "Before USERS::Run()\n"); for_each(users.begin(), users.end(), mem_fun_ref(&USER::Run)); -//for_each(users.begin(), users.end(), mem_fun_ref(&USER::SwapDetailStat)); -for_each(users.begin(), users.end(), bind2nd(mem_fun_ref(&USER::WriteDetailStat), true)); + +// 'cause bind2st accepts only constant first param +for (list::iterator it = users.begin(); + it != users.end(); + ++it) + it->WriteDetailStat(true); + for_each(users.begin(), users.end(), mem_fun_ref(&USER::WriteStat)); for_each(users.begin(), users.end(), mem_fun_ref(&USER::WriteConf)); @@ -753,16 +752,3 @@ switch (statTime) } return false; } -//----------------------------------------------------------------------------- -/*int USERS::SendMessage(const string & login, - time_t sndTtime, - time_t showTime, - char type, - const string & text) const -{ -return 0; -}*/ -//----------------------------------------------------------------------------- - - -