| 293 | } |
| 294 | static bool Ready = false; |
| 295 | const char* GetStorageDirectory() |
| 296 | { |
| 297 | if (!Ready) |
| 298 | { |
| 299 | if (std::strcmp(Steam_Config::SaveDirectory, "Auto") == 0) |
| 300 | { |
| 301 | std::memset(Steam_Config::SaveDirectory, 0, 0x400); |
| 302 | std::strcpy(Steam_Config::SaveDirectory, Steamapipath); |
| 303 | std::strcat(Steam_Config::SaveDirectory, "ColdStorage\\"); |
| 304 | std::strcat(Steam_Config::SaveDirectory, Steam_Config::Username); |
| 305 | std::strcat(Steam_Config::SaveDirectory, "\\"); |
| 306 | std::strcat(Steam_Config::SaveDirectory, ColdAPI_General::FormatTheString("%lu", EMPTY, Steam_Config::AppId)); |
| 307 | std::strcat(Steam_Config::SaveDirectory, "\\"); |
| 308 | std::strcat(Steam_Config::SaveDirectory, "LocalSaves\\"); |
| 309 | } |
| 310 | else |
| 311 | { |
| 312 | int c = 0; |
| 313 | |
| 314 | // Search if the last byte was a "/". |
| 315 | for (;;) |
| 316 | { |
| 317 | if (Steam_Config::SaveDirectory[c] == NULL) |
| 318 | { |
| 319 | if (Steam_Config::SaveDirectory[c - 1] != '\\' || Steam_Config::SaveDirectory[c - 1] != '/') |
| 320 | std::strcpy(&Steam_Config::SaveDirectory[c], "\\"); |
| 321 | break; |
| 322 | } |
| 323 | c++; |
| 324 | } |
| 325 | std::strcat(Steam_Config::SaveDirectory, "ColdStorage\\"); |
| 326 | std::strcat(Steam_Config::SaveDirectory, Steam_Config::Username); |
| 327 | std::strcat(Steam_Config::SaveDirectory, "\\"); |
| 328 | std::strcat(Steam_Config::SaveDirectory, ColdAPI_General::FormatTheString("%lu", EMPTY, Steam_Config::AppId)); |
| 329 | std::strcat(Steam_Config::SaveDirectory, "\\"); |
| 330 | std::strcat(Steam_Config::SaveDirectory, "LocalSaves\\"); |
| 331 | } |
| 332 | Ready = true; |
| 333 | } |
| 334 | return Steam_Config::SaveDirectory; |
| 335 | } |
| 336 | void FillFileStructure(const char* Directory) |
| 337 | { |
| 338 | // List files |