73 lines
3.2 KiB
Markdown
73 lines
3.2 KiB
Markdown
---
|
|
title: ArmaRAMDb - Hash Get All
|
|
icon: mdi:file-text-outline
|
|
excerpt: Get all fields from the current client's hash table in RAMDb.
|
|
---
|
|
|
|
# ramdb_db_fnc_hashGetAll
|
|
|
|
## Description
|
|
Retrieves all fields and values from the hash table associated with the current client/player. This function automatically determines the appropriate hash ID based on the caller's identity, making it more convenient than `hashGetAllId` which requires manually specifying an ID. It returns the entire hash table data through a callback function, allowing access to all stored key-value pairs at once.
|
|
|
|
## Syntax
|
|
```sqf
|
|
[_function, _call, _netId] call ramdb_db_fnc_hashGetAll
|
|
```
|
|
|
|
## Parameters
|
|
| Parameter | Type | Description | Default |
|
|
|-------------|---------|------------------------------------------------------------|---------|
|
|
| `_function` | String | Name of the function to receive the retrieved data | "" |
|
|
| `_call` | Boolean | Whether to call the function directly (true) or spawn (false) | false |
|
|
| `_netId` | String | (Optional) NetID of the player to receive the data | "" |
|
|
|
|
## Return Value
|
|
None. The retrieved data is passed to the specified callback function asynchronously.
|
|
|
|
## Examples
|
|
### Retrieve all client hash data:
|
|
```sqf
|
|
["ramdb_db_fnc_test"] call ramdb_db_fnc_hashGetAll;
|
|
```
|
|
|
|
### Retrieve data with synchronous callback:
|
|
```sqf
|
|
["ramdb_db_fnc_processAllData", true] call ramdb_db_fnc_hashGetAll;
|
|
```
|
|
|
|
### Retrieve data and send it to a specific client:
|
|
```sqf
|
|
["ramdb_db_fnc_test", false, netId player] remoteExecCall ["ramdb_db_fnc_hashGetAll", 2, false];
|
|
```
|
|
|
|
## Notes
|
|
- Returns the complete hash table for the current client with all fields and values as a nested array
|
|
- The data is retrieved asynchronously through the extension's callback system
|
|
- The callback function name must be provided and is validated
|
|
- When a netId is provided, the data is sent to that specific client
|
|
- The `_call` parameter determines whether the function is called directly (synchronous) or spawned (asynchronous)
|
|
- This function automatically determines which hash table to use based on the caller's identity
|
|
- Use `hashGetAllId` when you need to specify a particular hash table by ID
|
|
- For large hash tables, retrieving all data may impact performance
|
|
- All operations are logged for debugging purposes
|
|
|
|
## Related Functions
|
|
- `ramdb_db_fnc_hashGet`: Retrieves a specific field value from the current client's hash table
|
|
- `ramdb_db_fnc_hashGetId`: Retrieves a specific field value from a specific hash table (when you need to specify the ID)
|
|
- `ramdb_db_fnc_hashGetAllId`: Retrieves all fields from a specific hash table (when you need to specify the ID)
|
|
- `ramdb_db_fnc_hashSet`: Sets a field value in the current client's hash table
|
|
- `ramdb_db_fnc_scheduler`: Processes the callback from the database extension
|
|
|
|
## Links
|
|
|
|
[Hash Delete](hashDelete) |
|
|
[Hash Delete Field](hashDeleteField) |
|
|
[Hash Delete ID](hashDeleteId) |
|
|
[Hash Get](hashGet) |
|
|
[Hash Get All](hashGetAll) |
|
|
[Hash Get All ID](hashGetAllId) |
|
|
[Hash Get ID](hashGetId) |
|
|
[Hash Set](hashSet) |
|
|
[Hash Set Bulk](hashSetBulk) |
|
|
[Hash Set ID](hashSetId) |
|
|
[Hash Set ID Bulk](hashSetIdBulk) |