Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_DownloadManager Class Reference
Inheritance diagram for SCR_DownloadManager:
GenericEntity

Protected Member Functions

ScriptInvokerBase< ScriptInvoker_ActionDownloadFullStorageGetOnFullStorageError ()
ScriptInvokerVoid GetOnDownloadQueueCompleted ()
ScriptInvokerVoid GetOnAllDownloadsStopped ()
void GetAllDownloads (array< ref SCR_DownloadManager_Entry > downloads)
 Returns an array of all downloads regardless of their state.
void GetDownloadQueueState (out int nCompleted, out int nTotal)
 Might get delayed by a frame! Just use it for UI.
bool HasRunningDownloads ()
SCR_WorkshopItemActionDownload DownloadingActionAddonById (string id, bool runningOnly=true)
 Return true if there is addon with given id in download queue.
array< ref SCR_WorkshopItemActionDownloadGetDownloadQueue ()
SCR_WorkshopItemActionDownload GetActionOfItem (SCR_WorkshopItem item)
 Return item action for given workshop item.
void SetDownloadsPaused (bool pause, int count=-1)
void PauseAction (SCR_WorkshopItemActionDownload action, bool pause)
bool GetDownloadsPaused ()
void EndAllDownloads ()
array< ref SCR_WorkshopItemActionDownloadGetUnrelatedDownloads (array< ref SCR_WorkshopItem > requiredItems)
bool IsDownloadingActionRequired (SCR_WorkshopItemActionDownload action, array< ref SCR_WorkshopItem > requiredItems)
array< ref SCR_WorkshopItemActionDownloadLatestWithDependencies (notnull SCR_WorkshopItem mainItem, bool downloadMainItem, array< ref SCR_WorkshopItem > dependencies)
array< ref SCR_WorkshopItemActionDownloadDownloadItems (array< ref SCR_WorkshopItem > items)
void DownloadDependecies (array< Dependency > dependencies)
float DownloadQueueSize ()
array< ref SCR_WorkshopItemActionDownloadGetFailedDownloads ()
void ClearFailedDownloads ()
void AddDownloadManagerEntry (notnull SCR_WorkshopItem item, notnull SCR_WorkshopItemActionDownload action)
void RemoveSameAddonFromDownloads (notnull SCR_WorkshopItem item)
float GetDownloadQueueSize ()
float GetDownloadedSize ()
override void EOnFrame (IEntity owner, float timeSlice)
override void EOnInit (IEntity owner)
void Callback_OnNewDownload (SCR_WorkshopItem item, SCR_WorkshopItemActionDownload action)
void OnDownloadProgress (SCR_WorkshopItemActionDownload action, float progressSize)
void Callback_OnDownloadCompleted (SCR_WorkshopItemActionDownload action)
 Called from aciton when a download is completed.
void Callback_OnFailed (SCR_WorkshopItemActionDownload action, int reason)
 Call on downloading fail to show download manager dialog with problematic.
void Callback_OnFullStorageError (SCR_WorkshopItemActionDownload action, float size)
 Call on full addons storage reached to display storage limit reached error.
void Callback_OnCanceled (SCR_WorkshopItemActionDownload action)
void ForceFailRunningDownloads ()
 End all running downloads as fail.
void DownloadAddons (array< ref SCR_WorkshopItem > items)
 Start downloading list of given addons.
void OnDownloadAddonsReady (SCR_DownloadSequence sequence)
void ClearUnfinishedAction (SCR_WorkshopItemActionDownload action)

Static Protected Member Functions

static SCR_DownloadManager GetInstance ()
static bool IsLatestDownloadRequired (SCR_WorkshopItem item)
static void SelectAddonsForLatestDownload (array< ref SCR_WorkshopItem > arrayIn, array< ref SCR_WorkshopItem > arrayOut)
static float GetTotalSizeBytes (array< ref SCR_WorkshopItem > arrayIn, SCR_WorkshopItem extraItem=null)
static float GetDownloadActionsProgress (array< ref SCR_WorkshopItemActionDownload > actions)
 Returns overall progress of all download actions, from 0 to 1.
static float GetItemDownloadActionsProgress (SCR_WorkshopItem item)
 Returns overall download progress for all actions of a workshop item.

Protected Attributes

const int DOWNLOAD_STUCK_DELAY = 60
const int ERROR_FULL_STORAGE = 19
ref array< ref SCR_DownloadManager_Entrym_aDownloadActions = new array<ref SCR_DownloadManager_Entry>()
ref array< ref SCR_WorkshopItemActionDownloadm_aDownloadQueue = new array<ref SCR_WorkshopItemActionDownload>
int m_iQueueDownloadsCompleted
float m_fNoDownloadProgressTimer = 0
float m_fDownloadQueueSize
float m_fDownloadedSize
bool m_bDownloadsPaused
const int FAIL_TIME = 500
ref array< ref SCR_WorkshopItemActionDownloadm_aFailedDownloads = {}
ref ScriptInvoker m_OnNewDownload = new ScriptInvoker
ref ScriptInvokerBase< ScriptInvoker_DownloadManagerActionm_OnDownloadComplete = new ScriptInvokerBase<ScriptInvoker_DownloadManagerAction>()
ref ScriptInvokerBase< ScriptInvoker_DownloadManagerActionErrorm_OnDownloadFailed = new ScriptInvokerBase<ScriptInvoker_DownloadManagerActionError>()
ref ScriptInvokerBase< ScriptInvoker_ActionDownloadFullStoragem_OnFullStorageError
ref ScriptInvokerBase< ScriptInvoker_DownloadManagerActionm_OnDownloadCanceled = new ScriptInvokerBase<ScriptInvoker_DownloadManagerAction>()
ref ScriptInvokerVoid m_OnAllDownloadsStopped

Static Protected Attributes

static SCR_DownloadManager s_Instance

Detailed Description

Definition at line 20 of file SCR_DownloadManager.c.

Member Function Documentation

◆ AddDownloadManagerEntry()

void SCR_DownloadManager::AddDownloadManagerEntry ( notnull SCR_WorkshopItem item,
notnull SCR_WorkshopItemActionDownload action )
inlineprotected

Definition at line 496 of file SCR_DownloadManager.c.

◆ Callback_OnCanceled()

void SCR_DownloadManager::Callback_OnCanceled ( SCR_WorkshopItemActionDownload action)
inlineprotected

Definition at line 722 of file SCR_DownloadManager.c.

◆ Callback_OnDownloadCompleted()

void SCR_DownloadManager::Callback_OnDownloadCompleted ( SCR_WorkshopItemActionDownload action)
inlineprotected

Called from aciton when a download is completed.

Definition at line 673 of file SCR_DownloadManager.c.

◆ Callback_OnFailed()

void SCR_DownloadManager::Callback_OnFailed ( SCR_WorkshopItemActionDownload action,
int reason )
inlineprotected

Call on downloading fail to show download manager dialog with problematic.

Definition at line 695 of file SCR_DownloadManager.c.

◆ Callback_OnFullStorageError()

void SCR_DownloadManager::Callback_OnFullStorageError ( SCR_WorkshopItemActionDownload action,
float size )
inlineprotected

Call on full addons storage reached to display storage limit reached error.

Definition at line 712 of file SCR_DownloadManager.c.

◆ Callback_OnNewDownload()

void SCR_DownloadManager::Callback_OnNewDownload ( SCR_WorkshopItem item,
SCR_WorkshopItemActionDownload action )
inlineprotected

Gets called when a new download action is created. !!! Action creation doesn't mean start of a download. At this point the action is created but it is not activated yet.

Definition at line 631 of file SCR_DownloadManager.c.

◆ ClearFailedDownloads()

void SCR_DownloadManager::ClearFailedDownloads ( )
inlineprotected

Definition at line 490 of file SCR_DownloadManager.c.

◆ ClearUnfinishedAction()

void SCR_DownloadManager::ClearUnfinishedAction ( SCR_WorkshopItemActionDownload action)
inlineprotected

Definition at line 776 of file SCR_DownloadManager.c.

◆ DownloadAddons()

void SCR_DownloadManager::DownloadAddons ( array< ref SCR_WorkshopItem > items)
inlineprotected

Start downloading list of given addons.

Definition at line 740 of file SCR_DownloadManager.c.

◆ DownloadDependecies()

void SCR_DownloadManager::DownloadDependecies ( array< Dependency > dependencies)
inlineprotected

Start downloading list of dependencies of given revision Mainly used for server browser content download

Definition at line 379 of file SCR_DownloadManager.c.

