TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ InnerDownloadHandler()

static void Terraria.Social.Steam.SteamedWraps.InnerDownloadHandler ( IDownloadProgress uiProgress,
PublishedFileId_t publishId )
inlinestaticprivate

Definition at line 653 of file SteamedWraps.cs.

654 {
655 //IL_00a6: Unknown result type (might be due to invalid IL or missing references)
656 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
657 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
658 int nextPercentageToLog = 10;
659 int numFailures = 0;
660 ulong dlBytes = default(ulong);
661 ulong totalBytes = default(ulong);
663 {
664 if (SteamClient)
665 {
666 SteamUGC.GetItemDownloadInfo(publishId, ref dlBytes, ref totalBytes);
667 }
668 else
669 {
670 SteamGameServerUGC.GetItemDownloadInfo(publishId, ref dlBytes, ref totalBytes);
671 }
672 if (totalBytes == 0L)
673 {
674 if (numFailures++ < 10)
675 {
676 Thread.Sleep(100);
677 continue;
678 }
679 break;
680 }
681 uiProgress?.UpdateDownloadProgress((float)dlBytes / (float)Math.Max(totalBytes, 1uL), (long)dlBytes, (long)totalBytes);
682 int percentage = (int)MathF.Round((float)dlBytes / (float)totalBytes * 100f);
684 {
685 Utils.LogAndConsoleInfoMessage(Language.GetTextValue("tModLoader.DownloadProgress", percentage));
687 if (nextPercentageToLog > 100 && nextPercentageToLog != 110)
688 {
690 }
691 }
692 if ((float)(dlBytes / totalBytes) != 1f)
693 {
694 continue;
695 }
696 break;
697 }
698 }
static string GetTextValue(string key)
Retrieves the text value for a specified localization key. The text returned will be for the currentl...
Definition Language.cs:35
Contains methods to access or retrieve localization values. The Localization Guideteaches more about ...
Definition Language.cs:12
static bool IsWorkshopItemInstalled(PublishedFileId_t publishId)

References Terraria.Localization.Language.GetTextValue(), Terraria.Social.Steam.SteamedWraps.IsWorkshopItemInstalled(), Terraria.Utils.LogAndConsoleInfoMessage(), and Terraria.Social.Steam.SteamedWraps.SteamClient.

Referenced by Terraria.Social.Steam.SteamedWraps.Download().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: