}
// Refresh players and clear news if the time is up
- if (loadtime - lastrefresh >= refreshperiod)
+ currentTime = time(NULL);
+ if (currentTime - lastrefresh >= refreshperiod)
{
refreshall();
clearNews(todaysnews);
saveNews(newsdata, todaysnews);
+ lastrefresh = currentTime;
save_lastrefresh();
+ notice(s_GameServ, c_Forest, "Refreshing all players "\
+ "and resetting news! %ld", refreshperiod);
}
// Save the player data every updateperiod seconds