◆ DownloadingActionAddonById()

SCR_WorkshopItemActionDownload SCR_DownloadManager::DownloadingActionAddonById ( string id,
bool runningOnly = true )
inlineprotected

Return true if there is addon with given id in download queue.

Definition at line 123 of file SCR_DownloadManager.c.

◆ DownloadItems()

array< ref SCR_WorkshopItemActionDownload > SCR_DownloadManager::DownloadItems ( array< ref SCR_WorkshopItem > items)
inlineprotected

Start downloading list of scripted workshop items Mainly used for server browser content download

Definition at line 351 of file SCR_DownloadManager.c.

◆ DownloadLatestWithDependencies()

array< ref SCR_WorkshopItemAction > SCR_DownloadManager::DownloadLatestWithDependencies ( notnull SCR_WorkshopItem mainItem,
bool downloadMainItem,
array< ref SCR_WorkshopItem > dependencies )
inlineprotected

Creates new download actions for downloading latest version of main item and all its dependencies. The actions are started if downloads are not paused in the download manager (GetDownloadsPaused()) If the GetDownloadsPaused() is true, the actions are created but not activated.

Definition at line 313 of file SCR_DownloadManager.c.

◆ DownloadQueueSize()

float SCR_DownloadManager::DownloadQueueSize ( )
inlineprotected

Definition at line 412 of file SCR_DownloadManager.c.

◆ EndAllDownloads()

void SCR_DownloadManager::EndAllDownloads ( )
inlineprotected

Ends all downloads in a safe manner. It is meant to be caused when we start a scenario or exit the game. The function should handle the termination of all downloads in safest way currently possible.

Definition at line 219 of file SCR_DownloadManager.c.

◆ EOnFrame()

override void SCR_DownloadManager::EOnFrame ( IEntity owner,
float timeSlice )
inlineprotected

Definition at line 562 of file SCR_DownloadManager.c.

◆ EOnInit()

override void SCR_DownloadManager::EOnInit ( IEntity owner)
inlineprotected

Definition at line 614 of file SCR_DownloadManager.c.

◆ ForceFailRunningDownloads()

void SCR_DownloadManager::ForceFailRunningDownloads ( )
inlineprotected

End all running downloads as fail.

Definition at line 730 of file SCR_DownloadManager.c.

◆ GetActionOfItem()

SCR_WorkshopItemActionDownload SCR_DownloadManager::GetActionOfItem ( SCR_WorkshopItem item)
inlineprotected

Return item action for given workshop item.

Definition at line 155 of file SCR_DownloadManager.c.

◆ GetAllDownloads()

void SCR_DownloadManager::GetAllDownloads ( array< ref SCR_DownloadManager_Entry > downloads)
inlineprotected

Returns an array of all downloads regardless of their state.

Definition at line 98 of file SCR_DownloadManager.c.

◆ GetDownloadActionsProgress()

float SCR_DownloadManager::GetDownloadActionsProgress ( array< ref SCR_WorkshopItemActionDownload > actions)
inlinestaticprotected

Returns overall progress of all download actions, from 0 to 1.

Definition at line 425 of file SCR_DownloadManager.c.

◆ GetDownloadedSize()

float SCR_DownloadManager::GetDownloadedSize ( )
inlineprotected

Definition at line 539 of file SCR_DownloadManager.c.

◆ GetDownloadQueue()

array< ref SCR_WorkshopItemActionDownload > SCR_DownloadManager::GetDownloadQueue ( )
inlineprotected

Definition at line 138 of file SCR_DownloadManager.c.

◆ GetDownloadQueueSize()

float SCR_DownloadManager::GetDownloadQueueSize ( )
inlineprotected

Definition at line 533 of file SCR_DownloadManager.c.

◆ GetDownloadQueueState()

void SCR_DownloadManager::GetDownloadQueueState ( out int nCompleted,
out int nTotal )
inlineprotected

Might get delayed by a frame! Just use it for UI.

Definition at line 109 of file SCR_DownloadManager.c.

◆ GetDownloadsPaused()

bool SCR_DownloadManager::GetDownloadsPaused ( )
inlineprotected

Definition at line 209 of file SCR_DownloadManager.c.

◆ GetFailedDownloads()

