ramdb/addons/db/functions/fnc_init.sqf
Jacob Schmidt 2fbf0d4ed4
All checks were successful
Build / Build (push) Successful in 30s
feat: Add database loading and handle missing ARDB file
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.
2025-03-22 19:38:29 -05:00

39 lines
1.0 KiB
Plaintext

#include "..\script_component.hpp"
/*
* Function: ramdb_db_fnc_init
* Author: Creedcoder, J.Schmidt
* Edit: 07.15.2024
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Initial Extension settings.
*
* Arguments:
* N/A
*
* Return Value:
* N/A
*
* Examples:
* N/A
*
* Public: Yes
*/
ramdb_db_buffer = 10240;
private _dll = "ArmaRAMDb" callExtension ["version", []];
[] call FUNC(load);
diag_log text (format ["ArmaRAMDb: DLL Version %1 found", _dll]);
diag_log text "ArmaRAMDb: Functions loaded and Initializtion completed!";
diag_log text (format ["ArmaRAMDb: Buffer size set to %1 Bytes", ramdb_db_buffer]);
diag_log text "ArmaRAMDb: Ready for use!";