Jacob Schmidt c8d81ba3bb
All checks were successful
Build / Build (push) Successful in 39s
docs: Update README.md with detailed documentation
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.
2025-03-30 17:15:35 -05:00

62 lines
1.9 KiB
Markdown

---
title: ArmaDragonflyClient - Test
icon: mdi:file-text-outline
excerpt: Test Function.
---
# dragonfly_db_fnc_test
## Description
A simple test function for verifying database operations. This function displays the received data in a hint message and logs it to the RPT file. It's primarily used for testing database retrieval operations and callback functionality.
## Syntax
```sqf
[_value] spawn dragonfly_db_fnc_test
```
## Parameters
| Parameter | Type | Description | Default |
|-----------|----------------------------------|----------------------------------|---------|
| `_value` | Array, String, Number, or Boolean| The value to display and log | [] |
## Return Value
The same value that was passed to the function. Also sets the global variable `dragonfly_db_test` to this value.
## Examples
### Test with a simple string:
```sqf
["Hello World!"] spawn dragonfly_db_fnc_test;
```
### Test database retrieval by specifying this as callback function:
```sqf
["playerStats", "dragonfly_db_fnc_test"] call dragonfly_db_fnc_get;
```
### Test from client to server:
```sqf
["Database is working!"] remoteExec ["dragonfly_db_fnc_test", 2, false];
```
## Notes
- Displays the received value using `hint`
- Logs the same value to the RPT file
- Stores the value in the global variable `dragonfly_db_test` for later inspection
- Commonly used as a callback function for database operations
- Useful for debugging and verifying data flow
- Can be called directly or specified as a callback in other functions
## Related Functions
- `dragonfly_db_fnc_get`: Retrieves values from the database
- `dragonfly_db_fnc_handler`: Routes data to callback functions
- `dragonfly_db_fnc_scheduler`: Manages the callback system
## 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)