array< ref SCR_WorkshopItemActionDownload > SCR_DownloadManager::GetFailedDownloads ( )
inlineprotected

Definition at line 478 of file SCR_DownloadManager.c.

◆ GetInstance()

SCR_DownloadManager SCR_DownloadManager::GetInstance ( )
inlinestaticprotected

Definition at line 91 of file SCR_DownloadManager.c.

◆ GetItemDownloadActionsProgress()

float SCR_DownloadManager::GetItemDownloadActionsProgress ( SCR_WorkshopItem item)
inlinestaticprotected

Returns overall download progress for all actions of a workshop item.

Definition at line 446 of file SCR_DownloadManager.c.

◆ GetOnAllDownloadsStopped()

ScriptInvokerVoid SCR_DownloadManager::GetOnAllDownloadsStopped ( )
inlineprotected

Definition at line 77 of file SCR_DownloadManager.c.

◆ GetOnDownloadQueueCompleted()

ScriptInvokerVoid SCR_DownloadManager::GetOnDownloadQueueCompleted ( )
inlineprotected

Definition at line 68 of file SCR_DownloadManager.c.

◆ GetOnFullStorageError()

ScriptInvokerBase< ScriptInvoker_ActionDownloadFullStorage > SCR_DownloadManager::GetOnFullStorageError ( )
inlineprotected

Definition at line 59 of file SCR_DownloadManager.c.

◆ GetTotalSizeBytes()

float SCR_DownloadManager::GetTotalSizeBytes ( array< ref SCR_WorkshopItem > arrayIn,
SCR_WorkshopItem extraItem = null )
inlinestaticprotected

Definition at line 392 of file SCR_DownloadManager.c.

◆ GetUnrelatedDownloads()

array< ref SCR_WorkshopItemActionDownload > SCR_DownloadManager::GetUnrelatedDownloads ( array< ref SCR_WorkshopItem > requiredItems)
inlineprotected

Definition at line 229 of file SCR_DownloadManager.c.

◆ HasRunningDownloads()

bool SCR_DownloadManager::HasRunningDownloads ( )
inlineprotected

Definition at line 116 of file SCR_DownloadManager.c.

◆ IsDownloadingActionRequired()

bool SCR_DownloadManager::IsDownloadingActionRequired ( SCR_WorkshopItemActionDownload action,
array< ref SCR_WorkshopItem > requiredItems )
inlineprotected

Definition at line 244 of file SCR_DownloadManager.c.

◆ IsLatestDownloadRequired()

bool SCR_DownloadManager::IsLatestDownloadRequired ( SCR_WorkshopItem item)
inlinestaticprotected

Checks if we need to start a new download of some addon Compared to just checking if it's offline, it is more contextual Because it also checks current download

Definition at line 273 of file SCR_DownloadManager.c.

◆ OnDownloadAddonsReady()

void SCR_DownloadManager::OnDownloadAddonsReady ( SCR_DownloadSequence sequence)
inlineprotected

Definition at line 769 of file SCR_DownloadManager.c.

◆ OnDownloadProgress()

void SCR_DownloadManager::OnDownloadProgress ( SCR_WorkshopItemActionDownload action,
float progressSize )
inlineprotected

Definition at line 663 of file SCR_DownloadManager.c.

◆ PauseAction()

void SCR_DownloadManager::PauseAction ( SCR_WorkshopItemActionDownload action,
bool pause )
inlineprotected

Definition at line 190 of file SCR_DownloadManager.c.

◆ RemoveSameAddonFromDownloads()

void SCR_DownloadManager::RemoveSameAddonFromDownloads ( notnull SCR_WorkshopItem item)
inlineprotected

Remove previous download action if downloaded addon (item) has same ID as parameter item Use to prevent displaying same addon in downloading multiple times

Definition at line 507 of file SCR_DownloadManager.c.

◆ SelectAddonsForLatestDownload()

void SCR_DownloadManager::SelectAddonsForLatestDownload ( array< ref SCR_WorkshopItem > arrayIn,
array< ref SCR_WorkshopItem > arrayOut )
inlinestaticprotected

Definition at line 300 of file SCR_DownloadManager.c.

◆ SetDownloadsPaused()

void SCR_DownloadManager::SetDownloadsPaused ( bool pause,
int count = -1 )
inlineprotected

