Arma Reforger Script API
|
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_WorkshopItemActionDownload > | GetDownloadQueue () |
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_WorkshopItemActionDownload > | GetUnrelatedDownloads (array< ref SCR_WorkshopItem > requiredItems) |
bool | IsDownloadingActionRequired (SCR_WorkshopItemActionDownload action, array< ref SCR_WorkshopItem > requiredItems) |
array< ref SCR_WorkshopItemAction > | 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. | |
array< ref SCR_WorkshopItemActionDownload > | DownloadItems (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_WorkshopItemActionDownload > | GetFailedDownloads () |
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_Entry > | m_aDownloadActions = new array<ref SCR_DownloadManager_Entry>() |
ref array< ref SCR_WorkshopItemActionDownload > | m_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_WorkshopItemActionDownload > | m_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 |
void SCR_DownloadManager._print | ( | string | str, |
LogLevel | logLevel = LogLevel::DEBUG ) |
void SCR_DownloadManager.AddDownloadManagerEntry | ( | notnull SCR_WorkshopItem | item, |
notnull SCR_WorkshopItemActionDownload | action ) |
|
protected |
|
protected |
Called from aciton when a download is completed.
|
protected |
Call on downloading fail to show download manager dialog with problematic.
|
protected |
Call on full addons storage reached to display storage limit reached error.
|
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.
void SCR_DownloadManager.ClearFailedDownloads | ( | ) |
|
protected |
void SCR_DownloadManager.DownloadAddons | ( | array< ref SCR_WorkshopItem > | items | ) |
Start downloading list of given addons.
void SCR_DownloadManager.DownloadDependecies | ( | array< Dependency > | dependencies | ) |
Start downloading list of dependencies of given revision Mainly used for server browser content download.
SCR_WorkshopItemActionDownload SCR_DownloadManager.DownloadingActionAddonById | ( | string | id, |
bool | runningOnly = true ) |
Return true if there is addon with given id in download queue.
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.
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.
|
protected |
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.
override void SCR_DownloadManager.EOnFrame | ( | IEntity | owner, |
float | timeSlice ) |
override void SCR_DownloadManager.EOnInit | ( | IEntity | owner | ) |
|
protected |
End all running downloads as fail.
SCR_WorkshopItemActionDownload SCR_DownloadManager.GetActionOfItem | ( | SCR_WorkshopItem | item | ) |
Return item action for given workshop item.
void SCR_DownloadManager.GetAllDownloads | ( | array< ref SCR_DownloadManager_Entry > | downloads | ) |
Returns an array of all downloads regardless of their state.
|
static |
Returns overall progress of all download actions, from 0 to 1.
float SCR_DownloadManager.GetDownloadedSize | ( | ) |
array< ref SCR_WorkshopItemActionDownload > SCR_DownloadManager.GetDownloadQueue | ( | ) |
float SCR_DownloadManager.GetDownloadQueueSize | ( | ) |
void SCR_DownloadManager.GetDownloadQueueState | ( | out int | nCompleted, |
out int | nTotal ) |
Might get delayed by a frame! Just use it for UI.
bool SCR_DownloadManager.GetDownloadsPaused | ( | ) |
array< ref SCR_WorkshopItemActionDownload > SCR_DownloadManager.GetFailedDownloads | ( | ) |
|
static |
|
static |
Returns overall download progress for all actions of a workshop item.
ScriptInvokerVoid SCR_DownloadManager.GetOnAllDownloadsStopped | ( | ) |
ScriptInvokerVoid SCR_DownloadManager.GetOnDownloadQueueCompleted | ( | ) |
ScriptInvokerBase< ScriptInvoker_ActionDownloadFullStorage > SCR_DownloadManager.GetOnFullStorageError | ( | ) |
|
static |
array< ref SCR_WorkshopItemActionDownload > SCR_DownloadManager.GetUnrelatedDownloads | ( | array< ref SCR_WorkshopItem > | requiredItems | ) |
bool SCR_DownloadManager.HasRunningDownloads | ( | ) |
bool SCR_DownloadManager.IsDownloadingActionRequired | ( | SCR_WorkshopItemActionDownload | action, |
array< ref SCR_WorkshopItem > | requiredItems ) |
|
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.
|
protected |
|
protected |
|
protected |
|
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.
|
static |
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.
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
ref ScriptInvokerBase<ScriptInvoker_DownloadManagerAction> SCR_DownloadManager.m_OnDownloadCanceled = new ScriptInvokerBase<ScriptInvoker_DownloadManagerAction>() |
ref ScriptInvokerBase<ScriptInvoker_DownloadManagerAction> SCR_DownloadManager.m_OnDownloadComplete = new ScriptInvokerBase<ScriptInvoker_DownloadManagerAction>() |
ref ScriptInvokerBase<ScriptInvoker_DownloadManagerActionError> SCR_DownloadManager.m_OnDownloadFailed = new ScriptInvokerBase<ScriptInvoker_DownloadManagerActionError>() |
|
protected |
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.
|
staticprotected |