//-----------------------------------------------------------------------------
void USERS::NewMinute(const struct tm * t)
{
-int usersCnt = 0;
-list<USER>::iterator usr;
-
//Write traff, reset session traff. Fake disconnect-connect
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<USER>::iterator usr = users.begin();
while (usr != users.end())
{
usersCnt++;
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();
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(), mem_fun_ref(&USER::WriteDetailStat));
+
+// 'cause bind2st accepts only constant first param
+for (list<USER>::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));
}
return false;
}
-//-----------------------------------------------------------------------------
-/*int USERS::SendMessage(const string & login,
- time_t sndTtime,
- time_t showTime,
- char type,
- const string & text) const
-{
-return 0;
-}*/
-//-----------------------------------------------------------------------------
-
-
-