mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2025-12-06 04:04:53 +01:00
Merge branch 'master' into 'achievements_support'
# Conflicts: # dll/steam_remote_storage.h
This commit is contained in:
commit
8d22fb72ae
23 changed files with 2177 additions and 114 deletions
|
|
@ -83,6 +83,10 @@ Steam_Remote_Storage(class Settings *settings, Local_Storage *local_storage, cla
|
|||
bool FileWrite( const char *pchFile, const void *pvData, int32 cubData )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Remote_Storage::FileWrite %s %u\n", pchFile, cubData);
|
||||
if (!pchFile || cubData <= 0 || cubData > k_unMaxCloudFileChunkSize) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
int data_stored = local_storage->store_data(Local_Storage::remote_storage_folder, pchFile, (char* )pvData, cubData);
|
||||
PRINT_DEBUG("Steam_Remote_Storage::Stored %i, %u\n", data_stored, data_stored == cubData);
|
||||
|
|
@ -103,12 +107,16 @@ STEAM_CALL_RESULT( RemoteStorageFileWriteAsyncComplete_t )
|
|||
SteamAPICall_t FileWriteAsync( const char *pchFile, const void *pvData, uint32 cubData )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Remote_Storage::FileWriteAsync\n");
|
||||
if (!pchFile || cubData > k_unMaxCloudFileChunkSize || cubData == 0) {
|
||||
return k_uAPICallInvalid;
|
||||
}
|
||||
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
bool success = local_storage->store_data(Local_Storage::remote_storage_folder, pchFile, (char* )pvData, cubData) == cubData;
|
||||
RemoteStorageFileWriteAsyncComplete_t data;
|
||||
data.m_eResult = k_EResultOK;
|
||||
data.m_eResult = success ? k_EResultOK : k_EResultFail;
|
||||
|
||||
return callback_results->addCallResult(data.k_iCallback, &data, sizeof(data));
|
||||
return callback_results->addCallResult(data.k_iCallback, &data, sizeof(data), 0.01);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue