Decompile 6 functions in Source/Contents/ServerTimeManager.cpp, Source/Contents/ServerTimeManager.h, ...
Batch #3110 by youko: 0 byte-identical, 6 confirmed by peer review. - fn_01686 ServerTimeManager::~ServerTimeManager: logic confirmed by peer review - fn_01695 ServerTimeManager::Reset: logic confirmed by peer review - fn_01696 ServerTimeManager::Update: logic confirmed by peer review - fn_01718 ModelPositionKeysV2::operator=: logic confirmed by peer review - fn_01719 ModelQuaternionKeys::operator=: logic confirmed by peer review - fn_01720 ModelScaleKeysV2::operator=: logic confirmed by peer review Peer-reviewed-by: eAthena, meitogi Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
1e7723c321
commit
a71d0d868d
2 changed files with 37 additions and 0 deletions
|
|
@ -8,6 +8,9 @@ void ServerTimeManager::Initialize() {
|
|||
}
|
||||
|
||||
// OFFSET: 0x0053E500
|
||||
// FUNCTION: fn_01686
|
||||
ServerTimeManager::~ServerTimeManager() {
|
||||
}
|
||||
|
||||
// OFFSET: 0x0053E6A0
|
||||
// FUNCTION: fn_01689
|
||||
|
|
@ -46,5 +49,26 @@ int ServerTimeManager::GetYear() const {
|
|||
}
|
||||
|
||||
// OFFSET: 0x0053E910
|
||||
// FUNCTION: fn_01695
|
||||
void ServerTimeManager::Reset() {
|
||||
this->offset = std::chrono::seconds::zero();
|
||||
this->Update();
|
||||
}
|
||||
|
||||
// OFFSET: 0x0053E930
|
||||
// FUNCTION: fn_01696
|
||||
void ServerTimeManager::Update() {
|
||||
this->now = std::chrono::system_clock::now();
|
||||
this->now += this->offset;
|
||||
|
||||
const std::time_t seconds = std::chrono::system_clock::to_time_t(this->now);
|
||||
std::tm local;
|
||||
if (localtime_s(&local, &seconds) == 0) {
|
||||
this->year = local.tm_year + 1900;
|
||||
this->month = local.tm_mon + 1;
|
||||
this->day = local.tm_mday;
|
||||
this->hour = local.tm_hour;
|
||||
this->minute = local.tm_min;
|
||||
this->second = local.tm_sec;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue