mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-01-09 14:27:10 +00:00
remove dead loop (#1700)
This commit is contained in:
parent
08a168de88
commit
1b9f7e44c7
@ -267,21 +267,13 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
// pre calculate the FDB checksum
|
// pre calculate the FDB checksum
|
||||||
if (Game::config->GetValue("check_fdb") == "1") {
|
if (Game::config->GetValue("check_fdb") == "1") {
|
||||||
static const std::vector<std::string> aliases = {
|
|
||||||
"CDServers.fdb",
|
|
||||||
"cdserver.fdb",
|
|
||||||
"CDClient.fdb",
|
|
||||||
"cdclient.fdb",
|
|
||||||
};
|
|
||||||
|
|
||||||
for (const auto& file : aliases) {
|
|
||||||
auto cdclient = Game::assetManager->GetFile("cdclient.fdb");
|
auto cdclient = Game::assetManager->GetFile("cdclient.fdb");
|
||||||
if (cdclient) {
|
if (cdclient) {
|
||||||
|
|
||||||
const int32_t bufferSize = 1024;
|
const int32_t bufferSize = 1024;
|
||||||
MD5 md5;
|
MD5 md5;
|
||||||
|
|
||||||
char fileStreamBuffer[1024] = {};
|
char fileStreamBuffer[bufferSize] = {};
|
||||||
|
|
||||||
while (!cdclient.eof()) {
|
while (!cdclient.eof()) {
|
||||||
memset(fileStreamBuffer, 0, bufferSize);
|
memset(fileStreamBuffer, 0, bufferSize);
|
||||||
@ -295,8 +287,6 @@ int main(int argc, char** argv) {
|
|||||||
databaseChecksum = md5.hexdigest();
|
databaseChecksum = md5.hexdigest();
|
||||||
|
|
||||||
LOG("FDB Checksum calculated as: %s", databaseChecksum.c_str());
|
LOG("FDB Checksum calculated as: %s", databaseChecksum.c_str());
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (databaseChecksum.empty()) {
|
if (databaseChecksum.empty()) {
|
||||||
LOG("check_fdb is on but no fdb file found.");
|
LOG("check_fdb is on but no fdb file found.");
|
||||||
|
Loading…
Reference in New Issue
Block a user