Standardize logging format through ACE_LOG macros

This commit is contained in:
Michael Braun 2015-08-26 15:20:11 +02:00
parent 04c14b992e
commit 9e10aa86d7
57 changed files with 146 additions and 146 deletions

View File

@ -25,4 +25,4 @@ if (!_activated) exitWith {};
[_logic, QGVAR(enable), "enable"] call EFUNC(common,readSettingFromModule);
diag_log text "[ACE]: Cargo Module Initialized.";
ACE_LOGINFO("Cargo Module Initialized.");

View File

@ -40,7 +40,7 @@
["HeadbugFixUsed", {
PARAMS_2(_profileName,_animation);
diag_log text format ["[ACE] Headbug Used: Name: %1, Animation: %2", _profileName, _animation];
ACE_LOGINFO(format ["Headbug Used: Name: %1, Animation: %2", _profileName, _animation]);
}] call FUNC(addEventHandler);
@ -100,7 +100,7 @@ if (_currentVersion != _previousVersion) then {
// Handle JIP scenario
if(!isServer) then {
["PlayerJip", {
diag_log text format["[ACE] * JIP event synchronization initialized"];
ACE_LOGINFO("JIP event synchronization initialized");
["SEH_all", [player]] call FUNC(serverEvent);
}] call FUNC(addEventHandler);
} else {
@ -126,13 +126,13 @@ call FUNC(checkFiles);
if (isNil QGVAR(settings) || {(!isServer) && (isNil QEGVAR(modules,serverModulesRead))}) exitWith {
if (!_waitingMsgSent) then {
_args set [0, true];
diag_log text format["[ACE] Waiting on settings from server"];
ACE_LOGINFO("Waiting on settings from server...");
};
};
[(_this select 1)] call cba_fnc_removePerFrameHandler;
diag_log text format["[ACE] Settings received from server"];
ACE_LOGINFO("Settings received from server.");
// Event so that ACE_Modules have their settings loaded:
["InitSettingsFromModules", []] call FUNC(localEvent);
@ -143,7 +143,7 @@ call FUNC(checkFiles);
call FUNC(loadSettingsLocalizedText);
};
diag_log text format["[ACE] Settings initialized"];
ACE_LOGINFO("Settings initialized.");
//Event that settings are safe to use:
["SettingsInitialized", []] call FUNC(localEvent);
@ -272,7 +272,7 @@ GVAR(OldVisibleMap) = false;
GVAR(OldPlayerWeapon) = _newPlayerWeapon;
["playerWeaponChanged", [ACE_player, _newPlayerWeapon]] call FUNC(localEvent);
};
// "visibleMapChanged" event
_newVisibleMap = visibleMap;
if (!_newVisibleMap isEqualTo GVAR(OldVisibleMap)) then {
@ -280,7 +280,7 @@ GVAR(OldVisibleMap) = false;
GVAR(OldVisibleMap) = _newVisibleMap;
["visibleMapChanged", [ACE_player, _newVisibleMap]] call FUNC(localEvent);
};
}, 0, []] call CBA_fnc_addPerFrameHandler;

View File

@ -11,22 +11,22 @@ PARAMS_2(_eventType,_event);
if (_eventType == "ACEg") then {
_eventName = _event select 0;
_eventArgs = _event select 1;
_eventNames = GVAR(events) select 0;
_eventIndex = _eventNames find _eventName;
if (_eventIndex != -1) then {
_events = (GVAR(events) select 1) select _eventIndex;
#ifdef DEBUG_EVENTS
diag_log text format[ARR_2("* Net Event %1",_eventName)];
diag_log text format[ARR_2(" args=%1",_eventArgs)];
ACE_LOGINFO(format ["* Net Event %1", _eventName]);
ACE_LOGINFO(format [" args=%1", _eventArgs]);
#endif
{
if (!isNil "_x") then {
_eventArgs call CALLSTACK_NAMED(_x, format[ARR_3("Net Event %1 ID: %2",_eventName,_forEachIndex)]);
_eventArgs call CALLSTACK_NAMED(_x, format ["Net Event %1 ID: %2", _eventName, _forEachIndex]);
#ifdef DEBUG_EVENTS_CALLSTACK
diag_log text format[ARR_2(" ID: %1",_forEachIndex)];
ACE_LOGINFO(format [" ID: %1", _forEachIndex]);
#endif
};
} forEach _events;
@ -38,7 +38,7 @@ if (_eventType == "ACEc") then {
_eventName = _event select 0;
_eventTargets = _event select 1;
_eventArgs = _event select 2;
_sentEvents = [];
if (!IS_ARRAY(_eventTargets)) then {
_eventTargets = [_eventTargets];
@ -72,4 +72,4 @@ if (_eventType == "ACEc") then {
};
} forEach _eventTargets;
};
};
};

View File

@ -1,16 +1,16 @@
/*
* Author: jaynus
*
*
* Receives either requests for synchronization from clients, or the synchronization data from the server.
*
* Arguments [Client] :
* 0: eventName (String)
* 1: eventLog (Array)
*
*
* Arguments [Server] :
* 0: eventName (String)
* 1: client (Object)
*
*
* Return value:
* Boolean of success
*/
@ -24,14 +24,14 @@ if(isServer) then {
// Find the event name, and shovel out the events to the client
PARAMS_2(_eventName,_client);
private["_eventEntry", "_eventLog"];
if(!HASH_HASKEY(GVAR(syncedEvents),_eventName)) exitWith {
diag_log text format["[ACE] Error, request for synced event - key not found."];
ACE_LOGERROR("Request for synced event - key not found.");
false
};
_eventEntry = HASH_GET(GVAR(syncedEvents),_eventName);
_eventLog = _eventEntry select 1;
["SEH_s", _client, [_eventName, _eventLog] ] call FUNC(targetEvent);
} else {
PARAMS_2(_eventName,_eventLog);
@ -42,7 +42,7 @@ if(isServer) then {
_eventArgs = _x select 1;
[_eventName, _eventArgs, (_x select 2)] call FUNC(_handleSyncedEvent);
} forEach _eventLog;
diag_log text format["[ACE] + [%1] synchronized", _eventName];
ACE_LOGINFO(format ["[%1] synchronized", _eventName]);
};
true
true

View File

@ -1,13 +1,13 @@
/*
* Author: jaynus
*
*
* Handles synced events being received. Server will log them, and server/client will execute them.
*
* Arguments [Client] :
* 0: eventName (String)
* 1: arguments (Array)
* 2: ttl (Scalar)
*
*
* Return value:
* Boolean of success
*/
@ -17,7 +17,7 @@ PARAMS_3(_name,_args,_ttl);
private["_internalData", "_eventLog", "_eventCode"];
if(!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
diag_log text format["[ACE] Error, synced event key not found."];
ACE_LOGERROR("Synced event key not found.");
false
};
@ -33,4 +33,4 @@ if(isServer) then {
};
_eventCode = _internalData select 0;
_args call _eventCode;
_args call _eventCode;

View File

@ -5,9 +5,9 @@
*
* Argument:
* 0: Name (String)
* 1: Handler (Code)
* 1: Handler (Code)
* 2: TTL (Number or Code) [Optional]
*
*
* Return value:
* Boolean of success
*/
@ -25,10 +25,10 @@ if( (count _this) > 2) then {
};
if(HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
diag_log text format["[ACE] Error, duplicate synced event creation."];
ACE_LOGERROR("Duplicate synced event creation.");
false
};
_eventId = [_name, FUNC(_handleSyncedEvent)] call FUNC(addEventHandler);
_data = [_handler,[],_ttl,_eventId];
HASH_SET(GVAR(syncedEvents),_name,_data);
HASH_SET(GVAR(syncedEvents),_name,_data);

View File

@ -87,7 +87,9 @@ switch ((_type select 0)) do {
_unit setPosATL _pos;
};
};
default {diag_log format ["ACE: Incorrect item type passed to %1, passed: %2",QFUNC(AddToInventory),_type];};
default {
ACE_LOGWARNING(format ["Incorrect item type passed to %1, passed: %2", QFUNC(AddToInventory), _type]);
};
};
[_addedToPlayer,_unit]

View File

@ -40,7 +40,7 @@ if (((_namespace getVariable [_uid, [-99999]]) select 0) < ACE_diagTime) then {
private ["_varName","_cacheList"];
// _eventName is defined on the function that calls the event
#ifdef DEBUG_MODE_FULL
diag_log text format ["ACE: Clear cached variables on event: %1", _eventName];
ACE_LOGINFO(format ["Clear cached variables on event: %1", _eventName]);
#endif
// Get the list of caches to clear
_varName = format [QGVAR(clearCache_%1),_eventName];
@ -58,9 +58,9 @@ if (((_namespace getVariable [_uid, [-99999]]) select 0) < ACE_diagTime) then {
_cacheList pushBack [_namespace, _uid];
};
#ifdef DEBUG_MODE_FULL
diag_log format ["Calculated result: %1 %2", _namespace, _uid];
ACE_LOGINFO(format ["Calculated result: %1 %2", _namespace, _uid]);
} else {
diag_log format ["Cached result : %1 %2", _namespace, _uid];
ACE_LOGINFO(format ["Cached result: %1 %2", _namespace, _uid]);
#endif
};

View File

@ -17,7 +17,7 @@
private "_version";
_version = getText (configFile >> "CfgPatches" >> "ace_main" >> "versionStr");
diag_log text format ["[ACE]: ACE is version %1.", _version];
ACE_LOGINFO(format ["ACE is version %1.", _version]);
private "_addons";
_addons = activatedAddons;
@ -28,7 +28,7 @@ _addons = [_addons, {_this find "ace_" == 0}] call FUNC(filter);
private "_errorMsg";
_errorMsg = format ["File %1.pbo is outdated.", _x];
diag_log text format ["[ACE] ERROR: %1", _errorMsg];
ACE_LOGERROR(_errorMsg);
if (hasInterface) then {
["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage);
@ -44,14 +44,14 @@ _addons = [_addons, {_this find "ace_" == 0}] call FUNC(filter);
private "_errorMsg";
_errorMsg = format ["Extension %1.dll not installed.", _x];
diag_log text format ["[ACE] ERROR: %1", _errorMsg];
ACE_LOGERROR(_errorMsg);
if (hasInterface) then {
["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage);
};
} else {
// Print the current extension version
diag_log text format ["[ACE] Extension version: %1: %2", _x, (_x callExtension "version")];
ACE_LOGINFO(format ["Extension version: %1: %2", _x, (_x callExtension "version")]);
};
} forEach getArray (configFile >> "ACE_Extensions" >> "extensions");
@ -78,9 +78,9 @@ if (isMultiplayer) then {
private "_errorMsg";
_errorMsg = format ["Client/Server Version Mismatch. Server: %1, Client: %2.", GVAR(ServerVersion), _version];
diag_log text format ["[ACE] ERROR: %1", _errorMsg];
ACE_LOGERROR(_errorMsg);
if (hasInterface) then {diag_log str "1";
if (hasInterface) then {
["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage);
};
};
@ -89,9 +89,9 @@ if (isMultiplayer) then {
if !(_addons isEqualTo []) then {
_errorMsg = format ["Client/Server Addon Mismatch. Client has extra addons: %1.",_addons];
diag_log text format ["[ACE] ERROR: %1", _errorMsg];
ACE_LOGERROR(_errorMsg);
if (hasInterface) then {diag_log str "1";
if (hasInterface) then {
["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage);
};
};

View File

@ -67,7 +67,7 @@ if (!isServer) then {
};
//[_error, "{systemChat _this}"] call FUNC(execRemoteFnc);
diag_log text _error;
ACE_LOGERROR(_error);
if (_mode < 2) then {
_text = composeText [lineBreak, parseText format ["<t align='center'>%1</t>", _text]];

View File

@ -13,7 +13,7 @@
*
*/
#include "script_component.hpp"
PARAMS_3(_unit,_target,_lockTarget);
if (isNil "_lockTarget") then {_lockTarget = false};
@ -22,7 +22,7 @@ private "_owner";
_owner = _target getVariable [QGVAR(owner), objNull];
if (!isNull _owner && {!isNull _unit} && {_unit != _owner}) then {
diag_log text "[ACE] ERROR: Claiming already owned object.";
ACE_LOGERROR("Claiming already owned object.");
};
// transfer this immediately

View File

@ -55,4 +55,4 @@ if (_level <= _defaultLoglevel) then {
// pass it onwards to the log function:
// [0, [], compile format["%1",_msg], true] call FUNC(log);
};
true
true

View File

@ -23,7 +23,7 @@ _force = False;
// no animation given
if (isNil "_animation") exitWith {
diag_log format ["[ACE] ERROR: No animation specified in %1", _fnc_scriptNameParent];
ACE_LOGERROR(format ["No animation specified in %1.", _fnc_scriptNameParent]);
};
if (isNil "_priority") then {

View File

@ -5,7 +5,7 @@ PARAMS_1(_target);
{
if (isNil "_x") then {
diag_log text format ["[ACE] ERROR: No argument and function for remote function. ID: %1", _forEachIndex];
ACE_LOGERROR(format ["No argument and function for remote function. ID: %1", _forEachIndex]);
} else {
if (typeName _x == "ARRAY") then {
[_x select 0, _target] call (_x select 1);

View File

@ -20,7 +20,7 @@ private ["_newArray", "_index"];
PARAMS_2(_array,_code);
if (isNil "_array") exitWith {
diag_log text format ["[ACE] ERROR: No array for function filter in %1", _fnc_scriptNameParent];
ACE_LOGERROR(format ["No array for function filter in %1.", _fnc_scriptNameParent]);
[]
};

View File

@ -44,7 +44,7 @@ _letterGrid = false;
if (((toLower _formatX) find "a") != -1) then {_letterGrid = true};
if (((toLower _formatY) find "a") != -1) then {_letterGrid = true};
if (_letterGrid) exitWith {
diag_log text format ["[ACE] Map Grid Warning (%1) - Map uses letter grids [%2,%3]", worldName, _formatX, _formatY];
ACE_LOGWARNING(format ["Map Grid Warning (%1) - Map uses letter grids [%2, %3]", worldName, _formatX, _formatY]);
};
//Start at [0, 500] and move north until we get a change in grid
@ -64,13 +64,13 @@ _stepXat5 = _stepX * 10 ^ ((count _formatX) - 5);
_stepYat5 = -1 * _stepY * 10 ^ ((count _formatY) - 5);
if (_stepYat5 < 0) then {
diag_log text format ["[ACE] Map Grid Warning (%1) - Northing is reversed", worldName];
ACE_LOGWARNING(format ["Map Grid Warning (%1) - Northing is reversed.", worldName]);
};
if (_stepXat5 != 1) then {
diag_log text format ["[ACE] Map Grid Warning (%1) - MGRS 10 digit grid does not equal 1 meter: (%2) for x", worldName, _stepXat5];
ACE_LOGWARNING(format ["Map Grid Warning (%1) - MGRS 10 digit grid does not equal 1 meter: (%2) for x.", worldName, _stepXat5]);
};
if ((_stepYat5 != 1) && {_stepYat5 != -1}) then {
diag_log text format ["[ACE] Map Grid Warning (%1) - MGRS 10 digit grid does not equal 1 meter: (%2) for y", worldName, _stepXat5];
ACE_LOGWARNING(format ["Map Grid Warning (%1) - MGRS 10 digit grid does not equal 1 meter: (%2) for y.", worldName, _stepXat5]);
};
GVAR(mapGridData) = [_offsetX, _realOffsetY, _stepXat5, _stepYat5];

View File

@ -42,7 +42,7 @@ _parseConfigForDisplayNames = {
if !([configFile >> "ACE_Settings" >> _name] call _parseConfigForDisplayNames) then {
if !([configFile >> "ACE_ServerSettings" >> _name] call _parseConfigForDisplayNames) then {
if !([missionConfigFile >> "ACE_Settings" >> _name] call _parseConfigForDisplayNames) then {
diag_log text format ["[ACE] - Setting found, but couldn't localize [%1] (server has but we don't?)", _name];
ACE_LOGWARNING(format ["Setting found, but couldn't localize [%1] (server has but we don't?)", _name]);
};
};
};

View File

@ -21,16 +21,16 @@ _eventIndex = _eventNames find _eventName;
if(_eventIndex != -1) then {
_events = (GVAR(events) select 1) select _eventIndex;
#ifdef DEBUG_EVENTS
diag_log text format[ARR_2("* Local Event: %1",_eventName)];
diag_log text format[ARR_2(" args=%1",_eventArgs)];
ACE_LOGINFO(format ["* Local Event: %1", _eventName]);
ACE_LOGINFO(format [" args=%1", _eventArgs]);
#endif
{
if(!isNil "_x") then {
_eventArgs call CALLSTACK_NAMED(_x, format[ARR_3("Local Event %1 ID: %2",_eventName,_forEachIndex)]);
_eventArgs call CALLSTACK_NAMED(_x, format ["Local Event %1 ID: %2", _eventName, _forEachIndex]);
#ifdef DEBUG_EVENTS_CALLSTACK
diag_log text format[ARR_2(" ID: %1",_forEachIndex)];
ACE_LOGINFO(format [" ID: %1", _forEachIndex]);
#endif
};
} forEach _events;
};
};

View File

@ -21,7 +21,7 @@ _array = + _this select 0;
_code = _this select 1;
if (isNil "_array") exitWith {
diag_log text format ["[ACE] ERROR: No array for function map in %1", _fnc_scriptNameParent];
ACE_LOGERROR(format ["No array for function map in %1.", _fnc_scriptNameParent]);
[]
};

View File

@ -22,4 +22,4 @@ if !(_activated) exitWith {};
[_logic, QGVAR(checkPBOsCheckAll), "CheckAll" ] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(checkPBOsWhitelist), "Whitelist" ] call EFUNC(common,readSettingFromModule);
diag_log text format ["[ACE]: Check-PBOs Module Initialized. Mode: %1.", GVAR(checkPBOsAction)];
ACE_LOGINFO(format ["Check-PBOs Module Initialized. Mode: %1.", GVAR(checkPBOsAction)]);

View File

@ -44,4 +44,4 @@ if !(_activated) exitWith {};
};
} count _units;
diag_log text "[ACE]: WEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.";
ACE_LOGINFO("WEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.");

View File

@ -20,7 +20,7 @@ PARAMS_3(_logic,_settingName,_moduleVariable);
// Check if the parameter is defined in the module
if (isNil {_logic getVariable _moduleVariable}) exitWith {
diag_log text format["[ACE]: Warning in %1 module: %2 setting is missing. Probably an obsolete version of the module is used in the mission.", typeOf _logic, _moduleVariable];
ACE_LOGWARNING(format["Warning in %1 module: %2 setting is missing. Probably an obsolete version of the module is used in the mission.", typeOf _logic, _moduleVariable]);
};
// Set the setting globally and force it

View File

@ -5,7 +5,7 @@
*
* Argument:
* 0: Name (String)
*
*
* Return value:
* Boolean of success
*/
@ -16,7 +16,7 @@ PARAMS_1(_name);
private ["_data", "_eventId"];
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
diag_log text format["[ACE] Error, synced event key not found."];
ACE_LOGERROR(format ["Synced event key not found."]);
false
};
@ -24,4 +24,4 @@ _data = HASH_GET(GVAR(syncedEvents),_name);
_eventId = _data select 3;
[_eventId] call ace_common_fnc_removeEventHandler;
HASH_REM(GVAR(syncedEvents),_name);
HASH_REM(GVAR(syncedEvents),_name);

View File

@ -16,8 +16,8 @@
PARAMS_2(_eventName,_eventArgs);
#ifdef DEBUG_EVENTS
diag_log text format[ARR_2("* Server Event: %1",_eventName)];
diag_log text format[ARR_2(" args=%1",_eventArgs)];
ACE_LOGINFO(format ["* Server Event: %1", _eventName]);
ACE_LOGINFO(format [" args=%1", _eventArgs]);
#endif
ACEg = [_eventName, _eventArgs];

View File

@ -7,7 +7,7 @@
* 0: Name (String)
* 1: Arguments (Array)
* 2: TTL (Number or Code) [Optional] for this specific event call
*
*
* Return value:
* Boolean of success
*/
@ -25,9 +25,9 @@ if( (count _this) > 2) then {
};
if(!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
diag_log text format["[ACE] Error, synced event key not found."];
ACE_LOGERROR("Synced event key not found.");
false
};
_eventData = [_name, _args,_ttl];
["SEH", _eventData] call FUNC(globalEvent);
["SEH", _eventData] call FUNC(globalEvent);

View File

@ -21,8 +21,8 @@
PARAMS_3(_eventName,_eventTargets,_eventArgs);
#ifdef DEBUG_EVENTS
diag_log text format[ARR_3("* Target Event: %1 - %2",_eventName,_eventTargets)];
diag_log text format[ARR_2(" args=%1",_eventArgs)];
ACE_LOGINFO(format ["* Target Event: %1 - %2", _eventName, _eventTargets]);
ACE_LOGINFO(format [" args=%1", _eventArgs]);
#endif
ACEc = [_eventName, _eventTargets, _eventArgs];
@ -30,4 +30,4 @@ if(!isServer) then {
publicVariableServer "ACEc";
} else {
["ACEc", ACEc] call FUNC(_handleNetEvent);
};
};

View File

@ -37,11 +37,15 @@ if (_vehicle isKindOf "Ship" ) then {
};
TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle);
if (!_validVehiclestate) exitwith { diag_log format["Unable to unload patient because invalid (%1) vehicle state. Either moving or Not close enough on the ground. position: %2 isTouchingGround: %3 Speed: %4", _vehicle, getPos _vehicle, isTouchingGround _vehicle, speed _vehicle]; false };
if (!_validVehiclestate) exitwith {
ACE_LOGWARNING(format ["Unable to unload patient because invalid (%1) vehicle state. Either moving or Not close enough on the ground. position: %2 isTouchingGround: %3 Speed: %4", _vehicle, getPos _vehicle, isTouchingGround _vehicle, speed _vehicle]);
false
};
diag_log str _emptyPos;
if (count _emptyPos == 0) exitwith {diag_log format["No safe empty spots to unload patient. %1", _emptyPos]; false}; //consider displaying text saying there are no safe places to exit the vehicle
if (count _emptyPos == 0) exitwith {
ACE_LOGWARNING(format ["No safe empty spots to unload patient. %1", _emptyPos]);
false
}; //consider displaying text saying there are no safe places to exit the vehicle
unassignVehicle _unit;
@ -75,4 +79,4 @@ _loaded = _vehicle getvariable [QGVAR(loaded_persons),[]];
_loaded = _loaded - [_unit];
_vehicle setvariable [QGVAR(loaded_persons),_loaded,true];
true
true

View File

@ -23,4 +23,4 @@ params ["_caller", "_target", "_errorMsg"];
if (_caller != ACE_player) exitWith {};
systemChat format ["Debug-Caller: Disarm finished from [%1] with code [%2]", _target, _errorMsg];
diag_log text format ["[ACE_Disarming] %1 - eventCallerFinish: %2", ACE_time, _this];
ACE_LOGINFO(format ["%1 - eventCallerFinish: %2", ACE_time, _this]);

View File

@ -22,6 +22,6 @@
params ["_caller", "_target", "_errorMsg"];
if (_errorMsg != "") then {
diag_log text format ["[ACE_Disarming] %1 - eventTargetFinish: %2", ACE_time, _this];
ACE_LOGINFO(format ["%1 - eventTargetFinish: %2", ACE_time, _this]);
["DisarmDebugCallback", [_caller], [_caller, _target, _errorMsg]] call EFUNC(common,targetEvent);
};

View File

@ -23,4 +23,4 @@ params ["_logic"];
[_logic, QGVAR(PunishNonSpecialists),"PunishNonSpecialists"] call EFUNC(Common,readSettingFromModule);
[_logic, QGVAR(ExplodeOnDefuse),"ExplodeOnDefuse"] call EFUNC(Common,readSettingFromModule);
diag_log text "[ACE]: Explosive Module Initialized.";
ACE_LOGINFO("Explosive Module Initialized.");

View File

@ -36,7 +36,7 @@ if (!isNull _setupPlaceholderObject) then {
};
if (isNil "_triggerConfig") exitWith {
diag_log format ["ACE_Explosives: Error config not passed to PlaceExplosive: %1", _this];
ACE_LOGERROR(format ["Config not passed to PlaceExplosive: %1", _this]);
objNull
};
@ -44,7 +44,7 @@ _magazineTrigger = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Trigge
_triggerConfig = ConfigFile >> "ACE_Triggers" >> _triggerConfig;
if (isNil "_triggerConfig") exitWith {
diag_log format ["ACE_Explosives: Error config not found in PlaceExplosive: %1", _this];
ACE_LOGERROR(format ["Config not found in PlaceExplosive: %1", _this]);
objNull
};

View File

@ -1,6 +1,6 @@
//fnc_doSpall.sqf
#include "script_component.hpp"
// ACE_player sideChat "WAAAAAAAAAAAAAAAAAAAAA";
// ACE_player sideChat "WAAAAAAAAAAAAAAAAAAAAA";
private ["_hitData", "_initialData", "_hpData", "_object", "_foundObjects", "_index", "_foundObjecsts", "_roundType", "_round", "_caliber", "_explosive", "_idh", "_alive", "_exit", "_vm", "_velocity", "_oldVelocity", "_curVelocity", "_diff", "_polar", "_unitDir", "_spallPos", "_pos1", "_i", "_pos2", "_blah", "_data", "_spallPolar", "_warn", "_c", "_m", "_k", "_gC", "_fragPower", "_fragTypes", "_spread", "_spallCount", "_elev", "_dir", "_vel", "_spallFragVect", "_fragType", "_fragment", "_pos"];
@ -86,7 +86,7 @@ if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then {
if(_gC == 0) then { _gC = 2440; _warn = true;};
if(_warn) then {
diag_log text format["Ammo class %1 lacks proper explosive properties definitions for frag!", _roundType]; //TODO: turn this off when we get closer to release
ACE_LOGWARNING(format ["Ammo class %1 lacks proper explosive properties definitions for frag!", _roundType]); //TODO: turn this off when we get closer to release
};
_fragPower = (((_m/_c)+_k)^-(1/2))*_gC;

View File

@ -67,7 +67,7 @@ _gC = getNumber(configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_GURNEY_C");
if(_gC == 0) then { _gC = 2440; _warn = true;};
if(_warn) then {
diag_log text format["Ammo class %1 lacks proper explosive properties definitions for frag!", _shellType]; //TODO: turn this off when we get closer to release
ACE_LOGWARNING(format ["Ammo class %1 lacks proper explosive properties definitions for frag!", _shellType]); //TODO: turn this off when we get closer to release
};
_fragPower = (((_m/_c)+_k)^-(1/2))*_gC;
@ -187,9 +187,9 @@ if(_isArmed && (count _objects) > 0) then {
_sectorOffset = 360 * (_i - 1) / (_randomCount max 1);
_randomDir = random(_sectorSize);
_vec = [cos(_sectorOffset + _randomDir), sin(_sectorOffset + _randomDir), sin(30 - (random 45))];
_fp = (_fragPower-(random (_fragPowerRandom)));
_vel = _vec vectorMultiply _fp;
_fragType = round (random ((count _fragTypes)-1));
@ -197,7 +197,7 @@ if(_isArmed && (count _objects) > 0) then {
_fragObj setPosASL _lastPos;
_fragObj setVectorDir _vec;
_fragObj setVelocity _vel;
if(GVAR(traceFrags)) then {
GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1;
[ACE_player, _fragObj, [1,0.5,0,1]] call FUNC(addTrack);
@ -205,7 +205,7 @@ if(_isArmed && (count _objects) > 0) then {
_fragCount = _fragCount + 1;
};
};
};
// #ifdef DEBUG_MODE_FULL
// ACE_player sideChat format["total frags: %1", GVAR(TOTALFRAGS)];

View File

@ -21,4 +21,4 @@ if ((_logic getVariable "DisableEarRinging") != -1) then {
[_logic, QGVAR(DisableEarRinging), "DisableEarRinging"] call EFUNC(common,readSettingFromModule);
};
diag_log text "[ACE]: Hearing Module Initialized.";
ACE_LOGINFO("Hearing Module Initialized.");

View File

@ -44,7 +44,7 @@ if (_parentPath isEqualTo ["ACE_MainActions"]) then {
_parentNode = [_actionTrees, _parentPath] call FUNC(findActionNode);
if (isNil {_parentNode}) exitWith {
ERROR("Failed to add action");
diag_log text format ["action (%1) to parent %2 on object %3 [%4]", (_action select 0), _parentPath, _objectType, _typeNum];
ACE_LOGERROR(format ["action (%1) to parent %2 on object %3 [%4]", (_action select 0), _parentPath, _objectType, _typeNum]);
};
// Add action node as children of the correct node of action tree

View File

@ -26,4 +26,4 @@ if !(_activated) exitWith {};
[_logic, QGVAR(EnableTeamManagement), "EnableTeamManagement"] call EFUNC(common,readSettingFromModule);
diag_log text "[ACE]: Interaction Module Initialized.";
ACE_LOGINFO("Interaction Module Initialized.");

View File

@ -1,9 +1,9 @@
// This is a debug function for displaying visible lasers for ourselves
#include "script_component.hpp"
diag_log text format["[ACE]: Laser Emitter Dump"];
ACE_LOGINFO("Laser Emitter Dump");
{
diag_log text format[" %1", _x];
diag_log text format[" %2", HASH_GET(GVAR(laserEmitters), _x)];
} forEach GVAR(laserEmitters) select 0;
{
ACE_LOGINFO(format[" %1", _x]);
ACE_LOGINFO(format[" %2", HASH_GET(GVAR(laserEmitters), _x)]);
} forEach GVAR(laserEmitters) select 0;

View File

@ -84,6 +84,6 @@ switch (_currentWeaponType) do {
if (!_error) then {
[_description, _picture] call EFUNC(common,displayTextPicture);
} else {
diag_log text format ["Failed to add %1 to %2 - reverting to %3", _nextPointer, _weapon, _pointer];
ACE_LOGERROR(format ["Failed to add %1 to %2 - reverting to %3", _nextPointer, _weapon, _pointer]);
};
playSound "ACE_Sound_Click";

View File

@ -22,5 +22,5 @@ if !(_activated) exitWith {};
[_logic, QGVAR(BFT_Interval), "Interval"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(BFT_HideAiGroups), "HideAiGroups"] call EFUNC(common,readSettingFromModule);
diag_log text "[ACE]: Blue Force Tracking Module initialized.";
ACE_LOGINFO("Blue Force Tracking Module Initialized.");
TRACE_2("[ACE]: Blue Force Tracking Module initialized.", GVAR(BFT_Interval), GVAR(BFT_HideAiGroups));

View File

@ -23,4 +23,4 @@ if !(_activated) exitWith {};
[_logic, QGVAR(mapLimitZoom), "MapLimitZoom" ] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(mapShowCursorCoordinates), "MapShowCursorCoordinates"] call EFUNC(common,readSettingFromModule);
diag_log text "[ACE]: Map Module Initialized.";
ACE_LOGINFO("Map Module Initialized.");

View File

@ -17,8 +17,6 @@ private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_
_control = _this select 0;
_dir = _this select 1;
diag_log "Scroll";
diag_log _this;
_handled = false;
_handled = true;

View File

@ -284,7 +284,7 @@ if (USE_WOUND_EVENT_SYNC) then {
if (hasInterface) then {
["PlayerJip", {
diag_log format["[ACE] JIP Medical init for player"];
ACE_LOGINFO("JIP Medical init for player.");
[player] call FUNC(init);
}] call EFUNC(common,addEventHandler);
};

View File

@ -38,14 +38,14 @@ if (!hasInterface) exitWith {};
if (isClass (configFile >> "cfgPatches" >> "acre_api")) then {
diag_log text format ["[ACE_nametags] - ACRE Detected"];
ACE_LOGINFO("ACRE Detected.");
DFUNC(isSpeaking) = {
params ["_unit"];
(([_unit] call acre_api_fnc_isSpeaking) || {[ACE_player] call acre_api_fnc_isBroadcasting}) && {!(_unit getVariable ["ACE_isUnconscious", false])}
};
} else {
if (isClass (configFile >> "cfgPatches" >> "task_force_radio")) then {
diag_log text format ["[ACE_nametags] - TFR Detected"];
ACE_LOGINFO("TFR Detected.");
DFUNC(isSpeaking) = {
params ["_unit"];
(_unit getVariable ["tf_isSpeaking", false]) && {!(_unit getVariable ["ACE_isUnconscious", false])}

View File

@ -33,4 +33,4 @@ if ((_logic getVariable "showVehicleCrewInfo") != -1) then {
[_logic, QGVAR(showVehicleCrewInfo), "showVehicleCrewInfo" ] call EFUNC(common,readSettingFromModule);
};
diag_log text "[ACE]: NameTags Module Initialized.";
ACE_LOGINFO("Nametags Module Initialized.");

View File

@ -39,7 +39,7 @@ while {true} do {
if (_temperature < 1) exitWith {0};
if (isNil "_temperature") exitWith {
diag_log text format ["[ACE] ERROR: _totalTime = %1; _time = %2; _deltaTime = %3;", _totalTime, _time, _deltaTime];
ACE_LOGERROR(format ["_totalTime = %1; _time = %2; _deltaTime = %3;", _totalTime, _time, _deltaTime]);
0
};

View File

@ -27,8 +27,6 @@ if !(hasInterface) exitWith {};
// Listen for attempts to link ammo
["linkedAmmo", {
EXPLODE_3_PVT(_this,_receiver,_giver,_magazine);
diag_log "linkedAmmo";
diag_log _this;
private ["_magazineCfg","_magazineType"];
_magazineType = currentMagazine _receiver;
@ -62,8 +60,6 @@ if !(hasInterface) exitWith {};
// Listen for returned magazines
["returnedAmmo", {
EXPLODE_3_PVT(_this,_receiver,_giver,_magazine);
diag_log "returnedAmmo";
diag_log _this;
_receiver addMagazine _magazine;
}] call EFUNC(common,addEventhandler);

View File

@ -110,7 +110,7 @@ if (_type in _initializedClasses) exitWith {};
if (typeName _position == "STRING") exitWith {
_selection = _vehicle selectionPosition _position; // Selection name
};
diag_log text format ["[ACE] ERROR: Invalid custom position %1 of hitpoint %2 in vehicle %3", _position, _hitpoint, _vehicle];
ACE_LOGERROR(format ["Invalid custom position %1 of hitpoint %2 in vehicle %3.", _position, _hitpoint, _vehicle]);
};
} forEach (getArray _customSelectionsConfig);
};

View File

@ -31,4 +31,4 @@ if (!isServer) exitWith {};
[_logic, QGVAR(fullRepairLocation), "fullRepairLocation"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(engineerSetting_fullRepair), "engineerSetting_fullRepair"] call EFUNC(common,readSettingFromModule);
diag_log text "[ACE]: Repair Module Initialized.";
ACE_LOGINFO("Repair Module Initialized.");

View File

@ -1,15 +1,15 @@
/*
Name: ACE_Respawn_fnc_initRallypoint
Author(s):
commy2
Description:
init code for rally points
Parameters:
0: OBJECT - rally
Returns:
VOID
*/
@ -26,9 +26,9 @@ if (hasInterface) then {
// fix init having wrong position, vars etc.
[_rallypoint, _respawnMarker, _side, _name] spawn {
PARAMS_4(_rallypoint,_respawnMarker,_side,_name);
private ["_marker", "_type"];
_marker = format ["ACE_Marker_%1", _name];
// exit if it already exist
@ -65,5 +65,5 @@ if (isNil _name) then {
} else {
deleteVehicle _rallypoint;
diag_log text "[ACE] Respawn: ERROR Multiple Rallypoints of same type.";
ACE_LOGERROR("Multiple Rallypoints of same type.");
};

View File

@ -18,7 +18,7 @@
#include "script_component.hpp"
PARAMS_3(_logic,_units,_activated);
PARAMS_3(_logic,_units,_activated);
if !(isServer) exitWith {};
@ -45,4 +45,4 @@ if (isServer) then {
};
};
diag_log text "[ACE]: Respawn Module Initialized.";
ACE_LOGINFO("Respawn Module Initialized.");

View File

@ -1,17 +1,17 @@
/*
Name: ACE_Respawn_fnc_moduleFriendlyFire
Author(s):
commy2
Description:
initializes the Friendly Fire Messages module
Parameters:
0: OBJECT - logic
1: ARRAY<OBJECT> - synced units
2: BOOLEAN - activated
Returns:
VOID
*/
@ -19,7 +19,7 @@
#include "script_component.hpp"
_this spawn {
PARAMS_3(_logic,_units,_activated);
PARAMS_3(_logic,_units,_activated);
if !(_activated) exitWith {};
@ -28,5 +28,5 @@ _this spawn {
publicVariable QGVAR(showFriendlyFireMessage);
};
diag_log text "[ACE]: Friendly Fire Messages Module Initialized.";
ACE_LOGINFO("Friendly Fire Messages Module Initialized.");
};

View File

@ -1,17 +1,17 @@
/*
Name: ACE_Respawn_fnc_moduleRallypoint
Author(s):
commy2
Description:
initializes the Rallypoint module
Parameters:
0: OBJECT - logic
1: ARRAY<OBJECT> - synced units
2: BOOLEAN - activated
Returns:
VOID
*/
@ -26,4 +26,4 @@ if !(_activated) exitWith {};
_x setVariable ["ACE_canMoveRallypoint", true];
} forEach _units;
diag_log text "[ACE]: Rallypoint Module Initialized.";
ACE_LOGINFO("Rallypoint Module Initialized.");

View File

@ -22,4 +22,4 @@ if (!_activated) exitWith {};
[_logic, QGVAR(enable), "enable"] call EFUNC(common,readSettingFromModule);
diag_log text "[ACE]: Sitting Module Initialized.";
ACE_LOGINFO("Sitting Module Initialized.");

View File

@ -25,7 +25,7 @@ params ["_objects", "_controllers", "_images", "_names", "_duration"];
// Verify data
if (count _images != count _names || {count _images == 0} || {count _names == 0}) exitWith {
diag_log "[ACE] ERROR: Slideshow Images or Names fields can NOT be empty and must have equal number of items!"
ACE_LOGERROR("Slideshow Images or Names fields can NOT be empty and must have equal number of items!");
};
// Objects synced to the module
@ -56,7 +56,7 @@ _currentSlideshow = GVAR(slideshows); // Local variable in case GVAR gets change
// If interaction menu module is not present, set default duration value
if !(["ace_interact_menu"] call EFUNC(common,isModLoaded)) then {
_duration = 5;
diag_log text format ["[ACE]: Slideshow: Interaction Menu module not present, defaulting duration value to %1", _duration];
ACE_LOGINFO(format ["Interaction Menu module not present, defaulting duration value to %1", _duration]);
};
// Add interactions if automatic transitions are disabled, else setup automatic transitions

View File

@ -34,4 +34,4 @@ _duration = _logic getVariable ["Duration", 0];
// Prepare with actions
[_objects, _controllers, _images, _names, _duration] call FUNC(createSlideshow);
diag_log text format ["[ACE]: Slideshow Module Initialized for: %1 with Duration: %2", _objects, _duration];
ACE_LOGINFO(format ["Slideshow Module Initialized for: %1 with Duration: %2", _objects, _duration]);

View File

@ -35,4 +35,4 @@ GVAR(Module) = true;
[QGVAR(EnableSwitchUnits), true, false, true] call EFUNC(common,setSetting);
diag_log text "[ACE]: SwitchUnits Module Initialized.";
ACE_LOGINFO("Switch Unit Module Initialized.");

View File

@ -20,10 +20,10 @@ if (!isServer) exitWith {};
params ["_logic", "_units", "_activated"];
if (!_activated) exitWith {
diag_log text "[ACE]: View Distance Limit Module is placed but NOT active.";
ACE_LOGWARNING("View Distance Limit Module is placed but NOT active.");
};
[_logic, QGVAR(enabled),"moduleViewDistanceEnabled"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(limitViewDistance),"moduleViewDistanceLimit"] call EFUNC(common,readSettingFromModule);
diag_log format ["[ACE]: View Distance Limit Module Initialized. Limit set by module: %1",GVAR(limitViewDistance)];
ACE_LOGINFO(format ["View Distance Limit Module Initialized. Limit set by module: %1", GVAR(limitViewDistance)]);