Arma Reforger Script API
Loading...
Searching...
No Matches
SCR_DownloadManager Interface Reference
Inheritance diagram for SCR_DownloadManager:

Public Member Functions

ScriptInvokerBase< ScriptInvoker_ActionDownloadFullStorage > GetOnFullStorageError ()
 
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)
 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.
 
bool GetDownloadsPaused ()
 
void EndAllDownloads ()
 Ends all downloads in a safe manner.
 
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)
 Creates new download actions for downloading latest version of main item and all its dependencies.
 
array< ref SCR_WorkshopItemActionDownloadDownloadItems (array< ref SCR_WorkshopItem > items)
 Start downloading list of scripted workshop items Mainly used for server browser content download.
 
void DownloadDependecies (array< Dependency > dependencies)
 Start downloading list of dependencies of given revision Mainly used for server browser content download.
 
array< ref SCR_WorkshopItemActionDownloadGetFailedDownloads ()
 
void ClearFailedDownloads ()
 
void AddDownloadManagerEntry (notnull SCR_WorkshopItem item, notnull SCR_WorkshopItemActionDownload action)
 
float GetDownloadQueueSize ()
 
float GetDownloadedSize ()
 
override void EOnFrame (IEntity owner, float timeSlice)
 
override void EOnInit (IEntity owner)
 
void DownloadAddons (array< ref SCR_WorkshopItem > items)
 Start downloading list of given addons.
 
void _print (string str, LogLevel logLevel=LogLevel.DEBUG)
 

Static Public Member Functions

static SCR_DownloadManager GetInstance ()
 
static bool IsLatestDownloadRequired (SCR_WorkshopItem item)
 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.
 
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.
 

Public Attributes

ref ScriptInvoker m_OnNewDownload = new ScriptInvoker
 Script invoker for new downloads ALways gets called after the new download is registered in the download manager.
 
ref ScriptInvokerBase< ScriptInvoker_DownloadManagerAction > m_OnDownloadComplete = new ScriptInvokerBase<ScriptInvoker_DownloadManagerAction>()
 
ref ScriptInvokerBase< ScriptInvoker_DownloadManagerActionError > m_OnDownloadFailed = new ScriptInvokerBase<ScriptInvoker_DownloadManagerActionError>()
 
ref ScriptInvokerBase< ScriptInvoker_DownloadManagerAction > m_OnDownloadCanceled = new ScriptInvokerBase<ScriptInvoker_DownloadManagerAction>()
 

Protected Member Functions

void PauseAction (SCR_WorkshopItemActionDownload action, bool pause)
 
float DownloadQueueSize ()
 
void RemoveSameAddonFromDownloads (notnull SCR_WorkshopItem item)
 Remove previous download action if downloaded addon (item) has same ID as parameter item Use to prevent displaying same addon in downloading multiple times.
 
void Callback_OnNewDownload (SCR_WorkshopItem item, SCR_WorkshopItemActionDownload action)
 Gets called when a new download action is created.
 
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 OnDownloadAddonsReady (SCR_DownloadSequence sequence)
 
void ClearUnfinishedAction (SCR_WorkshopItemActionDownload action)
 

Protected Attributes

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
 
ref array< ref SCR_WorkshopItemActionDownloadm_aFailedDownloads = {}
 
ref ScriptInvokerBase< ScriptInvoker_ActionDownloadFullStorage > m_OnFullStorageError
 
ref ScriptInvokerVoid m_OnDownloadQueueCompleted ref ScriptInvokerVoid m_OnAllDownloadsStopped
 

Static Protected Attributes

const int DOWNLOAD_STUCK_DELAY = 60
 
const int ERROR_FULL_STORAGE = 19
 
static SCR_DownloadManager s_Instance
 
const int FAIL_TIME = 500
 

Member Function Documentation

◆ _print()

void SCR_DownloadManager._print ( string str,
LogLevel logLevel = LogLevel::DEBUG )

◆ AddDownloadManagerEntry()

void SCR_DownloadManager.AddDownloadManagerEntry ( notnull SCR_WorkshopItem item,
notnull SCR_WorkshopItemActionDownload action )

◆ Callback_OnCanceled()

void SCR_DownloadManager.Callback_OnCanceled ( SCR_WorkshopItemActionDownload action)
protected

◆ Callback_OnDownloadCompleted()

void SCR_DownloadManager.Callback_OnDownloadCompleted ( SCR_WorkshopItemActionDownload action)
protected

Called from aciton when a download is completed.

◆ Callback_OnFailed()

void SCR_DownloadManager.Callback_OnFailed ( SCR_WorkshopItemActionDownload action,
int reason )
protected

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

◆ Callback_OnFullStorageError()

void SCR_DownloadManager.Callback_OnFullStorageError ( SCR_WorkshopItemActionDownload action,
float size )
protected

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

◆ Callback_OnNewDownload()

void SCR_DownloadManager.Callback_OnNewDownload ( SCR_WorkshopItem item,
SCR_WorkshopItemActionDownload action )
protected

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.

◆ ClearFailedDownloads()

void SCR_DownloadManager.ClearFailedDownloads ( )

◆ ClearUnfinishedAction()

void SCR_DownloadManager.ClearUnfinishedAction ( SCR_WorkshopItemActionDownload action)
protected

◆ DownloadAddons()

void SCR_DownloadManager.DownloadAddons ( array< ref SCR_WorkshopItem > items)

Start downloading list of given addons.

◆ DownloadDependecies()

void SCR_DownloadManager.DownloadDependecies ( array< Dependency > dependencies)

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

◆ DownloadingActionAddonById()

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

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

◆ DownloadItems()

array< ref SCR_WorkshopItemActionDownload > SCR_DownloadManager.DownloadItems ( array< ref SCR_WorkshopItem > items)

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

◆ DownloadLatestWithDependencies()

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

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.

◆ DownloadQueueSize()

float SCR_DownloadManager.DownloadQueueSize ( )
protected

◆ EndAllDownloads()

void SCR_DownloadManager.EndAllDownloads ( )

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.

◆ EOnFrame()

override void SCR_DownloadManager.EOnFrame ( IEntity owner,
float timeSlice )

◆ EOnInit()

override void SCR_DownloadManager.EOnInit ( IEntity owner)

◆ ForceFailRunningDownloads()

void SCR_DownloadManager.ForceFailRunningDownloads ( )
protected

End all running downloads as fail.

◆ GetActionOfItem()

SCR_WorkshopItemActionDownload SCR_DownloadManager.GetActionOfItem ( SCR_WorkshopItem item)

Return item action for given workshop item.

◆ GetAllDownloads()

void SCR_DownloadManager.GetAllDownloads ( array< ref SCR_DownloadManager_Entry > downloads)

Returns an array of all downloads regardless of their state.

◆ GetDownloadActionsProgress()

static float SCR_DownloadManager.GetDownloadActionsProgress ( array< ref SCR_WorkshopItemActionDownload > actions)
static

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

◆ GetDownloadedSize()

float SCR_DownloadManager.GetDownloadedSize ( )

◆ GetDownloadQueue()

array< ref SCR_WorkshopItemActionDownload > SCR_DownloadManager.GetDownloadQueue ( )

◆ GetDownloadQueueSize()

float SCR_DownloadManager.GetDownloadQueueSize ( )

◆ GetDownloadQueueState()

void SCR_DownloadManager.GetDownloadQueueState ( out int nCompleted,
out int nTotal )

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

◆ GetDownloadsPaused()

bool SCR_DownloadManager.GetDownloadsPaused ( )

◆ GetFailedDownloads()

array< ref SCR_WorkshopItemActionDownload > SCR_DownloadManager.GetFailedDownloads ( )

◆ GetInstance()

static SCR_DownloadManager SCR_DownloadManager.GetInstance ( )
static

◆ GetItemDownloadActionsProgress()

static float SCR_DownloadManager.GetItemDownloadActionsProgress ( SCR_WorkshopItem item)
static

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

◆ GetOnAllDownloadsStopped()

ScriptInvokerVoid SCR_DownloadManager.GetOnAllDownloadsStopped ( )

◆ GetOnDownloadQueueCompleted()

ScriptInvokerVoid SCR_DownloadManager.GetOnDownloadQueueCompleted ( )

◆ GetOnFullStorageError()

ScriptInvokerBase< ScriptInvoker_ActionDownloadFullStorage > SCR_DownloadManager.GetOnFullStorageError ( )

◆ GetTotalSizeBytes()

static float SCR_DownloadManager.GetTotalSizeBytes ( array< ref SCR_WorkshopItem > arrayIn,
SCR_WorkshopItem extraItem = null )
static

◆ GetUnrelatedDownloads()

array< ref SCR_WorkshopItemActionDownload > SCR_DownloadManager.GetUnrelatedDownloads ( array< ref SCR_WorkshopItem > requiredItems)

◆ HasRunningDownloads()

bool SCR_DownloadManager.HasRunningDownloads ( )

◆ IsDownloadingActionRequired()

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

◆ IsLatestDownloadRequired()

static bool SCR_DownloadManager.IsLatestDownloadRequired ( SCR_WorkshopItem item)
static

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.

◆ OnDownloadAddonsReady()

void SCR_DownloadManager.OnDownloadAddonsReady ( SCR_DownloadSequence sequence)
protected

◆ OnDownloadProgress()

void SCR_DownloadManager.OnDownloadProgress ( SCR_WorkshopItemActionDownload action,
float progressSize )
protected

◆ PauseAction()

void SCR_DownloadManager.PauseAction ( SCR_WorkshopItemActionDownload action,
bool pause )
protected

◆ RemoveSameAddonFromDownloads()

void SCR_DownloadManager.RemoveSameAddonFromDownloads ( notnull SCR_WorkshopItem item)
protected

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

◆ SelectAddonsForLatestDownload()

static void SCR_DownloadManager.SelectAddonsForLatestDownload ( array< ref SCR_WorkshopItem > arrayIn,
array< ref SCR_WorkshopItem > arrayOut )
static

◆ SetDownloadsPaused()

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

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.

Member Data Documentation

◆ DOWNLOAD_STUCK_DELAY

const int SCR_DownloadManager.DOWNLOAD_STUCK_DELAY = 60
staticprotected

◆ ERROR_FULL_STORAGE

const int SCR_DownloadManager.ERROR_FULL_STORAGE = 19
staticprotected

◆ FAIL_TIME

const int SCR_DownloadManager.FAIL_TIME = 500
staticprotected

◆ m_aDownloadActions

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

◆ m_aDownloadQueue

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

◆ m_aFailedDownloads

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

◆ m_bDownloadsPaused

bool SCR_DownloadManager.m_bDownloadsPaused
protected

◆ m_fDownloadedSize

float SCR_DownloadManager.m_fDownloadedSize
protected

◆ m_fDownloadQueueSize

float SCR_DownloadManager.m_fDownloadQueueSize
protected

◆ m_fNoDownloadProgressTimer

float SCR_DownloadManager.m_fNoDownloadProgressTimer = 0
protected

◆ m_iQueueDownloadsCompleted

int SCR_DownloadManager.m_iQueueDownloadsCompleted
protected

◆ m_OnAllDownloadsStopped

ref ScriptInvokerVoid m_OnDownloadQueueCompleted ref ScriptInvokerVoid SCR_DownloadManager.m_OnAllDownloadsStopped
protected

◆ m_OnDownloadCanceled

ref ScriptInvokerBase<ScriptInvoker_DownloadManagerAction> SCR_DownloadManager.m_OnDownloadCanceled = new ScriptInvokerBase<ScriptInvoker_DownloadManagerAction>()

◆ m_OnDownloadComplete

ref ScriptInvokerBase<ScriptInvoker_DownloadManagerAction> SCR_DownloadManager.m_OnDownloadComplete = new ScriptInvokerBase<ScriptInvoker_DownloadManagerAction>()

◆ m_OnDownloadFailed

ref ScriptInvokerBase<ScriptInvoker_DownloadManagerActionError> SCR_DownloadManager.m_OnDownloadFailed = new ScriptInvokerBase<ScriptInvoker_DownloadManagerActionError>()

◆ m_OnFullStorageError

ref ScriptInvokerBase<ScriptInvoker_ActionDownloadFullStorage> SCR_DownloadManager.m_OnFullStorageError
protected

◆ m_OnNewDownload

ref ScriptInvoker SCR_DownloadManager.m_OnNewDownload = new ScriptInvoker

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

◆ s_Instance

SCR_DownloadManager SCR_DownloadManager.s_Instance
staticprotected

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