Browse Source

remove some of the logging

m3ales 4 năm trước cách đây
mục cha
commit
ae659ff82d

+ 21 - 19
addons - Copy/RD501_AARF/functions/fn_arsenalSaveLoadoutHandler.sqf

@@ -1,22 +1,24 @@
 #include "function_macros.hpp"
 
-if(!hasInterface || !local this || isServer || player != this) exitWith{};
-_id = ["ace_arsenal_onLoadoutSave", {
-		params["_index", "_savedLoadout"];
-		//sadly this event is only called AFTER saving, cant modify/inject while save is happening
-		//LOGF_2("Loadout: %1 ::: %2", _loadoutIndex, _savedLoadout);
-		//get all loadouts
-		if(!GVAR(enabled)) exitWith {};
-		_loadouts = profileNamespace getVariable ["ace_arsenal_saved_loadouts", []];
-		//grab index for our loadout so we can update it
-		_items = _savedLoadout select 1;
-		_miscItems = _items select 9;
-		_selectedRadio = _miscItems select 2;
-		_miscItems set [2, GVAR(radio)];
-		LOGF_1("Added Radio to Misc Items: '%1'", _miscItems);
-		_loadouts set [_index, _savedLoadout];
-		_success = profileNamespace setVariable ["ace_arsenal_saved_loadouts", _loadouts];
-	}
-] call CBA_fnc_addEventHandler;
+if(!local this || isServer || player != this) exitWith{};
+if(hasInterface && ACE_Player == this) then {
+	_id = ["ace_arsenal_onLoadoutSave", {
+			params["_index", "_savedLoadout"];
+			//sadly this event is only called AFTER saving, cant modify/inject while save is happening
+			//LOGF_2("Loadout: %1 ::: %2", _loadoutIndex, _savedLoadout);
+			//get all loadouts
+			if(!GVAR(enabled)) exitWith {};
+			_loadouts = profileNamespace getVariable ["ace_arsenal_saved_loadouts", []];
+			//grab index for our loadout so we can update it
+			_items = _savedLoadout select 1;
+			_miscItems = _items select 9;
+			_selectedRadio = _miscItems select 2;
+			_miscItems set [2, GVAR(radio)];
+			LOGF_1("Added Radio to Misc Items: '%1'", _miscItems);
+			_loadouts set [_index, _savedLoadout];
+			_success = profileNamespace setVariable ["ace_arsenal_saved_loadouts", _loadouts];
+		}
+	] call CBA_fnc_addEventHandler;
 
-LOGF_2("Registered and loaded for '%1' with id '%2'", [this] call ace_common_fnc_getName, _id);
+	LOGF_2("Registered and loaded for '%1' with id '%2'", [this] call ace_common_fnc_getName, _id);
+};

+ 1 - 1
addons - Copy/RD501_Main/functions/heavy_weapon/fnc_heavyWeaponHandlePlayerWeaponChanged.sqf

@@ -23,7 +23,7 @@ private _fn_forceWalk = {
 	_target forceWalk true;
 };
 
-diag_log format["Weapon in array :: %1", (_weapon in RD501_FORCE_WALK_WEAPONS)];
+diag_log format["Weapon in force walk list :: %1", (_weapon in RD501_FORCE_WALK_WEAPONS)];
 if(_weapon in RD501_FORCE_WALK_WEAPONS) exitWith 
 {
 	if(!isForcedWalk _unit) then{

+ 35 - 35
addons - Copy/RD501_Main/functions/medical_notification/add_med_notification.sqf

@@ -1,36 +1,36 @@
-if(!hasInterface || !local this || isServer) exitWith{};
-RD501_MedNotif_lastMessageTime = 0;
+if(isServer || isDedicated || (!local this)) exitWith { };
+if(hasInterface && ACE_Player == this)then {
+        RD501_MedNotif_lastMessageTime = 0;
+        _id = ["ace_medicalMenuOpened", {
+                        params["_player", "_target", ""];
+                        //if(_player == _target) exitWith {};
+                        if(time - RD501_MedNotif_lastMessageTime < 1) exitWith {
 
-_id = ["ace_medicalMenuOpened", {
-                params["_player", "_target", ""];
-                //if(_player == _target) exitWith {};
-                if(time - RD501_MedNotif_lastMessageTime < 1) exitWith {
-
-                };
-                // if("ace_medical_pendingReopen") exitWith {diag_log format["RD501_MedNotif[DEBUG]: %1", "Pending Reopen, not displaying"]};
-                if(isNil "RD501_MedNotif_Message" || RD501_MedNotif_Message == "") then {
-                        diag_log format["RD501_MedNotif[DEBUG]: %1", format["Message not initialised, setting to default ('%1')", "%1 is asking that you kindly hold still."]];
-                        RD501_MedNotif_Message = "%1 is asking that you kindly hold still.";
-                };
-                _name = [_player] call ace_common_fnc_getName;
-                _targetName = [_target] call ace_common_fnc_getName;
-                if(_target getVariable["ACE_Unconscious", false]) exitWith {
-                        diag_log format["RD501_MedNotif[DEBUG]: %1", format["%1 is unconscious, ignoring", _targetName]];
-                };
-                if([_target] call ace_common_fnc_isMedic) then
-                {
-                        diag_log format["RD501_MedNotif[DEBUG]: %1", format["Displaying Medic Message to %1", _targetName]];
-                        _text = format[RD501_MedNotif_Message, _name];
-                        _image = "RD501_Main\ui_icons\medical_emblem.paa";
-                        _textHTML = format["<t align='center'>%1</t>", _text];
-                        _result = composeText [parseText format["<img size='2' align='center' color='%2' image='%1'/>", _image, [1,1,1] call BIS_fnc_colorRGBtoHTML], lineBreak, _text];
-                        ["ace_common_displayTextStructured", [_result, 2, _target], [_target]] call CBA_fnc_targetEvent;
-                }else
-                {
-                        diag_log format["RD501_MedNotif[DEBUG]: %1", format["Displaying Non Medic Message to %1", _targetName]];
-                        ["ace_common_displayTextStructured", [format[RD501_MedNotif_Message, _name], 2, _target], [_target]] call CBA_fnc_targetEvent;
-                };
-                RD501_MedNotif_lastMessageTime = time;
-        }] call CBA_fnc_addEventHandler;
-
-diag_log format["RD501_MedNotif[DEBUG]: %1", format["Registered and loaded for '%1'", this call ace_common_fnc_getName]];
+                        };
+                        // if("ace_medical_pendingReopen") exitWith {diag_log format["RD501_MedNotif[DEBUG]: %1", "Pending Reopen, not displaying"]};
+                        if(isNil "RD501_MedNotif_Message" || RD501_MedNotif_Message == "") then {
+                                diag_log format["RD501_MedNotif[DEBUG]: %1", format["Message not initialised, setting to default ('%1')", "%1 is asking that you kindly hold still."]];
+                                RD501_MedNotif_Message = "%1 is asking that you kindly hold still.";
+                        };
+                        _name = [_player] call ace_common_fnc_getName;
+                        _targetName = [_target] call ace_common_fnc_getName;
+                        if(_target getVariable["ACE_Unconscious", false]) exitWith {
+                                diag_log format["RD501_MedNotif[DEBUG]: %1", format["%1 is unconscious, ignoring", _targetName]];
+                        };
+                        if([_target] call ace_common_fnc_isMedic) then
+                        {
+                                diag_log format["RD501_MedNotif[DEBUG]: %1", format["Displaying Medic Message to %1", _targetName]];
+                                _text = format[RD501_MedNotif_Message, _name];
+                                _image = "RD501_Main\ui_icons\medical_emblem.paa";
+                                _textHTML = format["<t align='center'>%1</t>", _text];
+                                _result = composeText [parseText format["<img size='2' align='center' color='%2' image='%1'/>", _image, [1,1,1] call BIS_fnc_colorRGBtoHTML], lineBreak, _text];
+                                ["ace_common_displayTextStructured", [_result, 2, _target], [_target]] call CBA_fnc_targetEvent;
+                        }else
+                        {
+                                diag_log format["RD501_MedNotif[DEBUG]: %1", format["Displaying Non Medic Message to %1", _targetName]];
+                                ["ace_common_displayTextStructured", [format[RD501_MedNotif_Message, _name], 2, _target], [_target]] call CBA_fnc_targetEvent;
+                        };
+                        RD501_MedNotif_lastMessageTime = time;
+                }] call CBA_fnc_addEventHandler;
+        diag_log format["RD501_MedNotif[DEBUG]: %1", format["Registered and loaded for '%1'", this call ace_common_fnc_getName]];
+};

+ 1 - 5
addons - Copy/RD501_Main/functions/reload_on_select/fnc_onWeaponFiredSwapToEmpty.sqf

@@ -1,8 +1,4 @@
 #include "../../config_macros.hpp"
 params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo"];
-if(_unit ammo _muzzle > 0) exitWith
-{
-	diag_log format["fired skipped for %1", _muzzle];
-};
-diag_log format["Mag %1",_magazine];
+if(_unit ammo _muzzle > 0) exitWith {};
 [_unit, _weapon] call macro_fnc_name(swapToEmptyWeapon);

+ 0 - 1
addons - Copy/RD501_Main/functions/reload_on_select/fnc_reloadWeaponOnFirstSelected.sqf

@@ -4,7 +4,6 @@ if(_weapon in RD501_AUTO_RELOAD_ON_EQUIP) then
 {
 	diag_log "Weapon in list";
 	if(count (secondaryWeaponMagazine _unit) == 0) then {
-		diag_log "Weapon in list";
 		_magazineName = getArray(configFile >> "CfgWeapons" >> currentWeapon _unit >> "magazines") select 0; // TODO: Cache in postInit
 		diag_log format["AutoReloading with %1", _magazineName]; 
 		_unit removeMagazines _magazineName;