bool Patcher::InitPatching(int _build, std::string _locale, AuthSocket* _AuthSocket) { bool fallback; PATCH_INFO* p_Patch = getPatchInfo(_build, _locale, &fallback); if (p_Patch) { uint8 bytes[2] = {0x01, 0x0a}; _AuthSocket->socket().send((char*)&bytes, sizeof(uint8)); std::stringstream path; if (fallback) { path << PATCH_PATH << _build << "-enGB.mpq"; } else { path << PATCH_PATH << _build << "-" << _locale << ".mpq"; } _AuthSocket->pPatch = fopen(path.str().c_str(), "rb"); TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Patch: %s", path.str().c_str()); XFER_INIT packet; packet.cmd = XFER_INITIATE; packet.fileNameLen = 5; packet.fileName[0] = 'P'; packet.fileName[1] = 'a'; packet.fileName[2] = 't'; packet.fileName[3] = 'c'; packet.fileName[4] = 'h'; packet.file_size = p_Patch->filesize; memcpy(packet.md5, p_Patch->md5, MD5_DIGEST_LENGTH); _AuthSocket->socket().send((char*)&packet, sizeof(packet)); return true; } else { TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Client with version %i and locale %s did not get a patch.", _build, _locale.c_str()); return false; } }
bool Patcher::PossiblePatching(int _build, std::string _locale) { bool temp; return getPatchInfo(_build, _locale, &temp) != NULL; }
void HgImportDialog::slotAddPatches() { QStringList patches = QFileDialog::getOpenFileNames(this); foreach (QString fileName, patches) { getPatchInfo(fileName); }