示例#1
0
        void OnEnable()
        {
            if (singleton != this)
            {
                Destroy(this);
                return;
            }

            if (!SteamManager.Initialized)
            {
                return;
            }
            if (Application.isEditor)
            {
                SteamUserStats.ResetAllStats(true);
            }
            // Cache the GameID for use in the Callbacks
            m_GameID = new CGameID(SteamUtils.GetAppID());

            m_UserStatsReceived = Callback <UserStatsReceived_t> .Create(OnUserStatsReceived);

            m_UserStatsStored = Callback <UserStatsStored_t> .Create(OnUserStatsStored);

            m_UserAchievementStored = Callback <UserAchievementStored_t> .Create(OnAchievementStored);

            // These need to be reset to get the stats upon an Assembly reload in the Editor.
            m_bRequestedStats = false;
            m_bStatsValid     = false;
        }
示例#2
0
 public void enable()
 {
     _gameId           = new CGameID(SteamUtils.GetAppID());
     m_bRequestedStats = false;
     m_bStatsValid     = false;
     Console.WriteLine(_gameId);
 }
        public static void updateWorkshopItem(ModData data, string path, Action <bool> callback)
        {
            var items = initPublishedWorkshopItems();

            if (!items.ContainsKey(path))
            {
                throw new Exception("item must be published before it is updated.");
            }

            var handle = SteamUGC.StartItemUpdate(SteamUtils.GetAppID(), items[path]);

            SteamUGC.SetItemTitle(handle, data.title);
            SteamUGC.SetItemDescription(handle, data.description);
            SteamUGC.SetItemTags(handle, data.tags);
            SteamUGC.SetItemPreview(handle, data.previewImage);

            SteamUGC.SetItemContent(handle, path);
            SteamUGC.SetItemVisibility(handle, ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPublic);
            var call = SteamUGC.SubmitItemUpdate(handle, "");

            var result = CallResult <SubmitItemUpdateResult_t> .Create();

            result.Set(call, (param, error) => {
                callback(!error && param.m_eResult == EResult.k_EResultOK);
            });
        }
示例#4
0
 public static void ShowMarketPlace(PlayerIndex player)
 {
     SteamFriends.ActivateGameOverlayToStore(
         SteamUtils.GetAppID(),
         EOverlayToStoreFlag.k_EOverlayToStoreFlag_None
         );
 }
示例#5
0
    static void CreateItemTask(SteamAPICall_t handle, string title, string description, string content, string[] tags, string image, bool update = false)
    {
        while (!IsCompleted(handle))
        {
        }
        UGCUpdateHandle_t  updateHandle = UGCUpdateHandle_t.Invalid;
        CreateItemResult_t callback     = AllocCallback <CreateItemResult_t>(handle, out IntPtr pCallback, CreateItemResult_t.k_iCallback);

        if (callback.m_eResult == EResult.k_EResultOK)
        {
            PublishedFileId_t _PublishedFileID = callback.m_nPublishedFileId;
            updateHandle = SteamUGC.StartItemUpdate(SteamUtils.GetAppID(), _PublishedFileID);
            SteamUGC.SetItemTitle(updateHandle, title);
            SteamUGC.SetItemDescription(updateHandle, description);
            SteamUGC.SetItemContent(updateHandle, content);
            SteamUGC.SetItemTags(updateHandle, tags);
            SteamUGC.SetItemPreview(updateHandle, image);
            SteamUGC.SetItemVisibility(updateHandle, ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPrivate);
            SteamAPICall_t submitHandle = SteamUGC.SubmitItemUpdate(updateHandle, "Initial commit");
            SubmitItemAsync(submitHandle, updateHandle);
        }
        else
        {
            Console.WriteLine("Couldn't create a new item ! Press any key to continue...");
        }
        ReleaseCallback(pCallback);
    }
