dragonfly/addons/db/functions/fnc_fetch.sqf
Jacob Schmidt 8c64bfe4a9
All checks were successful
Build / Build (push) Successful in 30s
feat(db): Enhance debugging and fix NetId handling
This commit enhances debugging capabilities and addresses issues related to NetId handling within the DragonflyDB system.

Key changes:

*   **Improved Debugging:** Added more detailed logging in `Utils.cs` to track data chunks and strings, improving the ability to diagnose issues.
*   **NetId Handling Fix:** Modified `fnc_handler.sqf` to correctly handle NetIds, including a fallback mechanism if the target object is null. This ensures that remote execution attempts don't fail silently.
*   **Function Examples:** Updated examples in `fnc_hashSetIdBulk.sqf` and `fnc_hashSetBulk.sqf` to correctly use array syntax for function calls.
*   **Simplified fetch.sqf:** Removed unecessary conversion of the _call variable.
*   **Binary Updates:** Updated the compiled DLL and SO files.
2025-03-28 09:45:16 -05:00

58 lines
1.8 KiB
Plaintext

#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
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];
#endif
params ["_uniqueID", "_function", "_index", "_total", "_datachunk", "_call", "_netId"];
private _dataString = "";
private _index_array = [];
private _count_total = 0;
dragonfly_db_fetch_array pushBackUnique [_uniqueID, _function, _index, _total, _datachunk, _call, _netId];
_count_total = {
if (_uniqueID == _x select 0) then {
_index_array pushBackUnique [_x select 2, _x select 4];
true
} else {
false
}
} count dragonfly_db_fetch_array;
if (_count_total == _total) then {
_index_array sort true;
{
_dataString = _dataString + (_x select 1);
} forEach _index_array;
#ifdef __ARMA__DEBUG__
diag_log text format ["ArmaDragonflyClient: 'dragonfly_db_fnc_fetch' Data String: %1", _dataString];
#endif
[_uniqueID, _function, _call, (parseSimpleArray _dataString), _netId] call FUNC(handler);
dragonfly_db_fetch_array = dragonfly_db_fetch_array select {!((_x select 0) in [_uniqueID])};
};