I've been messing with the ISteamRemoteStorage interfaces.
Code:
Steam Cloud Quota, Current: 131072, Max: 35825
Loading Steam Cloud details for 3 files...
File #0: cfg/config.cfg (7469 bytes)
File #1: materials/vgui/logos/spray.vtf (87640 bytes)
File #2: materials/vgui/logos/spray.vmt (138 bytes)
Total Size: 95247
The numbers don't add up for me either...
Here's what my friend figures:
ExileLord: Maybe they had a max
ExileLord: And then they were like
ExileLord: FUCK IT
ExileLord: LETS GO WAY OVER
int error;
ISteamClient008 *steamClient = (ISteamClient008 *)CreateInterface(STEAMCLIENT_INTERFACE_VERSION_008, &error);
if (!steamClient)
Error("Unable to get steam client.", error);
IClientEngine *clientEngine = (IClientEngine *)CreateInterface(CLIENTENGINE_INTERFACE_VERSION, &error);
HSteamPipe hSteamPipe = steamClient->CreateSteamPipe();
HSteamUser hSteamUser = steamClient->ConnectToGlobalUser(hSteamPipe);
ISteamFriends002 *steamFriends = (ISteamFriends002 *)steamClient->GetISteamFriends( hSteamUser, hSteamPipe, STEAMFRIENDS_INTERFACE_VERSION_002 );
IClientUtils *clientUtils = (IClientUtils *)clientEngine->GetIClientUtils(hSteamPipe, CLIENTUTILS_INTERFACE_VERSION);
clientUtils->SetAppIDForCurrentPipe(500); // l4d
ISteamRemoteStorage001 *remoteStore = (ISteamRemoteStorage001 *)steamClient->GetISteamGenericInterface(hSteamUser, hSteamPipe, STEAMREMOTESTORAGE_INTERFACE_VERSION_001);
uint32 fileCount = remoteStore->GetFileCount();
int curr, max, total = 0;
remoteStore->GetQuota(&curr, &max);
std::cout << "Steam Cloud Quota, Current: " << curr << ", Max: " << max << std::endl;
std::cout << "Loading Steam Cloud details for " << fileCount << " files..." << std::endl;
for (uint32 x = 0; x < fileCount; x++)
{
int fileSize;
const char *fileName = remoteStore->GetFileNameAndSize(x, &fileSize);
total += fileSize;
std::cout << " File #" << x << ": " << fileName << " (" << fileSize << " bytes)" << std::endl;
}
std::cout << "Total Size: " << total << std::endl;
Edit:
Code:
Writing new file...
File contents: this is a test file.
std::cout << "Writing new file...";
char test[] = "this is a test file.";
if (!remoteStore->FileWrite("test.txt", test, sizeof(test)))
std::cout << "Unable to write file." << std::endl;
std::cout << std::endl;
char buff[256];
remoteStore->FileRead("test.txt", buff, sizeof(buff));
std::cout << "File contents: " << buff << std::endl;
Cool stuff. :)