Add a depots.txt to configure values returned by the getinstalleddepots function.

This commit is contained in:
Mr_Goldberg
2020-01-31 14:31:29 -05:00
parent b1206b0fa2
commit 9deef8c6f3
5 changed files with 40 additions and 23 deletions

View File

@ -458,6 +458,27 @@ uint32 create_localstorage_settings(Settings **settings_client_out, Settings **s
}
}
{
std::string depots_config_path = Local_Storage::get_game_settings_path() + "depots.txt";
std::ifstream input( depots_config_path );
if (input.is_open()) {
for( std::string line; getline( input, line ); ) {
if (!line.empty() && line[line.length()-1] == '\n') {
line.pop_back();
}
if (!line.empty() && line[line.length()-1] == '\r') {
line.pop_back();
}
DepotId_t depot_id = stoul(line);
settings_client->depots.push_back(depot_id);
settings_server->depots.push_back(depot_id);
PRINT_DEBUG("Added depot %u\n", depot_id);
}
}
}
{
std::string mod_path = Local_Storage::get_game_settings_path() + "mods";
std::vector<std::string> paths = Local_Storage::get_filenames_path(mod_path);