Пример #1
0
        public async Task <ResultPage?> GetPageAsync(int page)
        {
            ResultPage?      nullable;
            UGCQueryHandle_t uGCQueryHandleT;

            if (page <= 0)
            {
                throw new Exception("page should be > 0");
            }
            if (this.consumerApp == 0)
            {
                this.consumerApp = SteamClient.AppId;
            }
            if (this.creatorApp == 0)
            {
                this.creatorApp = this.consumerApp;
            }
            if (this.Files != null)
            {
                uGCQueryHandleT = SteamUGC.Internal.CreateQueryUGCDetailsRequest(this.Files, (uint)this.Files.Length);
            }
            else if (!this.steamid.HasValue)
            {
                uGCQueryHandleT = SteamUGC.Internal.CreateQueryAllUGCRequest1(this.queryType, this.matchingType, this.creatorApp.Value, this.consumerApp.Value, (uint)page);
            }
            else
            {
                ISteamUGC @internal = SteamUGC.Internal;
                SteamId   value     = this.steamid.Value;
                uGCQueryHandleT = @internal.CreateQueryUserUGCRequest(value.AccountId, this.userType, this.matchingType, this.userSort, this.creatorApp.Value, this.consumerApp.Value, (uint)page);
            }
            this.ApplyConstraints(uGCQueryHandleT);
            SteamUGCQueryCompleted_t?nullable1 = await SteamUGC.Internal.SendQueryUGCRequest(uGCQueryHandleT);

            SteamUGCQueryCompleted_t?nullable2 = nullable1;

            nullable1 = null;
            if (!nullable2.HasValue)
            {
                nullable = null;
            }
            else if (nullable2.Value.Result == Result.OK)
            {
                ResultPage resultPage = new ResultPage()
                {
                    Handle      = nullable2.Value.Handle,
                    ResultCount = (int)nullable2.Value.NumResultsReturned,
                    TotalCount  = (int)nullable2.Value.TotalMatchingResults,
                    CachedData  = nullable2.Value.CachedData
                };
                nullable = new ResultPage?(resultPage);
            }
            else
            {
                nullable = null;
            }
            return(nullable);
        }
Пример #2
0
 internal override void InitializeInterface(bool server)
 {
     Internal = new ISteamUGC(server);
     InstallEvents();
 }
Пример #3
0
 internal static void Shutdown()
 {
     _internal = null;
 }