Commit 568f0993 authored by Razer's avatar Razer
Browse files

Added plugin list to rpt

parent db72487c
......@@ -64,6 +64,7 @@ if(_pwDataIndex != -1 && {_index != -1}) then {
_warningMessages = [];
_entryCount = [];
_cfg = configFile >> "Plugins";
{
......@@ -71,20 +72,7 @@ _cfg = configFile >> "Plugins";
_cfgName = _x;
_config = _cfg >> _cfgName;
_data = _configEntries select _forEachIndex;
_tag = getText(_config >> "tag");
// Use string so both ("1.1.1") and ("0.1") values can be read
_versionConfig = (_config >> "version");
_versionString = [getText(_versionConfig),str(getNumber(_versionConfig))] select (isNumber(_versionConfig));
// Check plugin version
if(_versionString == "") then { // Version does not exist
diag_log format["<PluginManager>: Broadcasting %1 config entry(s) for %2",count(_data),_cfgName];
} else {
diag_log format["<PluginManager>: Broadcasting %1 config entry(s) for %2, [v%3]",count(_data),_cfgName,_versionString];
};
_entryCount pushBack (count _data);
// Check required plugins
_missingPlugins = [];
......@@ -120,7 +108,7 @@ _cfg = configFile >> "Plugins";
};
_tag = getText(_config >> "tag");
_data apply {
_x set[0,(_x select 0) + "_" + _tag]; //[key,value] => [key_tag,value]
_x pushBack true;
......@@ -132,4 +120,6 @@ _cfg = configFile >> "Plugins";
// Send warning messages
_warningMessages apply {
diag_log _x;
};
\ No newline at end of file
};
_entryCount
\ No newline at end of file
......@@ -2,7 +2,7 @@
* Desolation Redux
* http://desolationredux.com/
* © 2016 - 2020 Desolation Dev Team
*
*
* This work is licensed under the Arma Public License Share Alike (APL-SA) + Bohemia monetization rights.
* To view a copy of this license, visit:
* https://www.bistudio.com/community/licenses/arma-public-license-share-alike/
......@@ -15,14 +15,19 @@
BASE_var_serverReady = false;
BASE_var_startTime = diag_tickTime;
diag_log "<PluginManager>: Preinit Called";
diag_log "<PluginManager>: INFO: PreInit Called";
//--- compile initialization list of files | get PluginList.cfg from DLL
_request = ["GetInitOrder",[]];
_order = [_request] call DB_fnc_sendRequest;
if (isNil "_order") exitWith {
for "_i" from 1 to 8 do {
diag_log "<PluginManager>: ERROR: APMSDB PLUGIN NOT FOUND!";
};
};
_entryCount = [];
_tagList = [];
_blockList = [];
_password = "";
......@@ -42,7 +47,7 @@
} else {
// Compile CFG.s and lock server (Requires libredex)
call BASE_fnc_compileCfg;
_entryCount = call BASE_fnc_compileCfg;
// Get the tag list so that order is defined by PluginList.cfg
_cfg = configFile >> "Plugins";
......@@ -56,7 +61,6 @@
};
};
//--- Make sure plugin tag is not already in use
_index = _tagList find _tag;
if(_index != -1) then {
......@@ -86,7 +90,6 @@
BASE_var_pluginList pushBack [_x,_tagList select _forEachIndex];
} forEach _order;
publicVariable "BASE_var_pluginList";
// GET FUNCTIONS FOR CLIENTS AND SERVER
BASE_var_functions_server = [];
......@@ -114,10 +117,10 @@
};
if((_isServer || (!_isClient && !_isGlobal)) && !(_fnc in BASE_var_functions_server)) then {
if(isClass _x)then {
if(getNumber (_x >> "uselockcheck") > 0) then {_blockList pushBack _fnc;};
// If overwrite client?
_client = (getNumber (_x >> "isclient")) > 0;
_global = (getNumber (_x >> "isglobal")) > 0;
......@@ -136,9 +139,42 @@
};
// Add plugin list
diag_log formatText ["==================================================================================="];
diag_log formatText ["| Plugin List |"];
diag_log formatText ["|=================================================================================|"];
diag_log formatText ["| Tag | Name | Version | Server | Client | Configs |"];
diag_log formatText ["| | | | Functions | Functions | |"];
diag_log formatText ["|-------------------------------------|---------|-----------|---------------------|"];
{
_x params ["_name","_tag"];
// Use string so both ("1.1.1") and ("0.1") values can be read
_versionConfig = configFile >> "Plugins" >> _name >> "version";
_versionString = [getText(_versionConfig),str(getNumber(_versionConfig))] select (isNumber(_versionConfig));
// Get function count
_serverFuncCount = count (BASE_var_functions_server select {(toLower _x) find ((toLower _tag) + "_") != -1});
_clientFuncCount = count (BASE_var_functions_client select {(toLower _x) find ((toLower _tag) + "_") != -1});
// Get config count
_configCount = _entryCount select _forEachIndex;
// Calculate whitespace amounts
_a = [];for "_i" from 0 to (6 - (count _tag)) do {_a pushBack 32};_a = toString _a;
_b = [];for "_i" from 0 to (26 - (count _name)) do {_b pushBack 32};_b = toString _b;
_c = [];for "_i" from 0 to (6 - (count _versionString)) do {_c pushBack 32};_c = toString _c;
_d = [];for "_i" from 0 to (8 - (count str(_serverFuncCount))) do {_d pushBack 32};_d = toString _d;
_e = [];for "_i" from 0 to (8 - (count str(_clientFuncCount))) do {_e pushBack 32};_e = toString _e;
_f = [];for "_i" from 0 to (6 - (count str(_configCount))) do {_f pushBack 32};_f = toString _f;
diag_log formatText ["|%1%2 |%3%4 | %5%6 | %7%8 | %9%10 | %11%12 |",_a,_tag,_b,_name,_c,_versionString,_d,_serverFuncCount,_e,_clientFuncCount,_f,_configCount];
} forEach BASE_var_pluginList;
diag_log formatText ["==================================================================================="];
diag_log format["<PluginManager>: Server function count: %1",count(BASE_var_functions_server)];
diag_log format["<PluginManager>: Client function count: %1",count(BASE_var_functions_client)];
diag_log format ["<PluginManager>: Server function count: %1",count(BASE_var_functions_server)];
diag_log format ["<PluginManager>: Client function count: %1",count(BASE_var_functions_client)];
// this variable is used in the Mission file to broadcast the client functions
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment