void FOnlineAsyncTaskSteamWriteUserFile::Tick() { // Going to be complete no matter what bIsComplete = true; if (WriteUserFile(UserId, FileName, Contents)) { bWasSuccessful = true; } // Done with this copy of the data regardless Contents.Empty(); }
void FOnlineAsyncTaskSteamWriteSharedFile::Tick() { ISteamUtils* SteamUtilsPtr = SteamUtils(); check(SteamUtilsPtr); if (!bInit) { if (WriteUserFile(UserId, FileName, Contents)) { // Simply mark the file as shared, will trigger a delegate when upload is complete CallbackHandle = SteamRemoteStorage()->FileShare(TCHAR_TO_UTF8(*FileName)); } bInit = true; } if (CallbackHandle != k_uAPICallInvalid) { bool bFailedCall = false; // Poll for completion status bIsComplete = SteamUtilsPtr->IsAPICallCompleted(CallbackHandle, &bFailedCall) ? true : false; if (bIsComplete) { bool bFailedResult; // Retrieve the callback data from the request bool bSuccessCallResult = SteamUtilsPtr->GetAPICallResult(CallbackHandle, &CallbackResults, sizeof(CallbackResults), CallbackResults.k_iCallback, &bFailedResult); bWasSuccessful = (bSuccessCallResult ? true : false) && (!bFailedCall ? true : false) && (!bFailedResult ? true : false) && ((CallbackResults.m_eResult == k_EResultOK) ? true : false); } } else { // Invalid API call bIsComplete = true; bWasSuccessful = false; } }