Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions Server/Components/CustomModels/models.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ class CustomModelsComponent final : public ICustomModelsComponent, public Player
String cdn = "";
bool usingCdn = false;
uint16_t httpThreads = 50; // default max_players is 50
bool showCRCLogs = false;

DefaultEventDispatcher<PlayerModelsEventHandler> eventDispatcher;

Expand Down Expand Up @@ -418,6 +419,7 @@ class CustomModelsComponent final : public ICustomModelsComponent, public Player
config.setInt("network.http_threads", httpThreads);
config.setInt("artwork.port", modelsPort);
config.setString("artwork.web_server_bind", webServerBindAddress);
config.setBool("artwork.show_crc_logs", showCRCLogs);
}
else
{
Expand Down Expand Up @@ -451,6 +453,10 @@ class CustomModelsComponent final : public ICustomModelsComponent, public Player
{
config.setString("artwork.web_server_bind", webServerBindAddress);
}
if (config.getType("artwork.show_crc_logs") == ConfigOptionType_None)
{
config.setBool("artwork.show_crc_logs", showCRCLogs);
}
}
}

Expand All @@ -465,6 +471,7 @@ class CustomModelsComponent final : public ICustomModelsComponent, public Player
cdn = String(trim(core->getConfig().getString("artwork.cdn")));
httpThreads = *core->getConfig().getInt("network.http_threads");
webServerBindAddress = String(core->getConfig().getString("artwork.web_server_bind"));
showCRCLogs = *core->getConfig().getBool("artwork.show_crc_logs");

NetCode::RPC::RequestTXD::addEventHandler(*core, &requestDownloadLinkHandler);
NetCode::RPC::RequestDFF::addEventHandler(*core, &requestDownloadLinkHandler);
Expand Down Expand Up @@ -623,8 +630,11 @@ class CustomModelsComponent final : public ICustomModelsComponent, public Player
return false;
}

// core->logLn(LogLevel::Message, "[artwork:crc] %.*s CRC = 0x%X", PRINT_VIEW(txdName), txd.checksum);
// core->logLn(LogLevel::Message, "[artwork:crc] %.*s CRC = 0x%X", PRINT_VIEW(dffName), dff.checksum);
if (showCRCLogs)
{
core->logLn(LogLevel::Message, "[artwork:crc] %.*s CRC = 0x%X", PRINT_VIEW(txdName), txd.checksum);
core->logLn(LogLevel::Message, "[artwork:crc] %.*s CRC = 0x%X", PRINT_VIEW(dffName), dff.checksum);
}

auto model = storage.emplace_back(new ModelInfo(type, id, baseId, dff, txd, virtualWorld, timeOn, timeOff));

Expand Down