Exemple #1
0
            unsafe void RunInternal()
            {
                string queryType = "";

                if (FileId.Count != 0)
                {
                    var fileArray = FileId.Select(x => (SteamNative.PublishedFileId_t)x).ToArray();
                    _resultsRemain = fileArray.Length;

                    Handle    = workshop.ugc.CreateQueryUGCDetailsRequest(fileArray);
                    queryType = "DetailsRequest";
                }
                else if (UserId.HasValue)
                {
                    uint accountId = (uint)(UserId.Value & 0xFFFFFFFFul);
                    Handle    = workshop.ugc.CreateQueryUserUGCRequest(accountId, (SteamNative.UserUGCList)(int) UserQueryType, (SteamNative.UGCMatchingUGCType)(int) QueryType, SteamNative.UserUGCListSortOrder.LastUpdatedDesc, UploaderAppId, AppId, (uint)_resultPage + 1);
                    queryType = "UserRequest";
                }
                else
                {
                    Handle    = workshop.ugc.CreateQueryAllUGCRequest((SteamNative.UGCQuery)(int) Order, (SteamNative.UGCMatchingUGCType)(int) QueryType, UploaderAppId, AppId, (uint)_resultPage + 1);
                    queryType = "AllRequest";
                }

                if (Handle == 0xfffffffffffffffful)
                {
                    throw new Exception("Steam UGC " + queryType + " Query Handle invalid!");
                }

                if (!string.IsNullOrEmpty(SearchText))
                {
                    workshop.ugc.SetSearchText(Handle, SearchText);
                }

                foreach (var tag in RequireTags)
                {
                    workshop.ugc.AddRequiredTag(Handle, tag);
                }

                if (RequireTags.Count > 0)
                {
                    workshop.ugc.SetMatchAnyTag(Handle, !RequireAllTags);
                }

                if (RankedByTrendDays > 0)
                {
                    workshop.ugc.SetRankedByTrendDays(Handle, (uint)RankedByTrendDays);
                }

                foreach (var tag in ExcludeTags)
                {
                    workshop.ugc.AddExcludedTag(Handle, tag);
                }

                Callback = workshop.ugc.SendQueryUGCRequest(Handle, ResultCallback);
            }
            unsafe void RunInternal()
            {
                if (FileId.Count != 0)
                {
                    var fileArray = FileId.Select(x => (SteamNative.PublishedFileId_t)x).ToArray();
                    _resultsRemain = fileArray.Length;

                    Handle = workshop.ugc.CreateQueryUGCDetailsRequest(fileArray);
                }
                else if (UserId.HasValue)
                {
                    uint accountId = (uint)(UserId.Value & 0xFFFFFFFFul);
                    Handle = workshop.ugc.CreateQueryUserUGCRequest(accountId, (SteamNative.UserUGCList)(int) UserQueryType, (SteamNative.UGCMatchingUGCType)(int) QueryType, SteamNative.UserUGCListSortOrder.LastUpdatedDesc, UploaderAppId, AppId, (uint)_resultPage + 1);
                }
                else
                {
                    Handle = workshop.ugc.CreateQueryAllUGCRequest((SteamNative.UGCQuery)(int) Order, (SteamNative.UGCMatchingUGCType)(int) QueryType, UploaderAppId, AppId, (uint)_resultPage + 1);
                }

                if (!string.IsNullOrEmpty(SearchText))
                {
                    workshop.ugc.SetSearchText(Handle, SearchText);
                }

                foreach (var tag in RequireTags)
                {
                    workshop.ugc.AddRequiredTag(Handle, tag);
                }

                if (RequireTags.Count > 0)
                {
                    workshop.ugc.SetMatchAnyTag(Handle, !RequireAllTags);
                }

                foreach (var tag in ExcludeTags)
                {
                    workshop.ugc.AddExcludedTag(Handle, tag);
                }

                Callback = workshop.ugc.SendQueryUGCRequest(Handle, OnResult);
                //  workshop.steamworks.AddCallResult( Callback );
            }