示例#6
0
    public unsafe bool ApplyWorkshopData(WorkshopItemData data)
    {
        UGCUpdateHandle_t handle = SteamUGC.StartItemUpdate(SteamUtils.GetAppID(), _id);

        if (handle.m_UGCUpdateHandle == 0)
        {
            return(false);
        }
        this.data = data;
        if (data.name != null)
        {
            SteamUGC.SetItemTitle(handle, data.name);
            SteamUGC.SetItemVisibility(handle, (ERemoteStoragePublishedFileVisibility)data.visibility);
        }
        if (data.description != null)
        {
            SteamUGC.SetItemDescription(handle, data.description);
        }
        List <string> tags = data.tags;

        if (tags != null && tags.Count != 0)
        {
            SteamUGC.SetItemTags(handle, data.tags);
        }
        SteamUGC.SetItemPreview(handle, data.previewPath);
        SteamUGC.SetItemContent(handle, data.contentFolder);
        _currentUpdateHandle = handle;
        Steam.StartUpload(this);
        return(true);
    }
        IEnumerator WaitForSteamworksInitialization()
        {
            float time = Time.realtimeSinceStartup;

            while (!SteamManager.Initialized)
            {
                time += Time.deltaTime;
                if (time > 10f)
                {
                    Debug.LogError("Steamworks initialization timed out!"); // This might happen if the user doesn't have Steam installed.
                    EvalEntitlement(false);
                    break;
                }
                yield return(null);
            }

            _gameID = new CGameID(SteamUtils.GetAppID());

            // Setup callbacks for server communication events.
            _userStatsReceivedCallback = Callback <UserStatsReceived_t> .Create(OnUserStatsReceived);

            _achievementStoredCallback = Callback <UserAchievementStored_t> .Create(OnAchievementStored);

            base.Initialize();  // Finish initializing only after Steamworks is ready.
        }
    /// <summary>
    /// Registers a file's info. (Must send file next with sendFileOrUpdate). This is also used when updating files.
    /// </summary>
    /// <param name="pubId">Obtained from CreateWorkshopItem</param>
    /// <param name="title">Limit the title length to 128 ASCII characters</param>
    /// <param name="description">Limit the description length to 8000 ASCII characters</param>
    /// <param name="visability">Valid visibility (ERemoteStoragePublishedFileVisibility) values include:        k_ERemoteStoragePublishedFileVisibilityPublic = 0        k_ERemoteStoragePublishedFileVisibilityFriendsOnly = 1        k_ERemoteStoragePublishedFileVisibilityPrivate = 2</param>
    /// <param name="tags">Utilizes a SteamParamStringArray_t which contains a pointer to an array of char * strings and a count of the number of strings in the array. </param>
    /// <param name="contentFolder">pszContentFolder is the absolute path to a local folder containing one or more files that represents the workshop item. For efficient upload and download, files should not be merged or compressed into single files (e.g. zip files). </param>
    /// <param name="imagePreviewFile">pszPreviewFile is the absolute path to a local preview image file for the workshop item. It must be under 1MB in size. The format should be one that both the web and the application (if necessary) can render. Suggested formats include JPG, PNG or GIF. </param>
    /// <returns></returns>
    public UGCUpdateHandle_t registerFileInfoOrUpdate(PublishedFileId_t pubId, string title, string description, ERemoteStoragePublishedFileVisibility visability, IList <string> tags, string contentFolder, string imagePreviewFile)
    {
        bool success = true;
        //2. An item update begins with a call to:
        UGCUpdateHandle_t handle;

        handle = SteamUGC.StartItemUpdate(SteamUtils.GetAppID(), pubId);

        //3. Using the UGCUpdateHandle_t that is returned from StartItemUpdate, calls can be made to update the Title, Description, Visibility, Tags, Item Content and Item Preview Image through the various SetItem methods.
        success = SteamUGC.SetItemTitle(handle, title);
        Console.Write("Title: " + success);

        success = SteamUGC.SetItemDescription(handle, description);
        Console.Write(" -- Description: " + success);

        success = SteamUGC.SetItemVisibility(handle, visability);
        Console.Write(" -- Visability: " + success);

        success = SteamUGC.SetItemTags(handle, tags);
        Console.Write(" -- Tags: " + success);

        //TODO: We need to fix these paths>>>>>>>
        success = SteamUGC.SetItemContent(handle, contentFolder);
        Console.Write(" -- Content: " + success);

        success = SteamUGC.SetItemPreview(handle, imagePreviewFile);
        Console.WriteLine(" -- Preview: " + success);

        Console.WriteLine("registerFileInfo (UGCUpdateHandle_t): " + handle);

        m_UGCUpdateHandle = handle;

        return(handle);
    }
        public void Initialize()
        {
            var gamePath = CoreContext.LaunchService.GamePath;

            if (gamePath == null)
            {
                MessageBox.Show("Soulstorm steam game not found");
                return;
            }

            if (SteamAPI.RestartAppIfNecessary(new AppId_t(9450)))
            {
                RestartAsSoulstormExe();
                return;
            }

            if (!SteamAPI.Init())
            {
                throw new Exception("Cant init SteamApi");
            }

            var appId = SteamUtils.GetAppID();

            if (appId.m_AppId != 9450)
            {
                throw new Exception("Wrong App Id!");
            }

            IsInitialized = true;
        }
    void OnEnable()
    {
        if (!SteamManager.Initialized)
        {
            return;
        }

        // Cache the GameID for use in the Callbacks
        m_GameID = new CGameID(SteamUtils.GetAppID());

        m_UserStatsReceived = Callback <UserStatsReceived_t> .Create(OnUserStatsReceived);

        m_UserStatsStored = Callback <UserStatsStored_t> .Create(OnUserStatsStored);

        m_UserAchievementStored = Callback <UserAchievementStored_t> .Create(OnAchievementStored);

        //添加的回调
        m_LobbyCreated = CallResult <LobbyCreated_t> .Create(OnLobbyCreated);

        m_LobbyMatchList = CallResult <LobbyMatchList_t> .Create(OnLobbyMatchedList);

        m_LobbyChatUpdate = Callback <LobbyChatUpdate_t> .Create(OnLobbyChatUpdated);

        m_LobbyEnter = CallResult <LobbyEnter_t> .Create(OnLobbyEntered);

        m_GameLobbyJoinRequested = Callback <GameLobbyJoinRequested_t> .Create(OnGameLobbyJoinRequested);

        //p2p相关回调
        m_P2PSessionRequest = Callback <P2PSessionRequest_t> .Create(OnP2PRequest);

        // These need to be reset to get the stats upon an Assembly reload in the Editor.
        m_bRequestedStats = false;
        m_bStatsValid     = false;
    }
