06-27-2023, 01:32 AM
since i can't edit the main post "fix this please"
the helper has an issue with the new gcc48.
It enters a infinite loop causing it to never start.
not even sure how the original code worked honestly without that issue.
void CServer::initTime()
{
// Get the current time
time_t now1;
time(&now1);
rankInitUpdateTime = *localtime(&now1);
rewardInitUpdateTime = *localtime(&now1);
rewardEndUpdateTime = *localtime(&now1);
// Increment the day until it is Tuesday (tm_wday = 2)
int daysToAdd = (2 - rankInitUpdateTime.tm_wday + 7) % 7;
rankInitUpdateTime.tm_mday += daysToAdd;
mktime(&rankInitUpdateTime);
// Set the time for rank initialization
rankInitUpdateTime.tm_hour = 8;
rankInitUpdateTime.tm_min = 0;
rankInitUpdateTime.tm_sec = 0;
// Set the time for reward initialization
rewardInitUpdateTime = rankInitUpdateTime;
rewardInitUpdateTime.tm_min = 20;
// Set the time for reward end update
rewardEndUpdateTime = rankInitUpdateTime;
rewardEndUpdateTime.tm_min = 10;
// Set the initial state flags
b_rankinitupdate = false;
b_rewardinitupdate = false;
b_rewardendupdate = false;
}
redo the entire function void CServer::initTime() to this.
inside ServerRun.cpp inside the helper

