allow respawn in base

This commit is contained in:
vbawol 2017-03-04 00:52:45 -06:00
parent 4a08ccf033
commit b2629ca10f
8 changed files with 97 additions and 36 deletions

View File

@ -3,11 +3,12 @@
[Added] Crafting recipe: Mortar (Uses: 12x Rock, 2x dirty water) (Requires: Fire and workbench within 3m). Thanks to @baaljayjay for the suggestion.
[Added] Customizability of units spawned by UAV alert via CfgEpochClient > uavAlertUnitSpawnTemplate. (Default: I_Soldier_EPOCH)
[Added] Toxic Smoke Grenades can now be found in the world.
[Added] Allow respawn in base at Jammer. Interact with Jammer and choose "Make Spawnpoint" to enable.
[Changed] Optimized database SET and SETEX calls in both SQF and C++.
[Changed] Optimized database GETRANGE call.
[Changed] Optimized NPC Trading and fixed issue if trade failed. Thanks to @Ignatz-HeMan
[Changed] Selling to traders with bank debt greater than -50000(default), pays the bank debt back to below the limit instead of the player. Purchasing is unaffected. Thanks to @Ignatz-HeMan
[Changed] Great White Sharks will now spawn if player is deep enough in the ocean.
[Changed] Great White Sharks will now spawn if the player is deep enough in the ocean.
[Changed] Objects or Players that have been given "Crypto" variable can be accessed via the dynamic menu (Space Bar) for a "Take Crypto" action.
[Changed] Air Drops are now triggered with Epoch Events server side every 45m instead of randomly triggered client side.
[Fixed] To prevent issues with ownership only Group Leader can place a Jammer. Thanks to @Ignatz-HeMan

View File

@ -1 +1 @@
5 "" !="bis_fnc_execvm \[\[.+\],\"initPlayerServer.sqf\"]" !="bis_fnc_effectkilled(airdestruction|secondaries) \[.+\]" !="epoch_server_checkplayer \[[A-Z]{1} [A-Za-z]{4,10} [0-9]{1,3}-[0-9]{1,3}:[0-9]{1,3}( \(.+\)|) REMOTE\]" !="epoch_server_(save(_vehicles|building)|(lock|pack)Storage|(upgrade|remove|paint|maint)build) \[.+\]" !="epoch_server_((load|respawn|dead|invite|revive|teleport)Player|(upgrade|updateplayer|create|delete)Group) \[.+\]" !="epoch_server_(deadplayerdetonate|triggerantagonist|playersetvariable|missioncomms|makemarker|removemarker) \[.+\]" !="epoch_server_(knockDownTree|mineRocks|lootAnimal|handle_(say3d|switchmove|sapperObjs)) \[.+\]" !="epoch_server_((repair|fill|lock)Vehicle|(loot|fill)Container|(store|take)Crypto|make(NPC|)Trade) \[.+\]" !="epoch_server_(tradeRequest|equippeditem|packJack|create(object|AirDrop)|airDropCrate|destroytrash|unpackBackpack) \[.+\]" !="epoch_(localcleanup|fnc_saveplayer|client_bitePlayer|serverlootobject) \[.+\]"
5 "" !="bis_fnc_execvm \[\[.+\],\"initPlayerServer.sqf\"]" !="bis_fnc_effectkilled(airdestruction|secondaries) \[.+\]" !="epoch_server_checkplayer \[[A-Z]{1} [A-Za-z]{4,10} [0-9]{1,3}-[0-9]{1,3}:[0-9]{1,3}( \(.+\)|) REMOTE\]" !="epoch_server_(save(_vehicles|building)|(lock|pack)Storage|(upgrade|remove|paint|maint)build) \[.+\]" !="epoch_server_((load|respawn|dead|invite|revive|teleport)Player|(upgrade|updateplayer|create|delete)Group) \[.+\]" !="epoch_server_(deadplayerdetonate|triggerantagonist|playersetvariable|missioncomms|make(marker|SP)|removemarker) \[.+\]" !="epoch_server_(knockDownTree|mineRocks|lootAnimal|handle_(say3d|switchmove|sapperObjs)) \[.+\]" !="epoch_server_((repair|fill|lock)Vehicle|(loot|fill)Container|(store|take)Crypto|make(NPC|)Trade) \[.+\]" !="epoch_server_(tradeRequest|equippeditem|packJack|create(object|AirDrop)|airDropCrate|destroytrash|unpackBackpack) \[.+\]" !="epoch_(localcleanup|fnc_saveplayer|client_bitePlayer|serverlootobject) \[.+\]"

View File