示例#11
0
        protected override void CheckEntitlement()
        {
            if (!Application.isEditor)
            {
                if (File.Exists("steam_appid.txt"))
                {
                    try
                    {
                        File.Delete("steam_appid.txt");
                    }
                    catch (System.Exception e) { Debug.Log(e.Message); }

                    if (File.Exists("steam_appid.txt"))
                    {
                        Debug.LogError("Found a steam_appid.txt file in the root folder.");
                        EvalEntitlement(false);
                    }
                }
            }

            if (SteamAPI.RestartAppIfNecessary(SteamUtils.GetAppID()))
            {
                EvalEntitlement(false);
            }
            else
            {
                EvalEntitlement(true);
            }
        }
示例#12
0
    void OnEnable()
    {
        if (!SteamManager.Initialized)
        {
            return;
        }

        // Cache the GameID for use in the Callbacks
        m_GameID = new CGameID(SteamUtils.GetAppID());

        //游戏会话开始后,从Steam后端获取用户的数据:SteamUserStats()->RequestCurrentStats()
        //得到回调:UserStatsReceived_t
        m_UserStatsReceived = Callback <UserStatsReceived_t> .Create(OnUserStatsReceived);

        //上传数据后:SteamUserStats()->StoreStats()
        //得到回调:UserStatsStored_t
        m_UserStatsStored = Callback <UserStatsStored_t> .Create(OnUserStatsStored);

        //解锁了一项或多项成就时,针对各项解锁的成就调用 SteamUserStats->SetAchievement();
        //回调UserAchievementStored_t
        m_UserAchievementStored = Callback <UserAchievementStored_t> .Create(OnAchievementStored);

        // m_LeaderboardFindResult = CallResult<LeaderboardFindResult_t>.Create(OnLeaderboardFindResult);
        // m_LeaderboardScoreUploaded = CallResult<LeaderboardScoreUploaded_t>.Create(OnLeaerboardScoreUploaded);
        //m_LeaderboardScoresDownloaded = CallResult<LeaderboardScoresDownloaded_t>.Create(OnLeaderboardScoresDownloaded);
        // These need to be reset to get the stats upon an Assembly reload in the Editor.
        m_bRequestedStats = false;
        m_bStatsValid     = false;
        // SteamAPICall_t handle = SteamUserStats.FindOrCreateLeaderboard("PlayerValue", ELeaderboardSortMethod.k_ELeaderboardSortMethodDescending, ELeaderboardDisplayType.k_ELeaderboardDisplayTypeNumeric);
        // m_LeaderboardFindResult.Set(handle);
    }
        public override void Init()
        {
            if (IsSignedIn)
            {
                m_GameID            = new CGameID(SteamUtils.GetAppID());
                m_UserStatsReceived = Callback <UserStatsReceived_t> .Create(OnUserStatsReceived);

                m_UserStatsStored = Callback <UserStatsStored_t> .Create(OnUserStatsStored);

                m_UserAchievementStored = Callback <UserAchievementStored_t> .Create(OnAchievementStored);

                //m_LeaderboardScoreUploaded = CallResult<LeaderboardScoreUploaded_t>.Create(OnLeaderboardScoreUploaded);


                SteamUserStats.RequestCurrentStats();

                //SteamUser.
                RaiseGameServiceEvent(new GameServiceEvent(GameServiceEventType.SignInSuccess));
                GetSmallAvatar(SteamUser.GetSteamID());
            }
            else
            {
                RaiseGameServiceEvent(new GameServiceEvent(GameServiceEventType.SingInFailed));
            }
        }
