43 lines
1.2 KiB
Plaintext
43 lines
1.2 KiB
Plaintext
#include "..\script_component.hpp"
|
|
|
|
/*
|
|
* Function: dragonfly_db_fnc_scheduler
|
|
* Author: Creedcoder, J.Schmidt
|
|
* Edit: 07.15.2024
|
|
*
|
|
* [Description]
|
|
* Parse extension scheduler payload and map task ID to callback.
|
|
*
|
|
* Arguments:
|
|
* 0: Serialized task payload from extension <STRING> (default: "")
|
|
*
|
|
* Return Value:
|
|
* N/A
|
|
*
|
|
* Examples:
|
|
* [(_return select 0)] call dragonfly_db_fnc_scheduler (Server or Singleplayer Only)
|
|
* [(_return select 0)] remoteExecCall ["dragonfly_db_fnc_scheduler", 2, false] (Multiplayer Only)
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
|
|
|
|
private _params = call compile format ["%1", (_this select 0)];
|
|
private _taskID = _params select 0;
|
|
private _function = _params select 1;
|
|
private _array = _taskID splitString "_";
|
|
private _id = _array select 0;
|
|
private _taskType = _array select 1;
|
|
private _addTaskIDToMap = {
|
|
params ["_taskType", "_taskID"];
|
|
|
|
private _varName = format ["dragonfly_db_%1_map", _taskType];
|
|
private _taskMap = missionNamespace getVariable [_varName, createHashMap];
|
|
_taskMap set [_taskID, _function];
|
|
|
|
missionNamespace setVariable [_varName, _taskMap];
|
|
_myHashMap = missionNamespace getVariable [_varName, createHashMap];
|
|
};
|
|
|
|
[_taskType, _taskID] call _addTaskIDToMap;
|