| 425 | } |
| 426 | static bool UReady = false; |
| 427 | const char* GetUGCDirectory() |
| 428 | { |
| 429 | if (!UReady) |
| 430 | { |
| 431 | if (std::strcmp(Steam_Config::UGCDirectotry, "Auto") == 0) |
| 432 | { |
| 433 | std::memset(Steam_Config::UGCDirectotry, 0, 0x400); |
| 434 | std::strcpy(Steam_Config::UGCDirectotry, Steamapipath); |
| 435 | std::strcat(Steam_Config::UGCDirectotry, "ColdStorage\\"); |
| 436 | std::strcat(Steam_Config::UGCDirectotry, Steam_Config::Username); |
| 437 | std::strcat(Steam_Config::UGCDirectotry, "\\"); |
| 438 | std::strcat(Steam_Config::UGCDirectotry, ColdAPI_General::FormatTheString("%lu", EMPTY, Steam_Config::AppId)); |
| 439 | std::strcat(Steam_Config::UGCDirectotry, "\\"); |
| 440 | std::strcat(Steam_Config::UGCDirectotry, "LocalUGC\\"); |
| 441 | } |
| 442 | else |
| 443 | { |
| 444 | int c = 0; |
| 445 | |
| 446 | // Search if the last byte was a "/". |
| 447 | for (;;) |
| 448 | { |
| 449 | if (Steam_Config::UGCDirectotry[c] == NULL) |
| 450 | { |
| 451 | if (Steam_Config::UGCDirectotry[c - 1] != '\\' || Steam_Config::UGCDirectotry[c - 1] != '/') |
| 452 | std::strcpy(&Steam_Config::UGCDirectotry[c], "\\"); |
| 453 | break; |
| 454 | } |
| 455 | c++; |
| 456 | } |
| 457 | std::strcat(Steam_Config::UGCDirectotry, "ColdStorage\\"); |
| 458 | std::strcat(Steam_Config::UGCDirectotry, Steam_Config::Username); |
| 459 | std::strcat(Steam_Config::UGCDirectotry, "\\"); |
| 460 | std::strcat(Steam_Config::UGCDirectotry, ColdAPI_General::FormatTheString("%lu", EMPTY, Steam_Config::AppId)); |
| 461 | std::strcat(Steam_Config::UGCDirectotry, "\\"); |
| 462 | std::strcat(Steam_Config::UGCDirectotry, "LocalUGC\\"); |
| 463 | } |
| 464 | UReady = true; |
| 465 | } |
| 466 | return Steam_Config::UGCDirectotry; |
| 467 | } |
| 468 | |
| 469 | std::multimap<uint64_t, MyFileStream> Streams; |
| 470 | uint64_t GlobalStream = 0; |