示例#14
0
        private static void OnItemCreated(CreateItemResult_t result, bool IOFailure)
        {
            if (IOFailure || result.m_eResult != EResult.k_EResultOK)
            {
                uploadingHook = null;
                Dialog_WorkshopOperationInProgress.CloseAll();
                Log.Error("Workshop: OnItemCreated failure. Result: " + result.m_eResult.GetLabel());
                Find.WindowStack.Add(new Dialog_MessageBox("WorkshopSubmissionFailed".Translate(GenText.SplitCamelCase(result.m_eResult.GetLabel()))));
            }
            else
            {
                uploadingHook.PublishedFileId = result.m_nPublishedFileId;
                if (Prefs.LogVerbose)
                {
                    Log.Message("Workshop: Item created. PublishedFileId: " + uploadingHook.PublishedFileId);
                }
                curUpdateHandle = SteamUGC.StartItemUpdate(SteamUtils.GetAppID(), uploadingHook.PublishedFileId);
                SetWorkshopItemDataFrom(curUpdateHandle, uploadingHook, creating: true);
                curStage = WorkshopInteractStage.SubmittingItem;
                if (Prefs.LogVerbose)
                {
                    Log.Message("Workshop: Submitting item.");
                }
                SteamAPICall_t hAPICall = SteamUGC.SubmitItemUpdate(curUpdateHandle, "[Auto-generated text]: Initial upload.");
                submitResult = CallResult <SubmitItemUpdateResult_t> .Create(OnItemSubmitted);

                submitResult.Set(hAPICall);
                createResult = null;
            }
        }
示例#15
0
        /// <summary>
        /// Check if any of the current user's friends play this game and add the lobby to the server list if they do.
        /// </summary>
        private void GetFriendGamesList()
        {
            // Get the number of regular friends of the current local user
            var friendCount = SteamFriends.GetFriendCount(EFriendFlags.k_EFriendFlagImmediate);

            if (friendCount == -1)
            {
                return;
            }

            for (int i = 0; i < friendCount; ++i)
            {
                // Get the Steam ID of the friend
                var friendSteamId = SteamFriends.GetFriendByIndex(i, EFriendFlags.k_EFriendFlagImmediate);

                // Get what game the friend is playing
                FriendGameInfo_t gameInfo;
                if (SteamFriends.GetFriendGamePlayed(friendSteamId, out gameInfo))
                {
                    // If they are playing this game as well then get their lobby id
                    if (gameInfo.m_gameID.AppID() == SteamUtils.GetAppID())
                    {
                        AddServer(gameInfo.m_steamIDLobby);
                    }
                }
            }
        }
示例#16
0
 private static bool IsOurAppId(AppId_t appId)
 {
     if (appId != SteamUtils.GetAppID())
     {
         return(false);
     }
     return(true);
 }
示例#17
0
 // Token: 0x06001855 RID: 6229 RVA: 0x0008945C File Offset: 0x0008785C
 private void onGlobalStatsReceived(GlobalStatsReceived_t callback)
 {
     if (callback.m_nGameID != (ulong)SteamUtils.GetAppID().m_AppId)
     {
         return;
     }
     this.triggerGlobalStatisticsRequestReady();
 }
示例#18
0
 static async void CreateItemAsync(string content, string icon)
 {
     Console.WriteLine("Please Wait...");
     SteamAPICall_t createHandle = SteamUGC.CreateItem(SteamUtils.GetAppID(), EWorkshopFileType.k_EWorkshopFileTypeCommunity);
     await Task.Run(() => CreateItemTask(createHandle, "Title", "Description", content, new string[1] {
         "item"
     }, icon, false));
 }
