MCPcopy Create free account
hub / github.com/Rat431/ColdAPI_Steam / GetStorageDirectory

Function GetStorageDirectory

src/ColdAPI_Steam/ColdManager.cpp:295–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 15

Storage_InitializzationFunction · 0.85
GetUserDataFolderMethod · 0.85
GetFileCountMethod · 0.85
GetFileNameAndSizeMethod · 0.85
GetUserDataFolderMethod · 0.85
GetUserDataFolderMethod · 0.85
GetUserDataFolderMethod · 0.85
GetFileCountMethod · 0.85
GetFileNameAndSizeMethod · 0.85
GetFileCountMethod · 0.85
GetFileNameAndSizeMethod · 0.85
GetFileCountMethod · 0.85

Calls 1

FormatTheStringFunction · 0.85

Tested by 15

GetFileCountMethod · 0.68
GetFileNameAndSizeMethod · 0.68
GetFileCountMethod · 0.68
GetFileNameAndSizeMethod · 0.68
GetFileCountMethod · 0.68
GetFileNameAndSizeMethod · 0.68
GetFileCountMethod · 0.68
GetFileNameAndSizeMethod · 0.68
GetFileCountMethod · 0.68
GetFileNameAndSizeMethod · 0.68
GetFileCountMethod · 0.68
GetFileNameAndSizeMethod · 0.68