Paused or resumes all downloads globally Pause/resume of all downloads is called recursivelly to prevent freezing
Count = -1 setup the intial pause and starts late call

Definition at line 170 of file SCR_DownloadManager.c.

Member Data Documentation

◆ DOWNLOAD_STUCK_DELAY

const int SCR_DownloadManager::DOWNLOAD_STUCK_DELAY = 60
protected

Definition at line 22 of file SCR_DownloadManager.c.

◆ ERROR_FULL_STORAGE

const int SCR_DownloadManager::ERROR_FULL_STORAGE = 19
protected

Definition at line 24 of file SCR_DownloadManager.c.

◆ FAIL_TIME

const int SCR_DownloadManager::FAIL_TIME = 500
protected

Definition at line 44 of file SCR_DownloadManager.c.

◆ m_aDownloadActions

ref array<ref SCR_DownloadManager_Entry> SCR_DownloadManager::m_aDownloadActions = new array<ref SCR_DownloadManager_Entry>()
protected

Definition at line 29 of file SCR_DownloadManager.c.

◆ m_aDownloadQueue

ref array<ref SCR_WorkshopItemActionDownload> SCR_DownloadManager::m_aDownloadQueue = new array<ref SCR_WorkshopItemActionDownload>
protected

Definition at line 34 of file SCR_DownloadManager.c.

◆ m_aFailedDownloads

ref array<ref SCR_WorkshopItemActionDownload> SCR_DownloadManager::m_aFailedDownloads = {}
protected

Definition at line 45 of file SCR_DownloadManager.c.

◆ m_bDownloadsPaused

bool SCR_DownloadManager::m_bDownloadsPaused
protected

Definition at line 42 of file SCR_DownloadManager.c.

◆ m_fDownloadedSize

float SCR_DownloadManager::m_fDownloadedSize
protected

Definition at line 39 of file SCR_DownloadManager.c.

◆ m_fDownloadQueueSize

float SCR_DownloadManager::m_fDownloadQueueSize
protected

Definition at line 38 of file SCR_DownloadManager.c.

◆ m_fNoDownloadProgressTimer

float SCR_DownloadManager::m_fNoDownloadProgressTimer = 0
protected

Definition at line 37 of file SCR_DownloadManager.c.

◆ m_iQueueDownloadsCompleted

int SCR_DownloadManager::m_iQueueDownloadsCompleted
protected

Definition at line 35 of file SCR_DownloadManager.c.

◆ m_OnAllDownloadsStopped

ref ScriptInvokerVoid SCR_DownloadManager::m_OnAllDownloadsStopped
protected

Definition at line 56 of file SCR_DownloadManager.c.

◆ m_OnDownloadCanceled

ref ScriptInvokerBase<ScriptInvoker_DownloadManagerAction> SCR_DownloadManager::m_OnDownloadCanceled = new ScriptInvokerBase<ScriptInvoker_DownloadManagerAction>()
protected

Definition at line 54 of file SCR_DownloadManager.c.

◆ m_OnDownloadComplete

ref ScriptInvokerBase<ScriptInvoker_DownloadManagerAction> SCR_DownloadManager::m_OnDownloadComplete = new ScriptInvokerBase<ScriptInvoker_DownloadManagerAction>()
protected

Definition at line 51 of file SCR_DownloadManager.c.

◆ m_OnDownloadFailed

ref ScriptInvokerBase<ScriptInvoker_DownloadManagerActionError> SCR_DownloadManager::m_OnDownloadFailed = new ScriptInvokerBase<ScriptInvoker_DownloadManagerActionError>()
protected

Definition at line 52 of file SCR_DownloadManager.c.

◆ m_OnFullStorageError

ref ScriptInvokerBase<ScriptInvoker_ActionDownloadFullStorage> SCR_DownloadManager::m_OnFullStorageError
protected

Definition at line 53 of file SCR_DownloadManager.c.

◆ m_OnNewDownload

ref ScriptInvoker SCR_DownloadManager::m_OnNewDownload = new ScriptInvoker
protected

Script invoker for new downloads ALways gets called after the new download is registered in the download manager.

Definition at line 49 of file SCR_DownloadManager.c.

◆ s_Instance

SCR_DownloadManager SCR_DownloadManager::s_Instance
staticprotected

Definition at line 26 of file SCR_DownloadManager.c.


The documentation for this class was generated from the following file: