
This commit includes several changes to improve the performance and stability of ArmaRAMDb: * **Increased Buffer Size:** Increased the buffer size in `Main.cs` to 10240 to handle larger data chunks. * **Debug Logging:** Added `#ifdef __A3__DEBUG__` preprocessor directives to enable debug logging in various `.sqf` functions for easier troubleshooting. * **Improved Chunking Logic:** Refactored the chunking logic in `Utils.cs` to correctly handle array data and improve efficiency. * **ListStore Formatting:** Modified `ListStore.cs` to correctly format list values as JSON strings when retrieving or setting list elements. * **Removed Unnecessary Code:** Removed unnecessary `_dataString` variable in `fnc_fetch.sqf`. * **Updated DLL/SO:** Updated the ArmaRAMDb_x64.dll and ArmaRAMDb_x64.so files.
53 lines
2.1 KiB
Plaintext
53 lines
2.1 KiB
Plaintext
#include "..\script_component.hpp"
|
|
|
|
/*
|
|
* Function: ramdb_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.
|
|
*
|
|
* Arguments:
|
|
* 0: Type of task <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)
|
|
* 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)
|
|
* 7: NetID of target to return data from function <STRING> (default: "")
|
|
*
|
|
* Return Value:
|
|
* N/A
|
|
*
|
|
* Examples:
|
|
* ["hgetall", "", "", -1, [], "ramdb_db_fnc_test", false] call ramdb_db_fnc_addTask (Server or Singleplayer Only)
|
|
* ["hgetallid", getPlayerUID player, "", -1, [], "ramdb_db_fnc_test", false, netId player] remoteExecCall ["ramdb_db_fnc_addTask", 2, false] (Multiplayer Only)
|
|
*
|
|
* 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];
|
|
|
|
#ifdef __A3__DEBUG__
|
|
diag_log text format ["ArmaRAMDb: 'ramdb_db_fnc_addTask' Added Task '%1' to Queue", _task];
|
|
#endif
|
|
|
|
GVAR(taskQueue) pushBack _task;
|
|
|
|
#ifdef __A3__DEBUG__
|
|
diag_log text format ["ArmaRAMDb: 'ramdb_db_fnc_addTask' Queue: %1", GVAR(taskQueue)];
|
|
diag_log text format ["ArmaRAMDb: 'ramdb_db_fnc_addTask' Queue Size: %1", count GVAR(taskQueue)];
|
|
#endif
|
|
|
|
if !(GVAR(isProcessing)) then { [] spawn FUNC(processQueue); }; |