示例#19
0
 static async void GetModsInfoFromUserAsync()
 {
     var query = SteamUGC.CreateQueryUserUGCRequest(SteamUser.GetSteamID().GetAccountID(), EUserUGCList.k_EUserUGCList_Published,
                                                    EUGCMatchingUGCType.k_EUGCMatchingUGCType_UsableInGame, EUserUGCListSortOrder.k_EUserUGCListSortOrder_VoteScoreDesc,
                                                    SteamUtils.GetAppID(), SteamUtils.GetAppID(), 1);
     SteamAPICall_t request = SteamUGC.SendQueryUGCRequest(query);
     await Task.Run(() => GetModsInfoFromUserTask(request));
 }
示例#20
0
    // Create workshop item

    public void CreateWorkshopItem()
    {
        CheckInitialized();

        Debug.Log("Creating item");
        SteamAPICall_t callback = SteamUGC.CreateItem(SteamUtils.GetAppID(), EWorkshopFileType.k_EWorkshopFileTypeCommunity);

        this.createItemResult.Set(callback);
    }
示例#21
0
    private void OnEnable()
    {
        if (SteamManager.Initialized)
        {
            m_UserStatsReceived = Callback <UserStatsReceived_t> .Create(OnUserStatsReceived);

            m_GameID = new CGameID(SteamUtils.GetAppID());      // Cache the GameID for use in the Callbacks
        }
    }
示例#22
0
 private static void onClickedReportButton(SleekButton button)
 {
     if (!Provider.provider.browserService.canOpenBrowser)
     {
         MenuUI.alert(MenuPauseUI.localization.format("Overlay"));
         return;
     }
     Provider.provider.browserService.open("http://steamcommunity.com/app/" + SteamUtils.GetAppID() + "/discussions/9/613936673439628788/");
 }
示例#23
0
 public unsafe static bool Authorize()
 {
     if (!_initialized)
     {
         return(false);
     }
     // TODO: SteamApps.RequestAppProofOfPurchaseKey? SteamApps.BIsAppInstalled? SteamApps.BIsSubscribedApp?
     return(SteamApps.BIsSubscribedApp(SteamUtils.GetAppID()));
 }
        // Token: 0x06001867 RID: 6247 RVA: 0x00089658 File Offset: 0x00087A58
        private void onUserStatsReceived(UserStatsReceived_t callback)
        {
            if (callback.m_nGameID != (ulong)SteamUtils.GetAppID().m_AppId)
            {
                return;
            }
            SteamworksCommunityEntity entityID = new SteamworksCommunityEntity(callback.m_steamIDUser);

            this.triggerUserStatisticsRequestReady(entityID);
        }
示例#25
0
 public static WorkshopItem CreateItem()
 {
     if (!_initialized)
     {
         return(null);
     }
     _pendingItem = new WorkshopItem();
     SetCallResult <CreateItemResult_t>(SteamUGC.CreateItem(SteamUtils.GetAppID(), EWorkshopFileType.k_EWorkshopFileTypeFirst));
     return(_pendingItem);
 }
        //Process _soulstormProcess;

        public MainWindow()
        {
            InitializeComponent();

            CompositionTarget.Rendering += OnRender;


            if (SteamAPI.RestartAppIfNecessary(new AppId_t(9450)))
            //if (SteamAPI.RestartAppIfNecessary(AppId_t.Invalid))
            {
                Console.WriteLine("APP RESTART REQUESTED");
                Environment.Exit(0);
            }

            if (SteamAPI.Init())
            {
                Console.WriteLine("Steam inited");
            }
            else
            {
                MessageBox.Show("Клиент Steam не запущен");
                Environment.Exit(0);
                return;
            }


            var appId = SteamUtils.GetAppID();

            /*if (appId.m_AppId != 9450)
             * {
             *  MessageBox.Show("Программа запущена не от имени Sousltorm. Необходимо переместить все файлы этой программы в папку с игрой в Steam, предварительно сохранив оригинальный Soulstorm.exe. Запустить программу, а потом запустить SS 1.2 с модом Soulstorm Bugfix Mod 1.56a.");
             *  Environment.Exit(0);
             *  return;
             * }*/

            /*var currentMoscowTime = new DateTime(1970, 1, 1).AddSeconds(SteamUtils.GetServerRealTime()).AddHours(3);
             *
             * if (currentMoscowTime > new DateTime(2019, 8, 4, 22, 0,0))
             * {
             *  MessageBox.Show($@"Событие было завершено");
             *  Environment.Exit(0);
             *  return;
             * }*/

            // var steamId = SteamUser.GetSteamID().m_SteamID;

            /* if (!RegisteredIds.Contains(steamId))
             * {
             *   MessageBox.Show($@"Ваш SteamID {steamId} не был зарегистрирован для участия. Обратитесь к elamaunt'у.");
             *   Environment.Exit(0);
             *   return;
             * }*/

            CoreContext.ServerListRetrieve.StartReloadingTimer();
        }
