
All checks were successful
Build / Build (push) Successful in 39s
This commit significantly enhances the `README.md` file, providing comprehensive documentation for the ArmaDragonflyClient. Key changes: * **Detailed Function Categories:** Categorized functions for better organization (Core, Basic Data Operations, Hash Operations, List Operations). * **Usage Examples:** Added clear and concise usage examples for basic operations, hash operations (context and ID-specific), and list operations. * **Function Documentation Structure:** Outlined the structure for individual function documentation. * **License Information:** Updated the license information.
65 lines
2.8 KiB
Markdown
65 lines
2.8 KiB
Markdown
---
|
|
title: ArmaDragonflyClient - Handler
|
|
icon: mdi:file-text-outline
|
|
excerpt: Handle data from DB.
|
|
---
|
|
|
|
# dragonfly_db_fnc_handler
|
|
|
|
## Description
|
|
Handles data received from the database and routes it to the appropriate function. This function is a critical component of the callback system, receiving data from database operations and directing it to the specified function, either locally or to a remote client.
|
|
|
|
## Syntax
|
|
```sqf
|
|
[_uniqueID, _function, _call, _data, _netId] call dragonfly_db_fnc_handler
|
|
```
|
|
|
|
## Parameters
|
|
| Parameter | Type | Description | Default |
|
|
|-------------|----------------------------------|-------------------------------------------------------|---------|
|
|
| `_uniqueID` | String | Unique identifier for the data chunk | "" |
|
|
| `_function` | String | Name of function to receive the data | "" |
|
|
| `_call` | Boolean | Whether to call the function directly (true) or spawn (false) | false |
|
|
| `_data` | Array, String, Number, or Boolean| The data retrieved from the database | [] |
|
|
| `_netId` | String | (Optional) NetID of the player to receive the data | nil |
|
|
|
|
## Return Value
|
|
None. The data is passed to the specified function for processing.
|
|
|
|
## Examples
|
|
### Process data locally:
|
|
```sqf
|
|
["0123456789", "dragonfly_db_fnc_test", false, ["Hello World!"]] call dragonfly_db_fnc_handler;
|
|
```
|
|
|
|
### Send data to a specific client:
|
|
```sqf
|
|
["0123456789", "dragonfly_db_fnc_test", false, ["Hello World!"], netId player] remoteExecCall ["dragonfly_db_fnc_handler", 2, false];
|
|
```
|
|
|
|
### Process data with direct call (synchronous):
|
|
```sqf
|
|
["0123456789", "dragonfly_db_fnc_processInventory", true, [["weapon1", 30], ["item2", 5]]] call dragonfly_db_fnc_handler;
|
|
```
|
|
|
|
## Notes
|
|
- The function validates that both the function name and data are valid before proceeding
|
|
- When a netId is provided, the data is sent to that specific client using remoteExec
|
|
- The `_call` parameter determines whether the function is called directly (synchronous) or spawned (asynchronous)
|
|
- This function is typically called by the scheduler or other core components rather than directly by user code
|
|
- Each handler call is logged, which is useful for debugging data flow
|
|
|
|
## Related Functions
|
|
- `dragonfly_db_fnc_scheduler`: Processes callbacks from the database extension
|
|
- `dragonfly_db_fnc_fetch`: Assembles data chunks for large datasets
|
|
- `dragonfly_db_fnc_addTask`: Adds tasks to the database operation queue
|
|
|
|
## Links
|
|
|
|
[Add Task](addTask.md) |
|
|
[Handler](handler.md) |
|
|
[Init](init.md) |
|
|
[Print Addon Name](printAddonName.md) |
|
|
[Process Queue](processQueue.md) |
|
|
[Scheduler](scheduler.md) |
|
|
[Test](test.md) |