@ -107,6 +107,14 @@ class maintain_jammer
icon = "x\addons\a3_epoch_code\Data\UI\buttons\build_maintain.paa";
tooltip = "Maintain";
};
class select_jammer
{
condition = "dyna_cursorTargetType isEqualTo 'PlotPole_EPOCH' && (damage dyna_cursorTarget < 1)";
action = "[dyna_cursorTarget,player,Epoch_personalToken] remoteExec [""EPOCH_server_makeSP"",2];";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\player_inspect.paa";
tooltip = "Make Spawnpoint";
};
//lock unlock
class unlock_lockbox
{

View File

@ -286,6 +286,11 @@ class CfgRemoteExec
allowedTargets = 2;
jip = 0;
};
class EPOCH_server_makeSP
{
allowedTargets = 2;
jip = 0;
};
};
class Commands
{

View File

@ -62,7 +62,7 @@ if (!isNull _player) then {
// todo make dynamic
if (count _arr < 11) then { // invaild format attempt to override
_arr = [[0, [], _instanceID], [0, 0, 1, 0, []], [_goggles, _headgear, _vest, _backpack, _uniform, _class], [""], call EPOCH_defaultVars_SEPXVar, _weaponsAndItems, _linkedItems, _normalMagazines, _itemsInContainers, _weaponsInContainers, "", true];
_arr = [[0, [], _instanceID], [0, 0, 1, 0, []], [_goggles, _headgear, _vest, _backpack, _uniform, _class], [], call EPOCH_defaultVars_SEPXVar, _weaponsAndItems, _linkedItems, _normalMagazines, _itemsInContainers, _weaponsInContainers, "", true];
};
_worldspace = _arr select 0;
@ -78,7 +78,30 @@ if (!isNull _player) then {
_server_vars = _arr select 3;
_vars = _arr select 4;
// Get player group
_playerGroup = _arr select 10;
// check players group
if (_playerGroup != "") then {
_found = false;
(["Group", _playerGroup] call EPOCH_fnc_server_hiveGETRANGE) params [
["_status", 0, [0] ],
["_data", [], [[]] ]
];
if (_status == 1 && !(_data isEqualTo[])) then {
_data params ["","","","_modArray","_memberArray"];
_found = _playerGroup == _playerUID;
if (!_found) then {
{
if (_x select 0 == _playerUID) exitWith{_found = true;};
}forEach (_modArray + _memberArray);
};
};
if (!_found) then {
_playerGroup = "";
};
diag_log format["DEBUG (Load Player) Set Group: %1", _playerGroup];
};
_canBeRevived = _arr select 11;
_hitpoints = _vars select 11;
@ -86,10 +109,28 @@ if (!isNull _player) then {
_deadPlayer = ["PlayerStats", _playerUID, 0] call EPOCH_fnc_server_hiveGETBIT;
_alreadyDead = (_deadPlayer || (_medical select 3 == 1) || (_hitpoints select 2 == 1) || (_hitpoints select 3 == 1) || (_vars select 12 >= 180));
if (_alreadyDead || _prevInstance != _instanceID || (count _location) < 3 || !(_location isEqualType [])) then {
_dir = random 360;
_location = getMarkerPos "respawn_west";
_location set[2, 0];
// try to find respawn point by position
_newLocation = _server_vars param [0,[]]; // 0 = RESPAWN POS
if (_newLocation isEqualType [] && {(count _newLocation) == 3}) then {
_jammers = nearestObjects[_newLocation, ["PlotPole_EPOCH"], 1];
if !(_jammers isEqualTo[]) then {
// get nearby jammer
_jammer = _jammers param [0,objNull];
// check if jammer is not null and is alive.
if (!isNull _jammer && {alive _jammer}) then {
// check if player is still a member of jammers group.
if ((_jammer getVariable["BUILD_OWNER", "-1"]) in [getPlayerUID player, _playerGroup]) then {
_location = _newLocation;
};
};
};
} else {
_location = getMarkerPos "respawn_west";
_location set[2, 0];
};
if (_alreadyDead) then {
_vars = call EPOCH_defaultVars_SEPXVar;
_canBeRevived = true;
@ -262,36 +303,9 @@ if (!isNull _player) then {
_reject = false;
_playerGroupArray = [];
if (_playerGroup != "") then {
_response = ["Group", _playerGroup] call EPOCH_fnc_server_hiveGETRANGE;
_found = false;
if ((_response select 0) == 1 && (_response select 1) isEqualType [] && !((_response select 1) isEqualTo[])) then {
_playerGroupArray = _response select 1;
_found = _playerGroup == _playerUID;
if (!_found) then {
{
if (_x select 0 == _playerUID) exitWith{
_found = true;
};
}forEach(_playerGroupArray select 4);
};
if (!_found) then {
{
if (_x select 0 == _playerUID) exitWith{
_found = true;
};
}forEach(_playerGroupArray select 3);
};
if (_found) then {
_newPlyr setVariable["GROUP", _playerGroup];
};
};
if (!_found) then {
_playerGroup = "";
};
diag_log format["DEBUG (Load Player) Set Group: %1", _playerGroup];
};
if (_playerGroup != "") then {
_newPlyr setVariable["GROUP", _playerGroup];
};
_newPlyr setVariable["PUID", _playerUID];

View File

@ -0,0 +1,30 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors:
Description:
Select spawn point
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_player/EPOCH_server_selectSpawnpoint.sqf
*/
params [["_jammer",objNull],["_player",objNull],["_token",""]];
// check token
if !([_player, _token] call EPOCH_server_getPToken) exitWith{};
// require object
if (isNull _jammer) exitWith {};
// reject if player is too far away
if (_player distance _jammer > 20) exitWith{};
// check if in group with owner
if (alive _jammer) then {
if ((_jammer getVariable["BUILD_OWNER", "-1"]) in [getPlayerUID _player, _player getVariable["GROUP", ""]]) then {
// set position of spawnpoint to players SERVER_VARS
_server_vars = _player getVariable["SERVER_VARS", []];
_server_vars set [0, getposATL _jammer]; // 0 = RESPAWN POS
_player setVariable ["SERVER_VARS", _server_vars];
};
};

View File

@ -54,7 +54,9 @@ if (_allowSave) then{
};
_player setVariable ["VARS", _vars];
// Server Only Stats
/* SERVER_VARS INUSE INDEX:
0 = RESPAWN POS
*/
_server_vars = _player getVariable["SERVER_VARS", []];
_group = _player getVariable ["GROUP", ""];

View File

@ -52,6 +52,7 @@ class CfgServerFunctions
class fnc_addItemToX {};
class fnc_savePlayer {};
class server_savePlayer {};
class server_makeSP {};
class server_loadPlayer {};
class server_checkPlayer {};
class server_onPlayerDisconnect {};