Solution: WarZ.sln
File: HUDPause.cpp
Search by
Code:
void HUDPause::setTime(__int64 utcTime)
View and study the code shown below
Code:
void HUDPause::setTime(__int64 utcTime){ const static char* months[12] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; struct tm* tm = _gmtime64(&utcTime); char date[128]; char time[128]; sprintf(date, "%s %d, %d", gLangMngr.getString(months[tm->tm_mon]), tm->tm_mday, 1900 + tm->tm_year); sprintf(time, "%02d:%02d", tm->tm_hour, tm->tm_min); Scaleform::GFx::Value var[2]; var[0].SetString(date); var[1].SetString(time); gfxMovie.Invoke("_root.api.setTime", var, 2);}
You can make changes, I believe.
- - - Updated - - -
Here is the code for 24 hours in game, only change to real time world.
Code:
void ClientGameLogic::SetServerGameTime(int hour, int min) { //SetServerGameTime(12, 0); will set it to 12 __int64 gameUtcTime = gClientLogic().GetServerGameTime(); struct tm* tm = _gmtime64(&gameUtcTime); r3d_assert(tm); gClientLogic().gameStartUtcTime_ -= tm->tm_sec; gClientLogic().gameStartUtcTime_ -= (tm->tm_min) * 60; gClientLogic().gameStartUtcTime_ += (hour - tm->tm_hour) * 60 * 60; gClientLogic().gameStartUtcTime_ += (min) * 60; gClientLogic().lastShadowCacheReset_ = -1; }