<commit_before>// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
//	@file Name: init.sqf
//	@file Author: Torndeco, AgentRev

#define MIN_DB_VERSION 2.03

private ["_return", "_result", "_setupDir", "_serverID", "_env", "_mapID"];

// uiNamespace is persistent across mission restarts (but not game restarts)
_return = if (isNil {uiNamespace getVariable "A3W_extDB_ID"}) then
{
	diag_log "[extDB] Startup...";

	_result = call compile ("extDB" callExtension format ["9:DATABASE:%1", call A3W_extDB_ConfigName]);
	if (_result select 0 == 0 && {_result select 1 != "Already Connected to Database"}) exitWith { diag_log format ["[extDB] ### Database error! %1", _result]; false };

	diag_log "[extDB] Connected to database";

	A3W_extDB_ID = compileFinal str floor random 999999;
	A3W_extDB_miscID = compileFinal str (call A3W_extDB_ID + 1);

	_result = call compile ("extDB" callExtension format ["9:ADD:DB_CUSTOM_V3:%1:%2", call A3W_extDB_ID, call A3W_extDB_IniName]);
	if (_result select 0 == 0) exitWith { diag_log format ["[extDB] ### DB_CUSTOM_V3 protocol error! %1", _result]; false };

	diag_log "[extDB] Initialized DB_CUSTOM_V3 protocol";

	_result = call compile ("extDB" callExtension format ["9:ADD:MISC:%1", call A3W_extDB_miscID]);
	if (_result select 0 == 0) exitWith { diag_log format ["[extDB] ### MISC protocol error! %1", _result]; false };

	diag_log "[extDB] Initialized MISC protocol";

	uiNamespace setVariable ["A3W_extDB_ID", call A3W_extDB_ID];
	uiNamespace setVariable ["A3W_extDB_miscID", call A3W_extDB_miscID];<commit_msg>fix for extDB v35<commit_after>// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
//	@file Name: init.sqf
//	@file Author: Torndeco, AgentRev

#define MIN_DB_VERSION 2.03

private ["_return", "_result", "_setupDir", "_serverID", "_env", "_mapID"];

// uiNamespace is persistent across mission restarts (but not game restarts)
_return = if (isNil {uiNamespace getVariable "A3W_extDB_ID"}) then
{
	diag_log "[extDB] Startup...";

	_result = call compile ("extDB" callExtension format ["9:DATABASE:%1", call A3W_extDB_ConfigName]);
	if (_result select 0 == 0 && {_result select 1 != "Already Connected to Database"}) exitWith { diag_log format ["[extDB] ### Database error! %1", _result]; false };

	diag_log "[extDB] Connected to database";

	A3W_extDB_ID = compileFinal str floor random 999999;
	A3W_extDB_miscID = compileFinal str (call A3W_extDB_ID + 1);

	_result = call compile ("extDB" callExtension format ["9:ADD:DB_CUSTOM_V3:%1:%2", call A3W_extDB_ID, call A3W_extDB_IniName]);
	if (_result select 0 == 0) exitWith { diag_log format ["[extDB] ### DB_CUSTOM_V3 protocol error! %1", _result]; false };

	diag_log "[extDB] Initialized DB_CUSTOM_V3 protocol";

	_result = call compile ("extDB" callExtension format ["9:ADD:MISC_V2:%1", call A3W_extDB_miscID]);
	if (_result select 0 == 0) exitWith { diag_log format ["[extDB] ### MISC protocol error! %1", _result]; false };

	diag_log "[extDB] Initialized MISC protocol";

	uiNamespace setVariable ["A3W_extDB_ID", call A3W_extDB_ID];
	uiNamespace setVariable ["A3W_extDB_miscID", call A3W_extDB_miscID];
{'fraction_non_alphanumeric': 0.2212265471856623, 'fraction_numerical': 0.027723326799215905, 'mean_word_length': 6.289795918367347, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4809733', 'n_tokens_mistral': 1232, 'n_tokens_neox': 1144, 'n_words': 340}