Esempio n. 1
0
 void OnRemoteStorageFileShareResult(RemoteStorageFileShareResult_t pCallback, bool bIOFailure)
 {
     Debug.Log("[" + RemoteStorageFileShareResult_t.k_iCallback + " - RemoteStorageFileShareResult] - " + pCallback.m_eResult + " -- " + pCallback.m_hFile);
     if (pCallback.m_eResult == EResult.k_EResultOK)
     {
         m_UGCHandle = pCallback.m_hFile;
     }
 }
Esempio n. 2
0
 private void OnShareFinished(RemoteStorageFileShareResult_t pCallback, bool fail)
 {
     if (fail || pCallback.m_eResult != EResult.k_EResultOK)
     {
         throw new Exception("Error sharing " + name);
     }
     finished = true;
     url      = "http://cloud-3.steamusercontent.com/ugc/" + pCallback.m_hFile.ToString() + "/" + sha1 + "/";
 }
Esempio n. 3
0
        // SteamAPICall_t
        public CallbackHandle FileShare(string pchFile /*const char **/, Action <RemoteStorageFileShareResult_t, bool> CallbackFunction = null /*Action<RemoteStorageFileShareResult_t, bool>*/)
        {
            SteamAPICall_t callback = 0;

            callback = platform.ISteamRemoteStorage_FileShare(pchFile);

            if (CallbackFunction == null)
            {
                return(null);
            }

            return(RemoteStorageFileShareResult_t.CallResult(steamworks, callback, CallbackFunction));
        }
Esempio n. 4
0
    void OnRemoteStorageFileShareResult(RemoteStorageFileShareResult_t pCallback, bool bIOFailure)
    {
        try
        {
            if (pCallback.m_eResult != EResult.k_EResultOK)
            {
                if (CallBackSteamUploadResult != null)
                {
                    CallBackSteamUploadResult(_ID, false, _hashCode);
                }
                _step = ExportStep.ExportFailed;
                ShowMsg(_step);
                return;
            }

            _UGCHandle = pCallback.m_hFile;
            OnFileShared();
            if (CallBackSteamUploadResult != null)
            {
                CallBackSteamUploadResult(_ID, true, _hashCode);
            }
            if (!_Publish)
            {
                return;
            }
            SteamAPICall_t handler = SteamRemoteStorage.PublishWorkshopFile(_FileName, _PreFileName, SteamUtils.GetAppID(),
                                                                            _RealFileName, _FileDescription, ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPublic,
                                                                            _Tags, EWorkshopFileType.k_EWorkshopFileTypeCommunity);
            _handler.Add(handler);
            RemoteStorageFilePublishResult.Set(handler);
        }
        catch (Exception)
        {
            Debug.Log("workshop error:" + pCallback.m_eResult);
            if (CallBackSteamUploadResult != null)
            {
                CallBackSteamUploadResult(_ID, false, _hashCode);
            }
            //step 6 导出失败
            _step = ExportStep.ExportFailed;
            ShowMsg(_step);
        }
    }
Esempio n. 5
0
 void OnRemoteStoragePreFileShareResult(RemoteStorageFileShareResult_t pCallback, bool bIOFailure)
 {
     try
     {
         if (pCallback.m_eResult != EResult.k_EResultOK)
         {
             throw new Exception("Upload iso data failed.");
         }
         SteamFileWrite();
     }
     catch (Exception)
     {
         Debug.Log("workshop error:" + pCallback.m_eResult);
         if (CallBackSteamUploadResult != null)
         {
             CallBackSteamUploadResult(_ID, false, _hashCode);
         }
         //step 6 导出失败
         _step = ExportStep.ExportFailed;
         ShowMsg(_step);
     }
 }