This commit includes several improvements and fixes:
* **Improved Chunking Logic:** Refactored the chunking logic in `Utils.cs` to use a more efficient approach, improving performance. The previous implementation was complex and less performant. This change simplifies the logic and improves efficiency.
* **Fixed Handler Function:** Modified `fnc_handler.sqf` to correctly handle remote execution with NetIds, ensuring that if the NetId resolves to a null object, the function falls back to local execution. This prevents errors when the target object is no longer valid.
* **Added Save Backup Option:** Added the ability to create a backup when saving data in `fnc_save.sqf`. This allows for data recovery in case of corruption.
* **Updated DLL/SO:** Updated the ArmaRAMDb_x64.dll and ArmaRAMDb_x64.so files.
This commit addresses several input validation issues in the ArmaRAMDb SQF functions and updates the compiled binaries.
* **Input Validation:** Modified several `fnc_` functions to correctly validate input data. Specifically, changed `isNil` checks to `count _data == 0` to ensure that empty arrays are treated as invalid input, improving the robustness of the functions. This affects `fnc_hashSetId.sqf`, `fnc_listSet.sqf`, `fnc_hashSet.sqf`, `fnc_listAdd.sqf`, `fnc_hashSetIdBulk.sqf`, and `fnc_hashSetBulk.sqf`.
* **Configuration File Path:** Fixed an issue in `Main.cs` where the configuration file path was not correctly constructed, ensuring the config file is loaded correctly.
* **Updated DLL/SO:** Updated the ArmaRAMDb_x64.dll and ArmaRAMDb_x64.so files.
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.
This commit introduces database loading functionality and handles the scenario where the ARDB file is not found.
Key changes:
* In `addons/db/functions/fnc_init.sqf`, the `load` function is called to initialize the database.
* In `extension/src/RAMDb.cs`, a check is added to verify the existence of the ARDB file. If the file is not found, a new database will be created when data is saved, and an info log is generated.
* Updated DLL and SO files.
This commit enhances the `ListRangeAsync` function within the ArmaRAMDb extension and updates the build artifacts.
Specifically, the following changes were made:
* **ListStore.cs:**
* Modified `ListRangeAsync` to handle an `endIndex` of -1, treating it as the last element of the list.
* Added checks to ensure valid ranges and return an empty array if the range is invalid or the result is empty.
* Added a check to return an empty array if the list is not found.
* **Build Artifacts:**
* Updated the `ArmaRAMDb_x64.dll` and `ArmaRAMDb_x64.so` files in the root directory and the extension/bin/Release/net8.0/win-x64/publish and extension/bin/Release/net8.0/linux-x64/publish directories.
This commit updates file paths and build artifacts for the ArmaRAMDb extension.
Specifically, the following changes were made:
* **Main.cs:**
* Defined `DEFAULT_ARDB_PATH` to store the default path for the ARDB file.
* Updated `ARDB_LOGFOLDER` to use `Path.DirectorySeparatorChar` for cross-platform compatibility.
* Used `DEFAULT_ARDB_PATH` when checking for the existence of the ARDB file.
* **RAMDb.cs:**
* Removed the `DEFAULT_ARDB_PATH` constant.
* Modified the constructor to accept an optional `ardbPath` parameter and use `Main.DEFAULT_ARDB_PATH` as the default if none is provided.
* **Build Artifacts:**
* Updated the `ArmaRAMDb_x64.dll` and `ArmaRAMDb_x64.so` files in the extension/bin/Release/net8.0/win-x64/publish and extension/bin/Release/net8.0/linux-x64/publish directories, as well as the root directory.
This commit updates the build artifacts for both Windows and Linux platforms. This includes the ArmaRAMDb_x64.dll and ArmaRAMDb_x64.so files, as well as the published versions in the extension/bin/Release/net8.0 directories.