示例#1
0
        public SteamCdnServerPool(SteamContentClient steamContentClient, SteamContentServerQualityProvider steamContentServerQualityProvider)
        {
            _steamApps          = steamContentClient.SteamClient.InternalClient.GetHandler <SteamKit2.SteamApps>();
            _steamContentClient = steamContentClient;
            _steamContentServerQualityProvider = steamContentServerQualityProvider;

            _steamContentServerQualities = _steamContentServerQualityProvider.Load() ?? new List <SteamContentServerQuality>();
        }
示例#2
0
        public SteamContentClient(Core.SteamClient steamClient,
                                  SteamContentServerQualityProvider steamContentServerQualityProvider = null,
                                  int maxConcurrentDownloadsPerTask = 10,
                                  ulong chunkBufferSize             = 3221225472,
                                  double bufferUsageThreshold       = 1)
        {
            SteamClient = steamClient;
            _steamContentServerQualityProvider = steamContentServerQualityProvider ?? new SteamContentServerQualityNoMemoryProvider();
            SteamUnifiedMessagesService        = SteamClient.InternalClient.GetHandler <SteamKit.SteamUnifiedMessages>();
            PublishedFileService          = SteamUnifiedMessagesService.CreateService <SteamKit.Unified.Internal.IPublishedFile>();
            SteamCdnServerPool            = new SteamCdnServerPool(this, _steamContentServerQualityProvider);
            MaxConcurrentDownloadsPerTask = maxConcurrentDownloadsPerTask;
            ChunkBufferSize      = chunkBufferSize;
            BufferUsageThreshold = bufferUsageThreshold;
            SteamApps            = SteamClient.InternalClient.GetHandler <SteamKit.SteamApps>();
            SteamUser            = SteamClient.InternalClient.GetHandler <SteamKit.SteamUser>();

            _cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(SteamClient.CancellationToken);
        }