From 534abdbdf02092bbbd6007d0b434b6797bd0de8d Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Sat, 8 Oct 2016 14:49:59 -0400 Subject: [PATCH] Remove excessive door management config variables Too many config variables made this unnecessarily complicated. Most servers will want the defaults. For those that want to customize further they can easily overwrite these files. These seem like the most logical defaults to me. Allow all of these people to manage and unlock by default: - door owner - plot owner - plot friend - plot admin - door friend - door admin Door friends should be able to manage by default so they don't have to wait for the owner to come back online to add someone as a door friend. Plot friends and plot admins can get around the door by removing it and building another one anyway, so locking them out is pointless. It is still useful to have these as separate variables for servers that do not require plot poles though. Regular friendlies should not be included by default, since we have the more fine grained plot friends and door friends lists for that. Regular friendlies will probably be replaced by groups in the near future anyway. Please post a comment if there are any issues with these defaults I'm forgetting. Thanks. --- .../doorManagement/initDoorManagement.sqf | 14 +++++++------- SQF/dayz_code/compile/fn_check_access.sqf | 4 ++-- SQF/dayz_code/compile/fn_selfActions.sqf | 12 ++---------- SQF/dayz_code/compile/player_unlockDoor.sqf | 14 +++++++------- SQF/dayz_code/configVariables.sqf | 16 +--------------- 5 files changed, 19 insertions(+), 41 deletions(-) diff --git a/SQF/dayz_code/actions/doorManagement/initDoorManagement.sqf b/SQF/dayz_code/actions/doorManagement/initDoorManagement.sqf index 10409449f..3d6797044 100644 --- a/SQF/dayz_code/actions/doorManagement/initDoorManagement.sqf +++ b/SQF/dayz_code/actions/doorManagement/initDoorManagement.sqf @@ -14,13 +14,13 @@ _display closeDisplay 3000; // Check player access _isOwner = [player, TheDoor] call FNC_check_access; -if( ((_isOwner select 0) && DZE_doorManagementAllowManage_owner) // door owner - || ((_isOwner select 1) && DZE_doorManagementAllowManage_ownerFriendlies) // door owner's friendly tagged - || ((_isOwner select 2) && DZE_doorManagementAllowManage_plotOwner) // plot owner - || ((_isOwner select 3) && DZE_doorManagementAllowManage_plotFriends) // plot friends - || ((_isOwner select 4) && DZE_doorManagementAllowManage_plotAdmins) // plot management admins - || ((_isOwner select 5) && DZE_doorManagementAllowManage_doorFriends) // door friends - || ((_isOwner select 6) && DZE_doorManagementAllowManage_doorAdmins) // door management admins +if ( + (_isOwner select 0) or // door owner + (_isOwner select 2) or // plot owner + (_isOwner select 3) or // plot friend + (_isOwner select 4) or // plot admin + (_isOwner select 5) or // door friend + (_isOwner select 6) // door admin ) then { createDialog "DoorManagement"; call DoorNearbyHumans; diff --git a/SQF/dayz_code/compile/fn_check_access.sqf b/SQF/dayz_code/compile/fn_check_access.sqf index b0dadfd18..a551da543 100644 --- a/SQF/dayz_code/compile/fn_check_access.sqf +++ b/SQF/dayz_code/compile/fn_check_access.sqf @@ -32,8 +32,8 @@ private [ ,"_isPlotOwner" // return value ,"_isPlotFriend" // return value ,"_isPlotAdmin" // return value - ,"_isDoorFriend" // Only applicable if target is a door - ,"_isDoorAdmin" // Only applicable if target is a door + ,"_isDoorFriend" // return value - Only applicable if target is a door + ,"_isDoorAdmin" // return value - Only applicable if target is a door ,"_targetType" // return value ,"_targetOwnerUID" // UID or characterID of the owner of _target ,"_playerUID" // UID of the _player diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf index 43cd4e48c..77f932bde 100644 --- a/SQF/dayz_code/compile/fn_selfActions.sqf +++ b/SQF/dayz_code/compile/fn_selfActions.sqf @@ -786,18 +786,10 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur }; // Allow manage door - if( DZE_doorManagement && (_typeOfCursorTarget in DZE_DoorsLocked) ) then { + if (DZE_doorManagement && (_typeOfCursorTarget in DZE_DoorsLocked)) then { // Check player access _isOwner = [player, _cursorTarget] call FNC_check_access; - if( (s_player_manageDoor < 0) && ( - ((_isOwner select 0) && DZE_doorManagementAllowManage_owner) // door owner - || ((_isOwner select 1) && DZE_doorManagementAllowManage_ownerFriendlies) // door owner's friendly tagged - || ((_isOwner select 2) && DZE_doorManagementAllowManage_plotOwner) // plot owner - || ((_isOwner select 3) && DZE_doorManagementAllowManage_plotFriends) // plot friends - || ((_isOwner select 4) && DZE_doorManagementAllowManage_plotAdmins) // plot management admins - || ((_isOwner select 5) && DZE_doorManagementAllowManage_doorFriends) // door friends - || ((_isOwner select 6) && DZE_doorManagementAllowManage_doorAdmins) // door management admins - )) then { + if (s_player_manageDoor < 0 && ((_isOwner select 0) or (_isOwner select 2) or (_isOwner select 3) or (_isOwner select 4) or (_isOwner select 5) or (_isOwner select 6))) then { s_player_manageDoor = player addAction [format["%1", localize "STR_EPOCH_ACTIONS_MANAGEDOOR"], "\z\addons\dayz_code\actions\doorManagement\initDoorManagement.sqf", _cursorTarget, 5, false]; }; } else { diff --git a/SQF/dayz_code/compile/player_unlockDoor.sqf b/SQF/dayz_code/compile/player_unlockDoor.sqf index c9240801e..ab3d6e208 100644 --- a/SQF/dayz_code/compile/player_unlockDoor.sqf +++ b/SQF/dayz_code/compile/player_unlockDoor.sqf @@ -39,13 +39,13 @@ if (!isNull dayz_selectedDoor) then { if(DZE_doorManagement) then { // Check player access _isowner = [player, _obj] call FNC_check_access; - if( ((_isowner select 0) && DZE_doorManagementAllowAccess_owner) // door owner - || ((_isowner select 1) && DZE_doorManagementAllowAccess_ownerFriendlies) // door owner's friendly tagged - || ((_isowner select 2) && DZE_doorManagementAllowAccess_plotOwner) // plot owner - || ((_isowner select 3) && DZE_doorManagementAllowAccess_plotFriends) // plot friends - || ((_isowner select 4) && DZE_doorManagementAllowAccess_plotAdmins) // plot management admins - || ((_isowner select 5) && DZE_doorManagementAllowAccess_doorFriends) // door friends - || ((_isowner select 6) && DZE_doorManagementAllowAccess_doorAdmins) // door management admins + if ( + (_isOwner select 0) or // door owner + (_isOwner select 2) or // plot owner + (_isOwner select 3) or // plot friend + (_isOwner select 4) or // plot admin + (_isOwner select 5) or // door friend + (_isOwner select 6) // door admin ) then { DZE_Lock_Door = dayz_selectedDoor getVariable['CharacterID','0']; }; diff --git a/SQF/dayz_code/configVariables.sqf b/SQF/dayz_code/configVariables.sqf index 90636139a..33009926a 100644 --- a/SQF/dayz_code/configVariables.sqf +++ b/SQF/dayz_code/configVariables.sqf @@ -82,20 +82,6 @@ DZE_doorManagementMustBeClose = true; //Players must be within 10m of door to be DZE_doorManagementAdmins = []; //Array of admin PlayerUIDs enclosed in quotations, UIDs in this list are able to access every door's management menu and open it DZE_doorManagementAllowManualCode = true; //Allows opening doors still using PIN DZE_doorManagementMaxFriends = 10; //Maximum number of friends allowed on a door. -DZE_doorManagementAllowAccess_owner = true; // Allow unlock. -DZE_doorManagementAllowAccess_ownerFriendlies = false; -DZE_doorManagementAllowAccess_plotOwner = false; -DZE_doorManagementAllowAccess_plotFriends = false; -DZE_doorManagementAllowAccess_plotAdmins = false; -DZE_doorManagementAllowAccess_doorFriends = true; -DZE_doorManagementAllowAccess_doorAdmins = true; -DZE_doorManagementAllowManage_owner = true; // Beware managers can add themselves and others as door friends. -DZE_doorManagementAllowManage_ownerFriendlies = false; -DZE_doorManagementAllowManage_plotOwner = false; -DZE_doorManagementAllowManage_plotFriends = false; -DZE_doorManagementAllowManage_plotAdmins = false; -DZE_doorManagementAllowManage_doorFriends = false; -DZE_doorManagementAllowManage_doorAdmins = true; /* @@ -106,4 +92,4 @@ DZE_doorManagementAllowManage_doorAdmins = true; Variables that are map specific or frequently changed should be included in init.sqf by default with a corresponding if(isNil)then{}; in variables.sqf. -*/ +*/ \ No newline at end of file