Update db function headers and payload size docs

This commit is contained in:
Jacob Schmidt 2026-01-13 20:19:07 -06:00
parent 78be3d36f8
commit ea78960fa9
37 changed files with 177 additions and 520 deletions

View File

@ -4,25 +4,18 @@
* Function: dragonfly_db_fnc_addTask
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Add task to queue.
* Queue a DB task and start the processor if idle.
*
* Arguments:
* 0: Type of task <STRING>
* 0: Task type <STRING>
* 1: Name of stored key <STRING> (default: "")
* 2: Name of stored hash key field <STRING> (default: "")
* 3: Index of stored value in list <STRING> (default: -1)
* 3: Index of stored value in list <NUMBER> (default: -1)
* 4: Value to store in key [<ARRAY|STRING|NUMBER|BOOL>] (default: [])
* 5: Name of function to return data <STRING> (default: "")
* 6: Unscheduled environment <BOOL> (default: false)
* 6: Use call instead of spawn <BOOL> (default: false)
* 7: NetID of target to return data from function <STRING> (default: "")
*
* Return Value:
@ -35,6 +28,7 @@
* Public: Yes
*/
params [["_taskType", "", [""]], ["_key", "", [""]], ["_keyField", "", [""]], ["_index", -1, [0]], ["_value", [], [[]]], ["_function", "", [""]], ["_call", false, [false]], ["_netId", "", [""]]];
private _task = [_taskType, _key, _keyField, _index, _value, _function, _call, _netId];
@ -50,4 +44,4 @@ GVAR(taskQueue) pushBack _task;
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_addTask' Queue Size: %1", count GVAR(taskQueue)];
#endif
if !(GVAR(isProcessing)) then { [] spawn FUNC(processQueue); };
if !(GVAR(isProcessing)) then { [] spawn FUNC(processQueue); };

View File

@ -4,13 +4,6 @@
* Function: dragonfly_db_fnc_delete
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Delete stored key from DB.
@ -28,6 +21,7 @@
* Public: Yes
*/
params [["_key", "", [""]]];
#ifdef __A3__DEBUG__
@ -38,4 +32,4 @@ if (_key == "") exitWith {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_delete' Invalid Input for Key '%1'", _key];
};
"ArmaDragonflyClient" callExtension ["del", [_key]];
"ArmaDragonflyClient" callExtension ["del", [_key]];

View File

@ -1,24 +1,31 @@
#include "..\script_component.hpp"
/*
@file Title: ArmaDragonflyClient Framework by Creedcoder, J.Schmidt
@file Version: 0.1
@file Name: fnc_fetch.sqf
@file Author: Creedcoder, J.Schmidt
@file edit: 03.25.2024
Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
* Function: dragonfly_db_fnc_fetch
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
*
* [Description]
* Receives DB response chunks, rebuilds the payload, and forwards it to the handler when complete.
*
* Arguments:
* 0: Unique request ID <STRING>
* 1: Function name to execute <STRING>
* 2: Chunk index <NUMBER>
* 3: Total chunk count <NUMBER>
* 4: Chunk data <STRING>
* 5: Callback identifier or code <STRING/CODE>
* 6: Network ID <STRING>
*
* Return Value:
* N/A
*
* Examples:
* Called by the DB extension; not intended for direct use.
*
* Public: Yes
*/
Do not edit without permission!
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlikes 4.0 International License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/ or send a letter to Creative Commons,
444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
Fetch from DB:
dragonfly_db_fetch_array
["uniqueID", "function", "index", "indextotal", "datachunk", "call", "netId"]
*/
#ifdef __A3__DEBUG__
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_fetch' Input: %1", _this];
@ -55,4 +62,4 @@ if (_count_total == _total) then {
[_uniqueID, _function, _call, (parseSimpleArray _dataString), _netId] call FUNC(handler);
dragonfly_db_fetch_array = dragonfly_db_fetch_array select {!((_x select 0) in [_uniqueID])};
};
};

View File

@ -4,13 +4,6 @@
* Function: dragonfly_db_fnc_get
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Get value of stored key from DB.
@ -18,8 +11,8 @@
* Arguments:
* 0: Name of stored key <STRING> (default: "")
* 1: Name of function to return data <STRING> (default: "")
* 2: Unscheduled environment <BOOL> (default: false)
* 3: NetID of target to return data from function <STRING> (default: "")
* 2: Use call instead of spawn <BOOL> (default: false)
* 3: NetID of target to return data to <STRING> (default: "")
*
* Return Value:
* N/A
@ -31,6 +24,7 @@
* Public: Yes
*/
params [["_key", "", [""]], ["_function", "", [""]], ["_call", false, [false]], ["_netId", "", [""]]];
#ifdef __A3__DEBUG__
@ -65,4 +59,4 @@ if (_netId != "") then {
};
};
[(_return select 0)] call FUNC(scheduler);
[(_return select 0)] call FUNC(scheduler);