示例#27
0
 public uint GetAppId()
 {
     if (_init)
     {
         return(SteamUtils.GetAppID().m_AppId);
     }
     else
     {
         return(AppId_t.Invalid.m_AppId);
     }
 }
示例#28
0
        internal static void FetchPromotionMods()
        {
            if (SteamManager.Initialized == false)
            {
                return;
            }

            var rimworldID = SteamUtils.GetAppID();

            unchecked
            {
                var aID       = new AccountID_t((uint)userID);
                var itemQuery = SteamUGC.CreateQueryUserUGCRequest(aID,
                                                                   EUserUGCList.k_EUserUGCList_Published, EUGCMatchingUGCType.k_EUGCMatchingUGCType_UsableInGame,
                                                                   EUserUGCListSortOrder.k_EUserUGCListSortOrder_VoteScoreDesc, rimworldID, rimworldID,
                                                                   1);
                SteamUGC.SetReturnLongDescription(itemQuery, true);
                SteamUGC.SetRankedByTrendDays(itemQuery, 7);
                AsyncUserModsQuery(itemQuery, (result, failure) =>
                {
                    for (uint i = 0; i < result.m_unNumResultsReturned; i++)
                    {
                        if (SteamUGC.GetQueryUGCResult(result.m_handle, i, out var mod))
                        {
                            if (promotionMods.Any(m => m.m_nPublishedFileId.m_PublishedFileId == mod.m_nPublishedFileId.m_PublishedFileId) == false)
                            {
                                promotionMods.Add(mod);
                                var modID = mod.m_nPublishedFileId.m_PublishedFileId;

                                var path = ModPreviewPath(modID);
                                if (File.Exists(path) == false || new FileInfo(path).Length != mod.m_nPreviewFileSize)
                                {
                                    AsyncDownloadQuery(mod.m_hPreviewFile, path, (result2, failure2) =>
                                    {
                                        if (File.Exists(path))
                                        {
                                            if (previewTextures.ContainsKey(modID))
                                            {
                                                previewTextures.Remove(modID);
                                            }
                                        }
                                    });
                                }

                                UpdateVotingStatus(modID, (result2, failure2) =>
                                {
                                    allVoteStati[modID] = (result2.m_eResult == EResult.k_EResultOK) ? result2.m_bVotedUp : (bool?)null;
                                });
                            }
                        }
                    }
                });
            }
        }
    /// <summary>
    /// Create an item in the Steam Workshop (you must then Register it with registerFileInfo). Returns a SteamAPICall_t handle. m_bUserNeedsToAcceptWorkshopLegalAgreement The m_bUserNeedsToAcceptWorkshopLegalAgreement variable should also be checked and if true, the user should be redirected to accept the legal agreement. See the Workshop Legal Agreement section for more details. https://partner.steamgames.com/?goto=%2Fdocumentation%2Fugc#Legal
    /// </summary>
    /// <returns>Returns a SteamAPICall_t handle</returns>
    public SteamAPICall_t CreateWorkshopItem()
    {
        //1. Request a handle
        SteamAPICall_t handle;

        handle = SteamUGC.CreateItem(SteamUtils.GetAppID(), EWorkshopFileType.k_EWorkshopFileTypeCommunity);
        OnCreateItemResultCallResult.Set(handle); //not sure if this allows more than 1 upload at a time.
        //2. CreateItemResult_t will be called via a callback.
        Console.WriteLine("CreateWorkshopItem (SteamAPICall_t): " + handle);
        return(handle);
    }
示例#30
0
 private void OnUserStatsStored(UserStatsStored_t args)
 {
     if (args.m_nGameID == SteamUtils.GetAppID().m_AppId)
     {
         if (args.m_eResult == EResult.k_EResultOK)
         {
             // Steamworks stats and achievements stored
             //App.LogDebug( "Steamworks user stats stored." );
         }
     }
 }