internal WorkshopQueryUser(uint unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder) { _accountID = new AccountID_t(unAccountID); _listType = eListType; _type = eMatchingUGCType; _sortOrder = eSortOrder; }
public void InstancedSet(AccountID_t unAccountID, uint unInstance, EUniverse eUniverse, EAccountType eAccountType) { SetAccountID(unAccountID); SetEUniverse(eUniverse); SetEAccountType(eAccountType); SetAccountInstance(unInstance); }
public CSteamID(AccountID_t unAccountID, uint unAccountInstance, EUniverse eUniverse, EAccountType eAccountType) { m_SteamID = 0; #if _SERVER && Assert Assert( ! ( ( EAccountType.k_EAccountTypeIndividual == eAccountType ) && ( unAccountInstance > k_unSteamUserWebInstance ) ) ); // enforce that for individual accounts, instance is always 1 #endif // _SERVER InstancedSet(unAccountID, unAccountInstance, eUniverse, eAccountType); }
public override void GetAvatarForPlayerId(GameServiceUserInfo user) { AccountID_t accountId = new AccountID_t(Convert.ToUInt32(user.PlayerId)); CSteamID steamId = new CSteamID(accountId, EUniverse.k_EUniversePublic, EAccountType.k_EAccountTypeIndividual); SteamWebApi.GetSteamUserAvatar(steamId.ToString(), user.SetAvatarFromSprite); }
public static List <CrossPromotion> PromotionsForAuthor(AccountID_t author) { if (_modsForAuthor.TryGetValue(author, out var mods)) { return(mods); } mods = new List <CrossPromotion>(); _modsForAuthor.Add(author, mods); FetchModsForAuthor(author); return(mods); }
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; }); } } } }); } }
public static List <CrossPromotion> ModsForAuthor(AccountID_t author) { if (_modsForAuthor.TryGetValue(author, out var mods)) { return(mods); } if (!_currentlyFetchingAuthors.Contains(author)) { FetchModsForAuthor(author); } return(null); }
public void Set(AccountID_t unAccountID, EUniverse eUniverse, EAccountType eAccountType) { SetAccountID(unAccountID); SetEUniverse(eUniverse); SetEAccountType(eAccountType); if (eAccountType == EAccountType.k_EAccountTypeClan || eAccountType == EAccountType.k_EAccountTypeGameServer) { SetAccountInstance(0); } else { SetAccountInstance(Constants.k_unSteamUserDefaultInstance); } }
private void WorkshopTool_Load(object sender, EventArgs e) { steamId = SteamUser.GetSteamID(); accountId = steamId.GetAccountID(); for (int index = 0; index < CmdlineArgs.Count(); index++) { if (CmdlineArgs[index] == "-nodelete") { bDontDeleteTempFiles = true; } } workshopTextBox1.PrintLine("Use 'quit' or 'exit' to exit WorkshopTool. Use 'help' to get help."); workshopTextBox1.PrintPrompt(); }
private static void FetchModsForAuthor(AccountID_t author) { Debug.TracePromotions($"Fetching mods for {author}..."); var query = SteamUGC.CreateQueryUserUGCRequest( author, EUserUGCList.k_EUserUGCList_Published, EUGCMatchingUGCType.k_EUGCMatchingUGCType_UsableInGame, EUserUGCListSortOrder.k_EUserUGCListSortOrder_VoteScoreDesc, AppID, AppID, 1); SteamUGC.AddRequiredTag(query, VersionControl.CurrentMajor + "." + VersionControl.CurrentMinor); var request = SteamUGC.SendQueryUGCRequest(query); _userModsCallResult.Set(request); }
public static void GetPublishedItems(AccountID_t accountId, AppId_t WorkshopAppId, AppId_t GameAppId, GetPublishedItemsDelegate InPublishedItemsDelegate) { PublishedItems_delegate = InPublishedItemsDelegate; uint nPage = 1u; UGCQueryHandle_t hQuery = SteamUGC.CreateQueryUserUGCRequest(accountId, EUserUGCList.k_EUserUGCList_Published, EUGCMatchingUGCType.k_EUGCMatchingUGCType_Items, EUserUGCListSortOrder.k_EUserUGCListSortOrder_CreationOrderDesc, WorkshopAppId, GameAppId, nPage); SteamAPICall_t hSteamAPICall = SteamUGC.SendQueryUGCRequest(hQuery); if (hSteamAPICall != SteamAPICall_t.Invalid) { m_SteamUGCQueryCompletedCallback.Set(hSteamAPICall, null); } else { PublishedItems_delegate(EResult.k_EResultFail); } }
public static HeathenWorkshopItemQuery Create(AccountID_t account, EUserUGCList listType, EUGCMatchingUGCType matchingType, EUserUGCListSortOrder sortOrder, AppId_t creatorApp, AppId_t consumerApp) { HeathenWorkshopItemQuery nQuery = new HeathenWorkshopItemQuery { matchedRecordCount = 0, PageCount = 1, isAllQuery = false, isUserQuery = true, listType = listType, sortOrder = sortOrder, matchingType = matchingType, creatorApp = creatorApp, consumerApp = consumerApp, account = account, Page = 1, handle = SteamUGC.CreateQueryUserUGCRequest(account, listType, matchingType, sortOrder, creatorApp, consumerApp, 1) }; return(nQuery); }
public void SetAccountID(AccountID_t other) { m_SteamID = (m_SteamID & ~(0xFFFFFFFFul << (ushort)0)) | (((ulong)(other) & 0xFFFFFFFFul) << (ushort)0); }
public CSteamID(AccountID_t unAccountID, EUniverse eUniverse, EAccountType eAccountType) { m_SteamID = 0; Set(unAccountID, eUniverse, eAccountType); }
/// <summary> /// <para> Query UGC associated with a user. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1.</para> /// </summary> public static UGCQueryHandle_t CreateQueryUserUGCRequest(AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint unPage) { InteropHelp.TestIfAvailableGameServer(); return (UGCQueryHandle_t)NativeMethods.ISteamGameServerUGC_CreateQueryUserUGCRequest(unAccountID, eListType, eMatchingUGCType, eSortOrder, nCreatorAppID, nConsumerAppID, unPage); }
public static extern ulong ISteamGameServerUGC_CreateQueryUserUGCRequest(AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint unPage);