View File

@ -4,26 +4,19 @@
* Function: dragonfly_db_fnc_handler
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Handle data from DB.
* Dispatch DB data to a callback locally or via remoteExec.
*
* Arguments:
* 0: UniqueID for data chunk <STRING> (default: "")
* 0: Unique request ID <STRING> (default: "")
* 1: Name of function to return data <STRING> (default: "")
* 2: Unscheduled environment <BOOL> (default: false)
* 2: Use call instead of spawn <BOOL> (default: false)
* 3: Data from key [<ARRAY|STRING|NUMBER|BOOL>] (default: [])
* 4: NetID of target to return data to from function <STRING> (default: nil)
* 4: NetID of target to return data to <STRING> (default: "")
*
* Return Value:
* [uniqueID, function, call, data, object] <ARRAY>
* N/A
*
* Examples:
* ["0123456789", "dragonfly_db_fnc_test", false, ["Hello World!"]] call dragonfly_db_fnc_handler (Server or Singleplayer Only)
@ -32,13 +25,14 @@
* Public: Yes
*/
params [["_uniqueID", "", [""]], ["_function", "", [""]], ["_call", false, [false]], ["_data", [], [[]]], ["_netId", "", [""]]];
#ifdef __A3__DEBUG__
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_handler' UniqueID: '%1', Function: '%2', Call: '%3', Data: '%4', NetId: '%5'", _uniqueID, _function, _call, _data, _netId];
#endif
if (_function == "" || count _data == 0) exitWith {
if (_function == "" || _data isEqualTo []) exitWith {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_handler' Invalid Input for Function '%1' or Data '%2'", _function, _data];
};
@ -74,4 +68,4 @@ if (_netId != "") then {
} else {
_data spawn _func;
};
};
};

View File

@ -4,16 +4,9 @@
* Function: dragonfly_db_fnc_hashDelete
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Delete field in hash stored at key from DB.
* Delete a field from the default hash (no explicit key).
*
* Arguments:
* 0: Name of stored field in hash <STRING> (default: "")
@ -28,6 +21,7 @@
* Public: Yes
*/
params [["_keyField", "", [""]]];
#ifdef __A3__DEBUG__
@ -38,4 +32,4 @@ if (_keyField == "") exitWith {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_hashDelete' Invalid Input for KeyField '%1'", _keyField];
};
"ArmaDragonflyClient" callExtension ["hdel", [_keyField]];
"ArmaDragonflyClient" callExtension ["hdel", [_keyField]];

View File

@ -4,20 +4,13 @@
* Function: dragonfly_db_fnc_hashDeleteId
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Delete field in hash stored at key from DB.
*
* Arguments:
* 0: Key <STRING> (default: "")
* 1: Key Field <STRING> (default: "")
* 1: Key field <STRING> (default: "")
*
* Return Value:
* N/A
@ -29,6 +22,7 @@
* Public: Yes
*/
params [["_key", "", [""]], ["_keyField", "", [""]]];
#ifdef __A3__DEBUG__
@ -39,4 +33,4 @@ if (_key == "" || _keyField == "") exitWith {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_hashDeleteId' Invalid Input for Key '%1' or KeyField '%2'", _key, _keyField];
};
"ArmaDragonflyClient" callExtension ["hdelid", [_key, _keyField]];
"ArmaDragonflyClient" callExtension ["hdelid", [_key, _keyField]];

View File

@ -4,22 +4,15 @@
* Function: dragonfly_db_fnc_hashGet
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Get value of field in hash stored in key from DB.
* Get value of field in the default hash and return it via callback.
*
* Arguments:
* 0: Name of stored field in hash <STRING> (default: "")
* 1: Name of function to return data <STRING> (default: "")
* 2: Unscheduled environment <BOOL> (default: false)
* 3: NetID of target to return data from function <STRING> (default: nil)
* 2: Use call instead of spawn <BOOL> (default: false)
* 3: NetID of target to return data to <STRING> (default: "")
*
* Return Value:
* N/A
@ -31,6 +24,7 @@
* Public: Yes
*/
params [["_keyField", "", [""]], ["_function", "", [""]], ["_call", false, [false]], ["_netId", "", [""]]];
#ifdef __A3__DEBUG__
@ -69,4 +63,4 @@ if (_netId != "") then {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_hashGet' Return: '%1'", _return];
#endif
[(_return select 0)] call FUNC(scheduler);
[(_return select 0)] call FUNC(scheduler);

View File

@ -4,21 +4,14 @@
* Function: dragonfly_db_fnc_hashGetAll
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Get all fields and values of hash stored in key from DB.
* Get all fields and values from the default hash and return them via callback.
*
* Arguments:
* 0: Name of function to return data <STRING> (default: "")
* 1: Unscheduled environment <BOOL> (default: false)
* 2: NetID of target to return data from function <STRING> (default: nil)
* 1: Use call instead of spawn <BOOL> (default: false)
* 2: NetID of target to return data to <STRING> (default: "")
*
* Return Value:
* N/A
@ -30,6 +23,7 @@
* Public: Yes
*/
params [["_function", "", [""]], ["_call", false, [false]], ["_netId", "", [""]]];
#ifdef __A3__DEBUG__
@ -68,4 +62,4 @@ if (_netId != "") then {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_hashGetAll' Return: '%1'", _return];
#endif
[(_return select 0)] call FUNC(scheduler);
[(_return select 0)] call FUNC(scheduler);

View File

@ -4,22 +4,15 @@
* Function: dragonfly_db_fnc_hashGetAllId
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Get all fields and values of hash stored in key from DB.
* Get all fields and values of hash stored at key from DB.
*
* Arguments:
* 0: Name of stored key with hash <STRING> (default: "")
* 1: Name of function to return data <STRING> (default: "")
* 2: Unscheduled environment <BOOL> (default: false)
* 3: NetID of target to return data from function <STRING> (default: nil)
* 2: Use call instead of spawn <BOOL> (default: false)
* 3: NetID of target to return data to <STRING> (default: "")
*
* Return Value:
* N/A
@ -31,6 +24,7 @@
* Public: Yes
*/
params [["_key", "", [""]], ["_function", "", [""]], ["_call", false, [false]], ["_netId", "", [""]]];
#ifdef __A3__DEBUG__
@ -69,4 +63,4 @@ if (_netId != "") then {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_hashGetAllId' Return: '%1'", _return];
#endif
[(_return select 0)] call FUNC(scheduler);
[(_return select 0)] call FUNC(scheduler);

View File

@ -4,13 +4,6 @@
* Function: dragonfly_db_fnc_hashGetId
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Get value of field in hash stored at key from DB.
@ -19,8 +12,8 @@
* 0: Name of stored key with hash <STRING> (default: "")
* 1: Name of stored field in hash <STRING> (default: "")
* 2: Name of function to return data <STRING> (default: "")
* 3: Unscheduled environment <BOOL> (default: false)
* 4: NetID of target to return data from function <STRING> (default: nil)
* 3: Use call instead of spawn <BOOL> (default: false)
* 4: NetID of target to return data to <STRING> (default: "")
*
* Return Value:
* N/A
@ -32,6 +25,7 @@
* Public: Yes
*/
params [["_key", "", [""]], ["_keyField", "", [""]], ["_function", "", [""]], ["_call", false, [false]], ["_netId", "", [""]]];
#ifdef __A3__DEBUG__
@ -70,4 +64,4 @@ if (_netId != "") then {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_hashGetId' Return: '%1'", _return];
#endif
[(_return select 0)] call FUNC(scheduler);
[(_return select 0)] call FUNC(scheduler);

View File

@ -4,16 +4,9 @@
* Function: dragonfly_db_fnc_hashSet
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Set value of field in hash stored at key from DB.
* Set value of field in the default hash (no explicit key).
*
* Arguments:
* 0: Name of stored field in hash <STRING> (default: "")
@ -29,14 +22,15 @@
* Public: Yes
*/
params [["_keyField", "", [""]], ["_data", [], [[]]]];
#ifdef __A3__DEBUG__
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_hashSet' KeyField: '%1', Data: '%2'", _keyField, _data];
#endif
if (_keyField == "" || count _data == 0) exitWith {
if (_keyField == "" || _data isEqualTo []) exitWith {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_hashSet' Invalid Input for KeyField '%1' or Data '%2'", _keyField, _data];
};
"ArmaDragonflyClient" callExtension ["hset", [_keyField, _data]];
"ArmaDragonflyClient" callExtension ["hset", [_keyField, _data]];

View File

@ -4,19 +4,12 @@
* Function: dragonfly_db_fnc_hashSetBulk
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Set fields and values in hash stored at key from DB.
* Set multiple field/value pairs in the default hash (no explicit key).
*
* Arguments:
* 0: Fields and Values to store in hash [<ARRAY|STRING|NUMBER|BOOL>] (default: [])
* 0: Fields and values to store in hash <ARRAY> (default: [])
*
* Return Value:
* N/A
@ -28,14 +21,15 @@
* Public: Yes
*/
params [["_data", [], [[]]]];
#ifdef __A3__DEBUG__
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_hashSetBulk' Data: %1", _data];
#endif
if (count _data == 0) exitWith {
if (_data isEqualTo []) exitWith {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_hashSetBulk' Invalid Input for Data '%1'", _data];
};
"ArmaDragonflyClient" callExtension ["hset", _data];
"ArmaDragonflyClient" callExtension ["hset", _data];

View File

@ -4,13 +4,6 @@
* Function: dragonfly_db_fnc_hashSetId
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Set value of field in hash stored at key from DB.
@ -30,14 +23,15 @@
* Public: Yes
*/
params [["_key", "", [""]], ["_keyField", "", [""]], ["_data", [], [[]]]];
#ifdef __A3__DEBUG__
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_hashSetId' Key: '%1', KeyField: '%2', Data: '%3'", _key, _keyField, _data];
#endif
if (_key == "" || _keyField == "" || count _data == 0) exitWith {
if (_key == "" || _keyField == "" || _data isEqualTo []) exitWith {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_hashSetId' Invalid Input for Key '%1', KeyField '%2' or Data '%3'", _key, _keyField, _data];
};
"ArmaDragonflyClient" callExtension ["hsetid", [_key, _keyField, _data]];
"ArmaDragonflyClient" callExtension ["hsetid", [_key, _keyField, _data]];

View File

@ -4,19 +4,12 @@
* Function: dragonfly_db_fnc_hashSetIdBulk
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Set fields and values in hash stored at key from DB.
* Set multiple field/value pairs in hash stored at key from DB.
*
* Arguments:
* 0: Fields and Values to store in hash [<ARRAY|STRING|NUMBER|BOOL>] (default: [])
* 0: Key followed by fields and values to store in hash <ARRAY> (default: [])
*
* Return Value:
* N/A
@ -28,14 +21,15 @@
* Public: Yes
*/
params [["_data", [], [[]]]];
#ifdef __A3__DEBUG__
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_hashSetIdBulk' Data: %1", _data];
#endif
if (count _data == 0) exitWith {
if (_data isEqualTo []) exitWith {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_hashSetIdBulk' Invalid Input for Data '%1'", _data];
};
"ArmaDragonflyClient" callExtension ["hsetid", _data];
"ArmaDragonflyClient" callExtension ["hsetid", _data];

View File

@ -4,16 +4,9 @@
* Function: dragonfly_db_fnc_init
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Initial Extension settings.
* Initialize extension settings and log version info.
*
* Arguments:
* N/A
@ -27,11 +20,12 @@
* Public: Yes
*/
dragonfly_db_buffer = 10240;
dragonfly_db_buffer = 20480;
private _dll = "ArmaDragonflyClient" callExtension ["version", []];
diag_log text (format ["ArmaDragonflyClient: DLL Version %1 found", _dll]);
diag_log text "ArmaDragonflyClient: Functions loaded and Initializtion completed!";
diag_log text (format ["ArmaDragonflyClient: Buffer size set to %1 Bytes", dragonfly_db_buffer]);
diag_log text "ArmaDragonflyClient: Ready for use!";
diag_log text "ArmaDragonflyClient: Ready for use!";

View File

@ -4,13 +4,6 @@
* Function: dragonfly_db_fnc_listAdd
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Add element to list stored at key from DB.
@ -29,14 +22,15 @@
* Public: Yes
*/
params [["_key", "", [""]], ["_data", [], [[]]]];
#ifdef __A3__DEBUG__
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_listAdd' Key: '%1', Data: '%2'", _key, _data];
#endif
if (_key == "" || count _data == 0) exitWith {
if (_key == "" || _data isEqualTo []) exitWith {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_listAdd' Invalid Input for Key '%1' or Data '%2'", _key, _data];
};
"ArmaDragonflyClient" callExtension ["listadd", [_key, _data]];
"ArmaDragonflyClient" callExtension ["listadd", [_key, _data]];

View File

@ -4,13 +4,6 @@
* Function: dragonfly_db_fnc_listGet
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Get element of list stored at key from DB.
@ -19,8 +12,8 @@
* 0: Name of stored key <STRING> (default: "")
* 1: Index of stored value in list <NUMBER> (default: -1)
* 2: Name of function to return data <STRING> (default: "")
* 3: Unscheduled environment <BOOL> (default: false)
* 4: NetID of target to return data from function <STRING> (default: nil)
* 3: Use call instead of spawn <BOOL> (default: false)
* 4: NetID of target to return data to <STRING> (default: "")
*
* Return Value:
* N/A
@ -32,6 +25,7 @@
* Public: Yes
*/
params [["_key", "", [""]], ["_index", -1, [0]], ["_function", "", [""]], ["_call", false, [false]], ["_netId", "", [""]]];
#ifdef __A3__DEBUG__
@ -70,4 +64,4 @@ if (_netId != "") then {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_listGet' Return: '%1'", _return];
#endif
[(_return select 0)] call FUNC(scheduler);
[(_return select 0)] call FUNC(scheduler);

View File

@ -4,13 +4,6 @@
* Function: dragonfly_db_fnc_listLoad
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Get all elements of list stored at key from DB.
@ -18,8 +11,8 @@
* Arguments:
* 0: Name of stored key <STRING> (default: "")
* 1: Name of function to return data <STRING> (default: "")
* 2: Unscheduled environment <BOOL> (default: false)
* 3: NetID of target to return data from function <STRING> (default: nil)
* 2: Use call instead of spawn <BOOL> (default: false)
* 3: NetID of target to return data to <STRING> (default: "")
*
* Return Value:
* N/A
@ -31,6 +24,7 @@
* Public: Yes
*/
params [["_key", "", [""]], ["_function", "", [""]], ["_call", false, [false]], ["_netId", "", [""]]];
#ifdef __A3__DEBUG__
@ -69,4 +63,4 @@ if (_netId != "") then {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_listLoad' Return: '%1'", _return];
#endif
[(_return select 0)] call FUNC(scheduler);
[(_return select 0)] call FUNC(scheduler);

View File

@ -4,13 +4,6 @@
* Function: dragonfly_db_fnc_listRemove
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Remove element of list stored at key from DB.
@ -29,6 +22,7 @@
* Public: Yes
*/
params [["_key", "", [""]], ["_index", -1, [0]]];
#ifdef __A3__DEBUG__
@ -39,4 +33,4 @@ if (_key == "") exitWith {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_listRemove' Invalid Input for Key '%1'", _key];
};
"ArmaDragonflyClient" callExtension ["listrem", [_key, _index]];
"ArmaDragonflyClient" callExtension ["listrem", [_key, _index]];

View File

@ -4,13 +4,6 @@
* Function: dragonfly_db_fnc_listSet
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Set element of list stored at key from DB.
@ -30,14 +23,15 @@
* Public: Yes
*/
params [["_key", "", [""]], ["_index", -1, [0]], ["_data", [], [[]]]];
#ifdef __A3__DEBUG__
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_listSet' Key: '%1', Index: '%2', Data: '%3'", _key, _index, _data];
#endif
if (_key == "" || count _data == 0) exitWith {
if (_key == "" || _data isEqualTo []) exitWith {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_listSet' Invalid Input for Key '%1' or Data '%2'", _key, _data];
};
"ArmaDragonflyClient" callExtension ["listset", [_key, _index, _data]];
"ArmaDragonflyClient" callExtension ["listset", [_key, _index, _data]];

View File

@ -1,3 +1,25 @@
#include "..\script_component.hpp"
systemChat format ["Thank you for using the %1", 'ADDON'];
/*
* Function: dragonfly_db_fnc_printAddonName
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
*
* [Description]
* Print a system chat message with the addon name.
*
* Arguments:
* N/A
*
* Return Value:
* N/A
*
* Examples:
* [] call dragonfly_db_fnc_printAddonName (Server or Singleplayer Only)
* [] remoteExecCall ["dragonfly_db_fnc_printAddonName", 2, false] (Multiplayer Only)
*
* Public: Yes
*/
systemChat format ["Thank you for using the %1", 'ADDON'];

View File

@ -4,16 +4,9 @@
* Function: dragonfly_db_fnc_processQueue
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Process queue of tasks.
* Process queued DB tasks sequentially.
*
* Arguments:
* N/A
@ -28,6 +21,7 @@
* Public: Yes
*/
GVAR(isProcessing) = true;
while { count GVAR(taskQueue) > 0} do {
@ -178,4 +172,4 @@ while { count GVAR(taskQueue) > 0} do {
};
GVAR(isProcessing) = false;
GVAR(isProcessing) = false;

View File

@ -1,58 +0,0 @@
#include "..\script_component.hpp"
/*
@file Title: ArmaDragonflyClient Framework by Creedcoder, J.Schmidt
@file Version: 0.1
@file Name: fnc_pubSubFetch.sqf
@file Author: Creedcoder, J.Schmidt
@file edit: 03.25.2024
Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
Do not edit without permission!
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlikes 4.0 International License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/ or send a letter to Creative Commons,
444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
Fetch from DB:
dragonfly_db_pubSubFetch_array
["uniqueID", "evetnType", "eventName", "index", "indextotal", "datachunk", "target"]
*/
#ifdef __A3__DEBUG__
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_pubSubFetch' Data: %1", _this];
#endif
params ["_uniqueID", "_eventType", "_eventName", "_index", "_total", "_datachunk", "_target"];
private _dataString = "";
private _index_array = [];
private _count_total = -1;
dragonfly_db_pubSubFetch_array pushBackUnique [_uniqueID, _eventType, _eventName, _index, _total, _datachunk, _target];
_count_total = {
if (_uniqueID == _x select 0) then {
_index_array pushBackUnique [_x select 3, _x select 5];
true
} else {
false
}
} count dragonfly_db_pubSubFetch_array;
if (_count_total == _total) then {
_index_array sort true;
for "_i" from 0 to (_total - 1) do {
_dataString = _dataString + ((_index_array select _i) select 1);
};
#ifdef __ARMA_DEBUG__
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_pubSubFetch' Data String: %1", _dataString];
#endif
[_uniqueID, _eventType, _eventName, (parseSimpleArray _dataString), _target] call FUNC(pubSubHandler);
dragonfly_db_pubSubFetch_array = dragonfly_db_pubSubFetch_array select {!((_x select 0) in [_uniqueID])};
};

View File

@ -1,55 +0,0 @@
#include "..\script_component.hpp"
/*
* Function: dragonfly_db_fnc_pubSubHandler
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Handles pub/sub messages and routes them through the CBA event system based on event type.
*
* Arguments:
* 0: UniqueID for message tracking <STRING> (default: "")
* 1: Event type (global, local, server, remote) <STRING> (default: "")
* 2: Event name for CBA event system <STRING> (default: "")
* 3: Message data [<ARRAY|STRING|NUMBER|BOOL>] (default: [])
* 4: Target NetID for remote events <STRING> (default: "")
*
* Return Value:
* None
*
* Examples:
* ["123", "global", "myEvent", ["Hello"], ""] call dragonfly_db_fnc_pubSubHandler
* ["456", "remote", "playerEvent", ["Update"], "2:3"] call dragonfly_db_fnc_pubSubHandler
*
* Public: Yes
*/
params [["_uniqueID", "", [""]], ["_eventType", "", [""]], ["_eventName", "", [""]], ["_data", [], [[]]], ["_target", "", [""]]];
#ifdef __A3__DEBUG__
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_pubSubHandler' Data: %1", _this];
#endif
switch (_eventType) do {
case "global": {
[_eventName, _data] call CFUNC(globalEvent);
};
case "local": {
[_eventName, _data] call CFUNC(localEvent);
};
case "server": {
[_eventName, _data] call CFUNC(serverEvent);
};
case "remote": {
private _targetObj = objectFromNetId _target;
[_eventName, _data, _targetObj] call CFUNC(remoteEvent);
};
};

View File

@ -1,53 +0,0 @@
#include "..\script_component.hpp"
/*
* Function: dragonfly_db_fnc_publish
* Author: Creedcoder, J. Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J. Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Publish a message to a DragonflyDB channel.
* The message will be routed through the CBA event system based on the subscription event type.
*
* Arguments:
* 0: STRING - Channel name to publish to (default: "")
* 1: ARRAY|STRING|NUMBER|BOOL - Data to publish (default: [])
*
* Return Value:
* BOOLEAN - True if successful, false otherwise
*
* Examples:
* ["global_chat", "Hello world!"] call dragonfly_db_fnc_publish
* ["mission_updates", ["task_01", "SUCCEEDED", [2, 3, 4]]] call dragonfly_db_fnc_publish
*
* Public: Yes
*/
params [["_channel", "", [""]], ["_message", [], [[], "", 0, true]]];
#ifdef __A3__DEBUG__
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_publish' Channel: '%1', Message: '%2'", _channel, _message];
#endif
if (_channel isEqualTo "") exitWith {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_publish' Invalid Input for Channel '%1'", _channel];
false
};
private _args = [_channel, _message];
private _formattedArgs = _args apply { if (_x isEqualType "") then { str _x } else { _x } };
private _extensionArgs = _formattedArgs joinString ",";
private _result = "ArmaDragonflyClient" callExtension ["publish", [_extensionArgs]];
#ifdef __ARMA_DEBUG__
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_publish' Published message to channel '%1': '%2'", _channel, _message];
#endif
true

View File

@ -4,16 +4,9 @@
* Function: dragonfly_db_fnc_saveDB
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Save DB to disc.
* Save DB to disk.
*
* Arguments:
* N/A
@ -28,4 +21,5 @@
* Public: Yes
*/
"ArmaDragonflyClient" callExtension ["savedb", []];
"ArmaDragonflyClient" callExtension ["savedb", []];

View File

@ -4,30 +4,24 @@
* Function: dragonfly_db_fnc_scheduler
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Scheduled Environment for extension.
* Parse extension scheduler payload and map task ID to callback.
*
* Arguments:
* 0: Task ID from extension <STRING> (default: "")
* 0: Serialized task payload from extension <STRING> (default: "")
*
* Return Value:
* N/A
*
* Examples:
* ["071620241600_get"] call dragonfly_db_fnc_scheduler (Server or Singleplayer Only)
* ["071620241600_get"] remoteExecCall ["dragonfly_db_fnc_scheduler", 2, false] (Multiplayer Only)
* [(_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;
@ -45,4 +39,4 @@ private _addTaskIDToMap = {
_myHashMap = missionNamespace getVariable [_varName, createHashMap];
};
[_taskType, _taskID] call _addTaskIDToMap;
[_taskType, _taskID] call _addTaskIDToMap;

View File

@ -4,13 +4,6 @@
* Function: dragonfly_db_fnc_set
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Set value of stored key from DB.
@ -29,7 +22,8 @@
* Public: Yes
*/
params [["_key", "", [""]], ["_data", "", [[]]]];
params [["_key", "", [""]], ["_data", [], [[]]]];
#ifdef __A3__DEBUG__
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_set' Key: '%1', Data: '%2'", _key, _data];
@ -39,4 +33,4 @@ if (_key == "" || isNil "_data") exitWith {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_set' Invalid Input for Key '%1' or Data '%2'", _key, _data];
};
"ArmaDragonflyClient" callExtension ["set", [_key, _data]];
"ArmaDragonflyClient" callExtension ["set", [_key, _data]];

View File

@ -4,21 +4,14 @@
* Function: dragonfly_db_fnc_setup
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Setup Extension to communicate with DB.
* Setup extension connection settings.
*
* Arguments:
* 0: Name of host <STRING> (default: "localhost")
* 1: Port of host <NUMBER> (default: 6379)
* 2: Password of host <STRING> (default: "xyz123")
* 2: Password of host <STRING> (default: "")
*
* Return Value:
* N/A
@ -30,6 +23,7 @@
* Public: Yes
*/
params [["_host", "localhost", [""]], ["_port", 6379, [0]], ["_password", "", [""]]];
"ArmaDragonflyClient" callExtension ["setup", [_host, _port, _password]];
"ArmaDragonflyClient" callExtension ["setup", [_host, _port, _password]];

View File

@ -1,73 +0,0 @@
#include "..\script_component.hpp"
/*
* Function: dragonfly_db_fnc_subscribe
* Author: J. Schmidt
* Edit: 07.15.2024
* Copyright © 2024 J. Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Subscribe to a DragonflyDB channel for real-time updates.
* Uses CBA event system for message handling.
*
* Arguments:
* 0: STRING - Channel name to subscribe to (default: "")
* 1: STRING - Event type: "global", "local", "server", or "remote" (default: "global")
* 2: STRING - CBA event name to trigger when messages are received (default: "")
* 3: STRING - NetID of target to receive messages (only needed for "remote" event type) (default: nil)
*
* Return Value:
* BOOLEAN - True if successful, false otherwise
*
* Examples:
* ["global_chat", "global", "myChatEvent"] call dragonfly_db_fnc_subscribe
* ["player_notifications", "remote", "playerNotificationEvent", netId player] call dragonfly_db_fnc_subscribe
*
* Public: Yes
*/
params [["_channel", "", [""]], ["_eventType", "global", [""]], ["_eventName", "", [""]], ["_target", nil, [""]]];
#ifdef __A3__DEBUG__
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_subscribe' Channel: '%1', Event Type: '%2', Event Name: '%3', Target: '%4'", _channel, _eventType, _eventName, _target];
#endif
if (_channel isEqualTo "") exitWith {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_subscribe' Invalid Input for Channel '%1'", _channel];
false
};
if (!(_eventType in ["global", "local", "server", "remote"])) exitWith {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_subscribe' Invalid Input for Event Type '%1'", _eventType];
false
};
if (_eventType isEqualTo "remote" && (isNil "_target" || _target isEqualTo "")) exitWith {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_subscribe' Invalid Input for Target NetID '%1'", _target];
false
};
if (_eventName isEqualTo "") exitWith {
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_subscribe' Invalid Input for Event Name '%1'", _eventName];
false
};
private _args = [_channel, _eventType, _eventName];
if (!isNil "_target") then { _args pushBack _target; };
private _formattedArgs = _args apply { if (_x isEqualType "") then { str _x } else { _x } };
private _extensionArgs = _formattedArgs joinString ",";
private _result = "ArmaDragonflyClient" callExtension ["subscribe", [_extensionArgs]];
#ifdef __ARMA_DEBUG__
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_subscribe' Subscribed to channel '%1' with event type '%2' and event name '%3'", _channel, _eventType, _eventName];
#endif
true

View File

@ -4,22 +4,15 @@
* Function: dragonfly_db_fnc_test
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Test function.
* Log and display a test payload.
*
* Arguments:
* 0: Value <ARRAY|STRING|NUMBER|BOOL>
* 0: Payload value <ANY>
*
* Return Value:
* <ARRAY|STRING|NUMBER|BOOL> Value
* N/A
*
* Examples:
* ["Hello World!"] spawn dragonfly_db_fnc_test (Server or Singleplayer Only)
@ -28,8 +21,9 @@
* Public: Yes
*/
_res = _this;
dragonfly_db_test = _res;
hint format ["%1", _res];
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_test' Result: '%1'", _res];
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_test' Result: '%1'", _res];

View File

@ -2,6 +2,9 @@
This documentation provides details on all functions available in `ArmaDragonflyClient`. These functions allow you to interact with the in-memory database system for Arma 3.
## Important Payload Limit
Keep payloads under 20,480 bytes. This is the maximum size the engine can send or receive at one time. If you expect a response larger than 20,480 bytes, provide a callback function so the mod can use its internal fetch/chunking flow and deliver the reconstructed data to your callback.
## Function Categories
The functions are categorized by their purpose:

View File

@ -1,5 +1,10 @@
# Basic Data Operations
## Important Payload Limit
Keep payloads under 20,480 bytes. This is the maximum size the engine can send or receive at one time. If you expect a response larger than 20,480 bytes, provide a callback function so the mod can use its internal fetch/chunking flow and deliver the reconstructed data to your callback.
This section contains documentation for the basic data operations of ArmaDragonflyClient that allow for simple key-value storage and retrieval.
## Available Functions

View File

@ -1,5 +1,10 @@
# Core Functions
## Important Payload Limit
Keep payloads under 20,480 bytes. This is the maximum size the engine can send or receive at one time. If you expect a response larger than 20,480 bytes, provide a callback function so the mod can use its internal fetch/chunking flow and deliver the reconstructed data to your callback.
This section contains documentation for the core functions of ArmaDragonflyClient that handle initialization, process management, and scheduling.
## Available Functions

View File

@ -1,5 +1,10 @@
# Hash Operations
## Important Payload Limit
Keep payloads under 20,480 bytes. This is the maximum size the engine can send or receive at one time. If you expect a response larger than 20,480 bytes, provide a callback function so the mod can use its internal fetch/chunking flow and deliver the reconstructed data to your callback.
This section contains documentation for the hash operations of ArmaDragonflyClient that allow for working with hash tables (key-value pairs within a namespace).
## Available Functions

View File

@ -1,5 +1,10 @@
# List Operations
## Important Payload Limit
Keep payloads under 20,480 bytes. This is the maximum size the engine can send or receive at one time. If you expect a response larger than 20,480 bytes, provide a callback function so the mod can use its internal fetch/chunking flow and deliver the reconstructed data to your callback.
This section contains documentation for the list operations of ArmaDragonflyClient that allow for working with ordered collections of items.
## Available Functions