| 432 | } |
| 433 | |
| 434 | void CUpdater::CommitUpdate() |
| 435 | { |
| 436 | bool Success = true; |
| 437 | |
| 438 | for(auto &FileJob : m_FileJobs) |
| 439 | if(FileJob.second) |
| 440 | Success &= MoveFile(FileJob.first.c_str()); |
| 441 | |
| 442 | if(m_ClientUpdate) |
| 443 | Success &= ReplaceClient(); |
| 444 | if(m_ServerUpdate) |
| 445 | Success &= ReplaceServer(); |
| 446 | |
| 447 | if(Success) |
| 448 | { |
| 449 | for(const auto &[Filename, JobSuccess] : m_FileJobs) |
| 450 | if(!JobSuccess) |
| 451 | m_pStorage->RemoveBinaryFile(Filename.c_str()); |
| 452 | } |
| 453 | |
| 454 | if(!Success) |
| 455 | SetCurrentState(IUpdater::FAIL); |
| 456 | else if(m_pClient->State() == IClient::STATE_ONLINE || m_pClient->EditorHasUnsavedData()) |
| 457 | SetCurrentState(IUpdater::NEED_RESTART); |
| 458 | else |
| 459 | { |
| 460 | m_pClient->Restart(); |
| 461 | } |
| 462 | } |
nothing calls this directly
no test coverage detected