Ejemplo n.º 1
0
        private void OnFileReadComplete(RemoteStorageFileReadAsyncComplete_t resultData, bool result)
        {
            byte[] byteData = new byte[GetSaveSize()];
            SteamRemoteStorage.FileReadAsyncComplete(resultData.m_hFileReadAsync, byteData, resultData.m_cubRead);
            string jsonData = Encoding.UTF8.GetString(byteData);

            File.WriteAllText(SaveSystem.GetFilePath(localSaveName, localSaveExtension), jsonData);

            SaveSystem.LoadAll(saveName: localSaveName, FileType.JSON, decompress: false);
        }
Ejemplo n.º 2
0
    private void OnSteamCloudDataLoaded(RemoteStorageFileReadAsyncComplete_t pCallback, bool bIOFailure)
    {
        print("Data loaded, success: " + bIOFailure);

        if (pCallback.m_eResult == EResult.k_EResultOK)
        {
            byte[] data = new byte[pCallback.m_cubRead];
            if (SteamRemoteStorage.FileReadAsyncComplete(pCallback.m_hFileReadAsync, data, pCallback.m_cubRead))
            {
                string m_Message = System.Text.Encoding.UTF8.GetString(data, (int)pCallback.m_nOffset, (int)pCallback.m_cubRead);
                Debug.LogWarning("RemoteStorageFileReadAsyncComplete: Got data from SteamCloud: " + m_Message);
            }
        }
    }
    void OnRemoteStorageFileReadAsyncComplete(RemoteStorageFileReadAsyncComplete_t pCallback, bool bIOFailure)
    {
        Debug.Log("[" + RemoteStorageFileReadAsyncComplete_t.k_iCallback + " - RemoteStorageFileReadAsyncComplete] - " + pCallback.m_hFileReadAsync + " -- " + pCallback.m_eResult + " -- " + pCallback.m_nOffset + " -- " + pCallback.m_cubRead);

        if (pCallback.m_eResult == EResult.k_EResultOK)
        {
            byte[] Data = new byte[40];
            bool   ret  = SteamRemoteStorage.FileReadAsyncComplete(pCallback.m_hFileReadAsync, Data, pCallback.m_cubRead);
            print("FileReadAsyncComplete(m_FileReadAsyncHandle, Data, pCallback.m_cubRead) : " + ret);
            if (ret)
            {
                m_Message = System.Text.Encoding.UTF8.GetString(Data, (int)pCallback.m_nOffset, (int)pCallback.m_cubRead);
            }
        }
    }
Ejemplo n.º 4
0
        public void HandleFileReadAsyncComplete(RemoteStorageFileReadAsyncComplete_t param, bool bIOFailure)
        {
            result = param.m_eResult;
            //If the request result was okay fetch the binary data
            if (result == EResult.k_EResultOK)
            {
                binaryData = new byte[address.fileSize];
                if (!SteamRemoteStorage.FileReadAsyncComplete(param.m_hFileReadAsync, binaryData, (uint)binaryData.Length))
                {
                    //If we failed to read the binary data update the result to fail
                    result = EResult.k_EResultFail;
                }
                else if (linkedLibrary != null)
                {
                    linkedLibrary.activeFile = this;
                    WriteToLibrary(linkedLibrary);
                }
            }

            if (Complete != null)
            {
                Complete.Invoke(this);
            }
        }