1.7.5.D1202

This commit is contained in:
A Clark
2012-12-07 20:29:23 -06:00
parent 73f951f1cf
commit 5521090b9e
74 changed files with 1258 additions and 576 deletions

View File

@@ -0,0 +1,140 @@
/***********************************************************
most of the code is taken from fn_damageHandler.sqf
PROCESS DAMAGE TO A BOT
- Function
- [unit, selectionName, damage, source, projectile] call disco_damageHandler;
************************************************************/
private["_unit","_hit","_damage","_unconscious","_source","_ammo","_type","_isMinor","_isHeadHit","_inVehicle","_isPlayer",
"_humanityHit","_myKills","_characterID","_player_blood","_method"];
_unit = _this select 0;
_hit = _this select 1;
_damage = _this select 2;
_unconscious = _unit getVariable ["NORRN_unconscious", false];
_source = _this select 3;
_ammo = _this select 4;
_type = [_damage,_ammo] call fnc_usec_damageType;
_isMinor = (_hit in USEC_MinorWounds);
_isHeadHit = (_hit == "head_hit");
_inVehicle = (vehicle _unit != _unit);
_isPlayer = (isPlayer _source);
_humanityHit = 0;
_myKills = 0;
_characterID = _unit getVariable["CharacterID","0"];
_player_blood = _unit getVariable["USEC_BloodQty",12000];
_method = "";
private["_strH","_dam","_total","_totalDmg"];
_strH = "hit_" + (_hit);
_dam = _unit getVariable [_strH,0];
if ( _dam > 1 ) then { _dam = 1 };
// total damage for part
_total = _dam + _damage;
_unit setVariable [_strH,_total,true];
if (_characterID == "0") exitWith
{
diag_log "DEBUG: disco_damageHandler: CharacterID is 0";
};
// calculate damage for all parts
_totalDmg = 0;
{
_strH = "hit_" + _x;
_dam = _unit getVariable[_strH,0];
_totalDmg = _totalDmg + _dam;
} forEach USEC_woundHit;
private["_scale"];
//PVP Damage
_scale = 200;
if (_total > 0.4) then {
// maybe need to tune _scale value, 850 as in original
_scale = _scale + 850;
if (_isHeadHit) then {
_scale = _scale + 500;
};
// seems need different scale for type 1,2
switch (_type) do {
case 1: {_scale = _scale + 200};
case 2: {_scale = _scale + 200};
};
//Cause blood loss
_player_blood = _player_blood - (_total * _scale);
};
//Record Damage to Minor parts (legs, arms)
if ( (_hit == "legs") && (_total == 1) ) then { _unit setVariable ["hit_legs",1,true]; };
if ( (_hit == "hands") && (_total == 1) ) then { _unit setVariable ["hit_hands",1,true]; };
private["_wound","_isHit","_rndPain","_isInjured","_rndInfection","_rndPain","_hitPain","_inPain","_hitInfection"];
// common damage first
if (_totalDmg > 4) then {
if ( _type == 0 ) then {
// TODO: add appropriate _method and message when study
_method = "unknown";
};
if ( _type == 1 ) then {
//TODO: add message when study
_method = "explosion";
};
if ( _type == 2 ) then {
//serious ballistic damage
_method = "shotheavy";
};
};
if ((_total > 1) and _isHeadHit) then {
// head hit
_method = "shothead";
};
if ( _player_blood < 50 ) then {
// blood loss
_method = "bleed";
};
if ( _method !="" ) then {
// process death
[_unit,_source,_method] spawn disco_playerDeath;
} else {
// still alive?
if (_total > 0.4) then { //0.25
/* BLEEDING */
_wound = _hit call fnc_usec_damageGetWound;
_isHit = _unit getVariable[_wound,false];
// diag_log format["DEBUG: wound:%1 [%2]",_wound,_isHit];
_rndPain = (random 10);
_rndInfection = (random 1000);
_hitPain = (_rndPain < _total);
if (_isHeadHit or _hitPain) then {
_hitPain = true;
};
_hitInfection = (_rndInfection < 1);
if (_isHit) then {
//Make hit worse
_player_blood = _player_blood - 50;
};
if (_hitInfection) then {
//Set Infection if not already
_unit setVariable["USEC_infected",true,true];
};
if (_hitPain) then {
//Set Pain if not already
_unit setVariable["USEC_inPain",true,true];
};
};
private["_isInjured"];
if(!_isHit) then {
//Create Wound
// diag_log format["DEBUG: spawn bleed %1",_wound];
_unit setVariable[_wound,true,true];
[_unit,_wound,_hit] spawn fnc_usec_damageBleed;
usecBleed = [_unit,_wound,_hit];
publicVariable "usecBleed";
//Set Injured if not already
_isInjured = _unit getVariable["USEC_injured",false];
if (!_isInjured) then {
_unit setVariable["USEC_injured",true,true];
};
};
_unit setVariable["USEC_BloodQty",_player_blood,true];
};

View File

@@ -0,0 +1,54 @@
/*
[_object,_source,_method] spawn disco_playerDeath;
*/
private["_object","_source","_method","_key","_playerID","_characterID","_playerName","_isDead"];
_object = _this select 0;
_source = _this select 1;
_method = _this select 2;
_playerID = _object getVariable["playerID","0"]; //playerUID
_characterID = _object getVariable["characterID","0"]; //characterID
_playerName = _object getVariable["bodyName","unknown"];
_isDead = _object getVariable["USEC_isDead",false];
_humanity = 0;
_wait = 0;
_object removeAllEventHandlers "HandleDamage";
if (!_isDead) then {
_id = [_characterID,0,_object,_playerID,_playerName,_source,_method] spawn server_playerDied;
_object setDamage 1;
_object setVariable["USEC_isDead",true,true];
dayzFlies = _object;
publicVariable "dayzFlies";
_id = [_object,50,true,getPosATL _object] spawn player_alertZombies;
private["_canHitFree","_isBandit","_myKills","_humanity","_killsH","_wait","_killsB"];
if (!isNull _source) then {
if (_source != _object) then {
_canHitFree = _object getVariable ["freeTarget",false];
_isBandit = (typeOf _object) == "Bandit1_DZ";
_myKills = ((_object getVariable ["humanKills",0]) / 30) * 1000;
if (!_canHitFree and !_isBandit) then {
//Process Morality Hit
_humanity = -(2000 - _myKills);
_killsH = _source getVariable ["humanKills",0];
_source setVariable ["humanKills",(_killsH + 1),true];
_wait = 300;
} else {
//Process Morality Hit
//_humanity = _myKills * 100;
_killsB = _source getVariable ["banditKills",0];
_source setVariable ["banditKills",(_killsB + 1),true];
_wait = 0;
};
if (_humanity < 0) then {
_wait = 0;
};
if (!_canHitFree and !_isBandit) then {
dayzHumanity = [_source,_humanity,_wait];
publicVariable "dayzHumanity";
};
};
};
_object setVariable ["deathType",_method,true];
};

View File

@@ -0,0 +1,218 @@
/*
[_object,_playerID,_characterID,_penalty] spawn disco_playerMorph;
*/
private["_object","_playerID","_characterID","_playerName","_model","_position","_dir","_currentAnim","_penalty"];
_object = _this select 0;
// TODO: check
_playerID = _this select 1; //playerUID
_characterID = _this select 2; //characterID
_penalty = _this select 3;
_playerName = _object getVariable["bodyName","unknown"]; //name _object;
_model = typeOf _object;
_position = getPosATL _object;
_dir = getDir _object;
_currentAnim = animationState _object;
_object removeAllEventHandlers "FiredNear";
_object removeAllEventHandlers "HandleDamage";
_object removeAllEventHandlers "Killed";
_object removeAllEventHandlers "Fired";
private["_updates","_humanity","_legs","_arms","_medical","_worldspace","_zombieKills","_headShots","_humanKills","_banditKills","_temp"];
// TODO: check
_updates = _object getVariable["updatePlayer",[false,false,false,false,false]];
_updates set [0,true];
_object setVariable["updatePlayer",_updates,true];
_humanity = _object getVariable["humanity",0];
_temp = round(_object getVariable ["temperature",100]);
_worldspace = [round(_dir),_position];
_zombieKills = _object getVariable ["zombieKills",0];
_headShots = _object getVariable ["headShots",0];
_humanKills = _object getVariable ["humanKills",0];
_banditKills = _object getVariable ["banditKills",0];
_medical = _object call player_sumMedical;
_messing = _object getVariable ["messing",[0,0]];
//BackUp Weapons and Mags
private ["_weapons","_magazines","_primweapon","_secweapon"];
_weapons = weapons _object;
_magazines = magazines _object;
_primweapon = primaryWeapon _object;
_secweapon = secondaryWeapon _object;
//Checks
if(!(_primweapon in _weapons) && _primweapon != "") then {
_weapons = _weapons + [_primweapon];
};
if(!(_secweapon in _weapons) && _secweapon != "") then {
_weapons = _weapons + [_secweapon];
};
if(count _magazines == 0) then {
_magazines = magazines _object;
};
//BackUp Backpack
private ["_newBackpackType","_backpackWpn","_backpackMag"];
_newBackpackType = typeOf (unitBackpack _object);
if(_newBackpackType != "") then {
_backpackWpn = getWeaponCargo unitBackpack _object;
_backpackMag = getMagazineCargo unitBackpack _object;
};
//Get Muzzle
private ["_currentWpn","_muzzles"];
_currentWpn = "";
_muzzles = getArray(configFile >> "cfgWeapons" >> _currentWpn >> "muzzles");
if (count _muzzles > 1) then {
_currentWpn = currentMuzzle _object;
};
private ["_primary"];
_doLoop = 0;
while {_doLoop < 5} do {
_key = format["CHILD:101:%1:%2:%3:",_playerID,dayZ_instance,_playerName];
_primary = [_key,false,dayZ_hivePipeAuth] call server_hiveReadWrite;
if (count _primary > 0) then {
if ((_primary select 0) != "ERROR") then {
_doLoop = 9;
};
};
_doLoop = _doLoop + 1;
};
private ["_group","_newUnit"];
// get ammo from DB
_magazines = (_primary select 4) select 1;
//Create New Character
_group = createGroup civilian;
_newUnit = _group createUnit [_model,[0,0,0],[],0,"NONE"];
sleep 0.1;
//Clear New Character
{_newUnit removeMagazine _x;} forEach (magazines _newUnit);
removeAllWeapons _newUnit;
//Equip New Charactar
{ _newUnit addMagazine _x } forEach _magazines;
{ _newUnit addWeapon _x } forEach _weapons;
if(_primweapon != (primaryWeapon _newUnit)) then { _newUnit addWeapon _primweapon };
if(_secweapon != (secondaryWeapon _newUnit) && _secweapon != "") then { _newUnit addWeapon _secweapon };
//Add and Fill BackPack
private["_newBackpack","_countr","_backpackmagTypes","_backpackmagQtys"];
if (!isNil "_newBackpackType") then {
if (_newBackpackType != "") then {
_newUnit addBackpack _newBackpackType;
_newBackpack = unitBackpack _newUnit;
//Fill backpack contents
//Weapons
_backpackWpnTypes = [];
_backpackWpnQtys = [];
if (count _backpackWpn > 0) then {
_backpackWpnTypes = _backpackWpn select 0;
_backpackWpnQtys = _backpackWpn select 1;
};
_countr = 0;
{
_newBackpack addWeaponCargoGlobal [_x,(_backpackWpnQtys select _countr)];
_countr = _countr + 1;
} forEach _backpackWpnTypes;
//magazines
_backpackmagTypes = [];
_backpackmagQtys = [];
if (count _backpackmag > 0) then {
_backpackmagTypes = _backpackMag select 0;
_backpackmagQtys = _backpackMag select 1;
};
_countr = 0;
{
_newBackpack addmagazineCargoGlobal [_x,(_backpackmagQtys select _countr)];
_countr = _countr + 1;
} forEach _backpackmagTypes;
};
};
//set medical values
private["_fractures"];
if (count _medical > 0) then {
_newUnit setVariable["USEC_isDead",(_medical select 0),true];
_newUnit setVariable["NORRN_unconscious", (_medical select 1), true];
_newUnit setVariable["USEC_infected",(_medical select 2),true];
_newUnit setVariable["USEC_injured",(_medical select 3),true];
_newUnit setVariable["USEC_inPain",(_medical select 4),true];
_newUnit setVariable["USEC_isCardiac",(_medical select 5),true];
_newUnit setVariable["USEC_lowBlood",(_medical select 6),true];
_newUnit setVariable["USEC_BloodQty",(_medical select 7),true];
_newUnit setVariable["unconsciousTime",(_medical select 10),true];
//Add Wounds
{
_newUnit setVariable[_x,true,true];
[_newUnit,_x,0] spawn fnc_usec_damageBleed;
usecBleed = [_newUnit,_x,0];
publicVariable "usecBleed";
} forEach (_medical select 8);
//Add fractures
_fractures = (_medical select 9);
_newUnit setVariable ["hit_legs",(_fractures select 0),true];
_newUnit setVariable ["hit_hands",(_fractures select 1),true];
} else {
//Reset Fractures
_newUnit setVariable ["hit_legs",0,true];
_newUnit setVariable ["hit_hands",0,true];
_newUnit setVariable ["USEC_injured",false,true];
_newUnit setVariable ["USEC_inPain",false,true];
};
//General Stats
_newUnit setVariable["characterID",_characterID,true];
_newUnit setVariable["worldspace",_worldspace,true];
_newUnit setVariable["bodyName",_playerName,true];
//_newUnit setVariable["playerID",_playerID,true];
_newUnit setVariable["temperature",_temp,true];
_newUnit setVariable["messing",_messing,true];
//Move to position
_newUnit allowDamage true;
deleteVehicle _object;
deleteGroup (group _object);
_newUnit setDir _dir;
_newUnit setPosATL _position;
_newUnit playActionNow "Die";
_newUnit disableConversation true;
_newUnit setCaptive false;
// _newUnit disableAi "ANIM";
// <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
//_newUnit addWeapon "Loot";
//_newUnit addWeapon "Flare";
botPlayers = botPlayers + [_playerID];
private["_mydamage_eh1"];
_mydamage_eh1 = _newUnit addeventhandler ["HandleDamage",{ _this call disco_damageHandler;0 }];
diag_log format["DEBUG: Player %1 [%2] added to botPlayers: %3",_playerName,_playerID,botPlayers];
private["_doLoop","_isDead"];
_isDead = _newUnit getVariable["USEC_isDead",false];
_doLoop = 0;
while { _doLoop < _penalty && !_isDead } do {
_isDead = _newUnit getVariable["USEC_isDead",false];
_doLoop = _doLoop + 1;
sleep 1;
};
_newUnit removeAllEventHandlers "handleDamage";
if (!_isDead) then {
private["_playerBackp"];
_medical = _newUnit call player_sumMedical;
_newBackpack = unitBackpack _newUnit;
_playerBackp = [typeOf _newBackpack,getWeaponCargo _newBackpack,getMagazineCargo _newBackpack];
// _group = group _newUnit;
deleteVehicle _newUnit;
deleteGroup _group;
//Send to HIVE backpack and medical only
[_characterID,_worldspace,[],_playerBackp,_medical,[],""] call server_characterSync;
};
botPlayers = botPlayers - [_playerID];
diag_log format["DEBUG: Player %1 [%2] removed from botPlayers: %3",_playerName,_playerID,botPlayers];

View File

@@ -15,14 +15,9 @@ if (vehicle _object != _object) then {
_object action ["eject", vehicle _object];
};
if (59 in _playerIDtoarray) exitWith { diag_log ("Exited"); };
if (59 in _playerIDtoarray) exitWith { };
if ((_timeout - time) > 0) then {
//_playerName call player_combatLogged;
private["_playerName","_center","_group"];
_playerName = name player;
_timeout = _object getVariable["combattimeout",0];
diag_log format["COMBAT LOGGED: %1 (%2)", _playerName,_timeout];
};
@@ -35,6 +30,10 @@ if (!isNull _object) then {
(nearestObjects [getPosATL _object, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage", "VaultStorage"], 10]);
if (alive _object) then {
[_object,[],true] call server_playerSync;
if ((_timeout - time) > 0) then {
// spawn bot, if player in combat mode
[_object,_playerID,_characterID,30] spawn disco_playerMorph;
};
_id = [_playerID,_characterID,2] spawn dayz_recordLogin;
_myGroup = group _object;
deleteVehicle _object;

View File

@@ -1,4 +1,4 @@
private["_int","_newModel","_doLoop","_wait","_hiveVer","_isHiveOk","_playerID","_playerObj","_randomSpot","_publishTo","_primary","_secondary","_key","_result","_charID","_playerObj","_playerName","_finished","_spawnPos","_spawnDir","_items","_counter","_magazines","_weapons","_group","_backpack","_worldspace","_direction","_newUnit","_score","_position","_isNew","_inventory","_backpack","_medical","_survival","_stats","_state"];
private["_botActive","_int","_newModel","_doLoop","_wait","_hiveVer","_isHiveOk","_playerID","_playerObj","_randomSpot","_publishTo","_primary","_secondary","_key","_result","_charID","_playerObj","_playerName","_finished","_spawnPos","_spawnDir","_items","_counter","_magazines","_weapons","_group","_backpack","_worldspace","_direction","_newUnit","_score","_position","_isNew","_inventory","_backpack","_medical","_survival","_stats","_state"];
//Set Variables
diag_log ("STARTING LOGIN: " + str(_this));
@@ -27,6 +27,7 @@ _state = [];
_direction = 0;
_model = "";
_newUnit = objNull;
_botActive = false;
if (_playerID == "") then {
_playerID = getPlayerUID _playerObj;
@@ -35,8 +36,14 @@ if (_playerID == "") then {
if ((_playerID == "") or (isNil "_playerID")) exitWith {
diag_log ("LOGIN FAILED: Player [" + _playerName + "] has no login ID");
};
// spawn a waituntil if bot still on server, then run server_playerLogin later again
_botActive = _playerID in botPlayers;
if (_botActive) then { _this spawn server_waitForBotFinished;};
if (_botActive) exitWith{};
penaltyTimeout = false;
(owner _playerObj) publicVariableClient "penaltyTimeout";
endLoadingScreen;
//??? endLoadingScreen;
diag_log ("LOGIN ATTEMPT: " + str(_playerID) + " " + _playerName);
//Do Connection Attempt
@@ -103,7 +110,7 @@ if (!_isNew) then {
//Wait for HIVE to be free
_key = format["CHILD:203:%1:%2:%3:",_charID,[_wpns,_mags],[_bcpk,[],[]]];
_key spawn server_hiveWrite;
_key call server_hiveWrite;
};
diag_log ("LOGIN LOADED: " + str(_playerObj) + " Type: " + (typeOf _playerObj));
@@ -117,8 +124,5 @@ if (_hiveVer >= dayz_hiveVersionNo) then {
//Server publishes variable to clients and WAITS
//_playerObj setVariable ["publish",[_charID,_inventory,_backpack,_survival,_isNew,dayz_versionNo,_model,_isHiveOk,_newPlayer],true];
_clientID = owner _playerObj;
dayzPlayerLogin = [_charID,_inventory,_backpack,_survival,_isNew,dayz_versionNo,_model,_isHiveOk,_newPlayer];
_clientID publicVariableClient "dayzPlayerLogin";
//_playerObj enableSimulation false;
(owner _playerObj) publicVariableClient "dayzPlayerLogin";

View File

@@ -1,4 +1,4 @@
private ["_characterID","_doLoop","_playerID","_playerObj","_randomSpot","_primary","_key","_worldspace","_score","_position","_pos","_isIsland","_medical","_stats","_state","_dummy","_debug","_distance","_hit","_fractures","_w","_findSpot","_humanity","_clientID","_lastinstance"];
private["_characterID","_playerObj","_playerID","_dummy","_worldspace","_state","_doLoop","_key","_primary","_medical","_stats","_humanity","_lastinstance","_randomSpot","_position","_debug","_distance","_hit","_fractures","_score","_findSpot","_mkr","_counter","_isNear","_isZero","_pos","_isIsland","_w","_clientID"];
//Wait for HIVE to be free
//diag_log ("SETUP: attempted with " + str(_this));

View File

@@ -1,4 +1,4 @@
private ["_characterID","_temp","_currentWpn","_magazines","_force","_isNewPos","_humanity","_isNewGear","_currentModel","_modelChk","_playerPos","_playerGear","_playerBackp","_backpack","_killsB","_killsH","_medical","_isNewMed","_character","_timeSince","_charPos","_isInVehicle","_distanceFoot","_lastPos","_kills","_headShots","_timeGross","_timeLeft","_onLadder","_isTerminal","_currentAnim","_muzzles","_array","_key","_lastTime","_config","_currentState","_pos"];
private["_character","_magazines","_force","_characterID","_charPos","_isInVehicle","_timeSince","_humanity","_debug","_distance","_isNewMed","_isNewPos","_isNewGear","_playerPos","_playerGear","_playerBackp","_medical","_distanceFoot","_lastPos","_backpack","_kills","_killsB","_killsH","_headShots","_lastTime","_timeGross","_timeLeft","_currentWpn","_currentAnim","_config","_onLadder","_isTerminal","_wpnDisabled","_currentModel","_modelChk","_muzzles","_temp","_currentState","_array","_key","_pos"];
//[player,array]
//diag_log ("UPDATE: " + str(_this) );

View File

@@ -5,10 +5,12 @@ _object = _this select 1;
_worldspace = _this select 2;
_class = _this select 3;
if (!(_object isKindOf "Building")) exitWith {
deleteVehicle _object;
};
_allowed = [_object] call check_publishobject;
if (!_allowed) exitWith { };
//diag_log ("PUBLISH: Attempt " + str(_object));

View File

@@ -82,6 +82,7 @@ _object_damage = {
_hit = [_object,_x] call object_getHit;
_selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");
if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};
_object setHit ["_selection", _hit]
} forEach _hitpoints;
_key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage];
diag_log ("HIVE: WRITE: "+ str(_key));

View File

@@ -1,5 +1,11 @@
waituntil {!isnil "bis_fnc_init"};
BIS_MPF_remoteExecutionServer = {
if ((_this select 1) select 2 == "JIPrequest") then {
[nil,(_this select 1) select 0,"loc",rJIPEXEC,[any,any,"per","execVM","ca\Modules\Functions\init.sqf"]] call RE;
};
};
BIS_Effects_Burn = {};
object_spawnDamVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_spawnDamVehicle.sqf";
server_playerLogin = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerLogin.sqf";
@@ -15,8 +21,17 @@ local_deleteObj = compile preprocessFileLineNumbers "\z\addons\dayz_code\comp
local_createObj = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_createObj.sqf"; //Creates the object in DB
server_playerSync = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerSync.sqf";
zombie_findOwner = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\zombie_findOwner.sqf";
//server_updateNearbyObjects = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_updateNearbyObjects.sqf";
disco_playerMorph = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\disco_playerMorph.sqf";
disco_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\disco_damageHandler.sqf";
disco_playerDeath = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\disco_playerDeath.sqf";
server_updateNearbyObjects = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_updateNearbyObjects.sqf";
server_waitForBotFinished = {
private ["_playerId"];
_playerID = _this select 0;
waituntil{sleep 1; !(_playerID in botPlayers)};
_this call server_playerLogin;
};
vehicle_handleInteract = {
private["_object"];
@@ -24,8 +39,26 @@ vehicle_handleInteract = {
[_object, "all"] call server_updateObject;
};
player_combatLogged = {
check_publishobject = {
private["_allowed","_allowedObjects","_object"];
_object = _this select 0;
_allowedObjects = ["TentStorage", "Hedgehog_DZ", "Sandbag1_DZ","TrapBear","Wire_cat1"];
_noncombatitems = ["ThrownObjects", "RoadFlare", "ChemLight"];
_allowed = false;
diag_log format ["DEBUG: Checking if Object: %1 is allowed", _object];
if ((typeOf _object) in _allowedObjects) then {
diag_log format ["DEBUG: Object: %1 Safe",_object];
_allowed = true;
};
if ((typeOf _object) in _noncombatitems) then {
diag_log format ["DEBUG: NONCombat: %1 Safe",_object];
_allowed = true;
};
_allowed;
};
//event Handlers
@@ -37,7 +70,21 @@ eh_localCleanup = {
private["_type","_unit"];
_unit = _this select 0;
_type = typeOf _unit;
_myGroupUnit = group _unit;
_unit removeAllMPEventHandlers "mpkilled";
_unit removeAllMPEventHandlers "mphit";
_unit removeAllMPEventHandlers "mprespawn";
_unit removeAllEventHandlers "FiredNear";
_unit removeAllEventHandlers "HandleDamage";
_unit removeAllEventHandlers "Killed";
_unit removeAllEventHandlers "Fired";
_unit removeAllEventHandlers "GetOut";
_unit removeAllEventHandlers "GetIn";
_unit removeAllEventHandlers "Local";
clearVehicleInit _unit;
deleteVehicle _unit;
deleteGroup _myGroupUnit;
_unit = nil;
diag_log ("CLEANUP: DELETED A " + str(_type) );
};
}];

View File

@@ -4,30 +4,29 @@
item0[] = {"init",0,250,-75.000000,-400.000000,25.000000,-350.000000,0.000000,"init"};
item1[] = {"true",8,218,-75.000000,-175.000000,25.000000,-125.000000,0.000000,"true"};
item2[] = {"waiting",2,250,-75.000000,-100.000000,25.000000,-50.000000,0.000000,"waiting"};
item3[] = {"too_many_dead",4,218,-150.000000,-25.000000,-50.000000,25.000000,2.000000,"too many" \n "dead"};
item4[] = {"cleanup_dead",2,250,-150.000000,50.000000,-50.000000,100.000000,0.000000,"cleanup" \n "dead"};
item5[] = {"too_many_objects",4,218,-25.000000,-25.000000,75.000000,25.000000,0.000000,"too many" \n "objects"};
item6[] = {"cleanup_objects",2,250,-25.000000,50.000000,75.000000,100.000000,0.000000,"cleanup" \n "objects"};
item7[] = {"time_sync",4,218,-275.000000,-25.000000,-175.000000,25.000000,1.000000,"time" \n "sync"};
item8[] = {"sync_the_time",2,250,-275.000000,50.000000,-175.000000,100.000000,0.000000,"sync" \n "the time"};
item3[] = {"time_dead",4,218,-300.000000,-25.000000,-200.000000,25.000000,4.000000,"time" \n "dead"};
item4[] = {"cleanup_dead",2,250,-300.000000,50.000000,-200.000000,100.000000,0.000000,"cleanup" \n "dead"};
item5[] = {"time_items",4,218,0.000000,-25.000000,100.000000,25.000000,2.000000,"time" \n "items"};
item6[] = {"cleanup_items",2,250,0.000000,50.000000,100.000000,100.000000,0.000000,"cleanup" \n "items"};
item7[] = {"time_sync",4,218,-150.000000,-25.000000,-50.000000,25.000000,3.000000,"time" \n "sync"};
item8[] = {"sync_the_time",2,250,-150.000000,50.000000,-50.000000,100.000000,0.000000,"sync" \n "the time"};
item9[] = {"true",8,218,-75.000000,125.000000,25.000000,175.000000,0.000000,"true"};
item10[] = {"general_cleanup",2,250,-75.000000,200.000000,25.000000,250.000000,0.000000,"general" \n "cleanup"};
item11[] = {"",7,210,-304.000000,220.999985,-296.000000,229.000015,0.000000,""};
item12[] = {"",7,210,-304.000000,-154.000000,-296.000000,-146.000000,0.000000,""};
item13[] = {"",7,210,221.000000,-79.000000,229.000000,-71.000000,0.000000,""};
item14[] = {"",7,210,221.000000,146.000000,229.000000,154.000000,0.000000,""};
item15[] = {"initialized",4,218,-75.000000,-325.000000,25.000000,-275.000000,0.000000,"initialized"};
item16[] = {"prepare",2,250,-75.000000,-250.000000,25.000000,-200.000000,0.000000,"prepare"};
item17[] = {"update_objects",2,4346,100.000000,50.000000,200.000000,100.000000,0.000000,"update objects"};
item18[] = {"need_update",4,218,100.000000,-25.000000,200.000000,25.000000,1.000000,"need update"};
item19[] = {"",7,210,221.000000,-79.000000,229.000000,-71.000000,0.000000,""};
link0[] = {0,15};
item11[] = {"",7,210,-341.500000,220.999985,-333.500000,229.000015,0.000000,""};
item12[] = {"",7,210,-341.500000,-154.000000,-333.500000,-146.000000,0.000000,""};
item13[] = {"initialized",4,218,-75.000000,-325.000000,25.000000,-275.000000,0.000000,"initialized"};
item14[] = {"prepare",2,250,-75.000000,-250.000000,25.000000,-200.000000,0.000000,"prepare"};
item15[] = {"update_objects",2,250,150.000000,50.000000,250.000000,100.000000,0.000000,"update objects"};
item16[] = {"time_obj_update",4,218,150.000000,-25.000000,250.000000,25.000000,1.000000,"time" \n "obj update"};
item17[] = {"anti_hack",4,218,150.000000,-100.000000,250.000000,-50.000000,0.000000,"anti hack"};
item18[] = {"check_for_hacker",2,4346,150.000000,-175.000000,250.000000,-125.000000,0.000000,"check for" \n "hackers"};
link0[] = {0,13};
link1[] = {1,2};
link2[] = {2,3};
link3[] = {2,5};
link4[] = {2,7};
link5[] = {2,13};
link6[] = {2,18};
link5[] = {2,16};
link6[] = {2,17};
link7[] = {3,4};
link8[] = {4,9};
link9[] = {5,6};
@@ -39,14 +38,13 @@ link14[] = {10,11};
link15[] = {11,12};
link16[] = {12,1};
link17[] = {13,14};
link18[] = {13,19};
link19[] = {14,9};
link20[] = {15,16};
link21[] = {16,1};
link22[] = {17,9};
link23[] = {18,17};
globals[] = {25.000000,1,0,0,0,640,480,1,24,6316128,1,-396.580658,354.272186,463.204498,-386.553192,911,1031,1};
window[] = {2,-1,-1,-1,-1,1020,322,1651,78,3,929};
link18[] = {14,1};
link19[] = {15,9};
link20[] = {16,15};
link21[] = {17,18};
link22[] = {18,1};
globals[] = {25.000000,1,0,0,0,640,480,1,33,6316128,1,-380.893097,315.695129,343.738464,-460.417511,803,927,1};
window[] = {2,-1,-1,-1,-1,1039,132,1246,132,3,820};
*//*%FSM</HEAD>*/
class FSM
{
@@ -78,60 +76,58 @@ class FSM
class waiting
{
name = "waiting";
init = /*%FSM<STATEINIT""">*/"//diag_log ""CLEANUP: Waiting for next task"";" \n
"_numDead = {local _x} count allDead;" \n
""/*%FSM</STATEINIT""">*/;
init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "too_many_dead">*/
class too_many_dead
/*%FSM<LINK "time_dead">*/
class time_dead
{
priority = 2.000000;
priority = 4.000000;
to="cleanup_dead";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(_numDead > 300)"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
condition=/*%FSM<CONDITION""">*/"(time - _lastDeadCheck) > 600"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_lastDeadCheck = time;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "time_sync">*/
class time_sync
{
priority = 1.000000;
priority = 3.000000;
to="sync_the_time";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"((time - _lastUpdate) > 300)"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_lastUpdate = time;"/*%FSM</ACTION""">*/;
condition=/*%FSM<CONDITION""">*/"(time - _lastTimeSync) > 300"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_lastTimeSync = time;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "need_update">*/
class need_update
/*%FSM<LINK "time_items">*/
class time_items
{
priority = 2.000000;
to="cleanup_items";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(time - _lastItemCheck) > 60"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_lastItemCheck = time;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "time_obj_update">*/
class time_obj_update
{
priority = 1.000000;
to="update_objects";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"( (count needUpdate_objects) > 0 && (time-_lastNeedUpdate>10) )"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_lastNeedUpdate = time;"/*%FSM</ACTION""">*/;
condition=/*%FSM<CONDITION""">*/"(time-_lastObjectUpdateCheck) > 10"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_lastObjectUpdateCheck = time;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "true">*/
class true
/*%FSM<LINK "anti_hack">*/
class anti_hack
{
priority = 0.000000;
to="general_cleanup";
to="check_for_hacker";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "too_many_objects">*/
class too_many_objects
{
priority = 0.000000;
to="cleanup_objects";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"((time - _timeNem) > 60)"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_timeNem = time;"/*%FSM</ACTION""">*/;
condition=/*%FSM<CONDITION""">*/"(time-_timeHackCheck) > 1"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_timeHackCheck = time;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
@@ -141,80 +137,85 @@ class FSM
class cleanup_dead
{
name = "cleanup_dead";
init = /*%FSM<STATEINIT""">*/"diag_log (""CLEANUP: TOO MANY DEAD BODIES"");" \n
init = /*%FSM<STATEINIT""">*/"_numDead = {local _x} count allDead;" \n
"" \n
"diag_log (""CLEANUP: PERFORMING BODY CLEANUP ON "" + str(_numDead) + "" BODIES"");" \n
"if (_numDead > 300) then { " \n
"" \n
"_delQtyZ = 0;" \n
"_numZombie = {_x isKindOf ""zZombie_Base""} count allDead;" \n
"{" \n
" if (local _x) then {" \n
" if (_x isKindOf ""zZombie_Base"") then {" \n
" deleteVehicle _x;" \n
" _delQtyZ = _delQtyZ + 1;" \n
" } else {" \n
" _exists = _x in _deadBodies;" \n
" if(!_exists) then {" \n
" _deadBodies set [count _deadBodies,_x];" \n
" diag_log (""CLEANUP: TOO MANY DEAD BODIES"");" \n
" diag_log (""CLEANUP: PERFORMING BODY CLEANUP ON "" + str(_numDead) + "" BODIES"");" \n
"" \n
" _delQtyZ = 0; " \n
" _numZombie = {_x isKindOf ""zZombie_Base""} count allDead;" \n
" {" \n
" if (local _x) then {" \n
" if (_x isKindOf ""zZombie_Base"") then {" \n
" deleteVehicle _x;" \n
" _delQtyZ = _delQtyZ + 1;" \n
" } else {" \n
" _exists = _x in _deadBodies;" \n
" if(!_exists) then {" \n
" _deadBodies set [count _deadBodies,_x];" \n
" };" \n
" };" \n
" };" \n
" };" \n
"} forEach allDead;" \n
" } forEach allDead;" \n
"" \n
"//Cleanup players" \n
"_body = objNull;" \n
"_delQtyP = 0;" \n
"_delDo = _numDead - _numZombie;" \n
"_delDo = ((_delDo min (count _deadBodies)) -1);" \n
"if (_delDo<1) then {_delDo=1};" \n
"for ""_i"" from 0 to _delDo do {" \n
" _body = _deadBodies select _i;" \n
" if(!isNil ""_body"") then {" \n
" _pos = getPosATL _body;" \n
" _sfx = nearestObject [_pos,""Sound_Flies""];" \n
" if (!(isNull _sfx)) then {" \n
" deleteVehicle _sfx;" \n
" //Cleanup players" \n
" _body = objNull;" \n
" _delQtyP = 0;" \n
" _delDo = _numDead - _numZombie;" \n
" _delDo = ((_delDo min (count _deadBodies)) -1);" \n
" if (_delDo<1) then {_delDo=1};" \n
" for ""_i"" from 0 to _delDo do {" \n
" _body = _deadBodies select _i;" \n
" if(!isNil ""_body"") then {" \n
" _pos = getPosATL _body;" \n
" _sfx = nearestObject [_pos,""Sound_Flies""];" \n
" if (!(isNull _sfx)) then {" \n
" deleteVehicle _sfx;" \n
" };" \n
" deleteVehicle _body;" \n
" _delQtyP = _delQtyP + 1;" \n
" };" \n
" deleteVehicle _body;" \n
" _delQtyP = _delQtyP + 1;" \n
" };" \n
" _deadBodies set [_i,""DEL""];" \n
" _deadBodies set [_i,""DEL""];" \n
"" \n
"//Let's move this into the body removal sequence so uncontrolled flies are removed only if corpses are cleaned" \n
"//Check Flies" \n
"_isOK=-1;" \n
"_dwUSOFC=0;" \n
"{" \n
" //_isOk = {!alive _x} count (nearestObjects [_x, [""CAManBase""], 2]);" \n
" _isOk = {!alive _x} count (_x nearEntities [[""CAManBase""], 2]);" \n
" if (_isOk>-1) then {" \n
" diag_log (""DW_DEBUG _isOK: "" + str(_isOK) );" \n
" };" \n
" if ((_isOk>-1) AND (_isOK<1)) then {" \n
" //diag_log (""CLEANUP: DELETING A SOUND OF FLIES"");" \n
"_dwUSOFC=_dwUSOFC+1;" \n
" deleteVehicle _x;" \n
" diag_log (""CLEANUP: DELETED AN UNCONTROLLED SOUND OF FLIES:"" + str(_dwUSOFC) );" \n
" };" \n
"} forEach allMissionObjects ""Sound_Flies"";" \n
" //Let's move this into the body removal sequence so uncontrolled flies are removed only if corpses are cleaned" \n
" //Check Flies" \n
" _isOK=-1;" \n
" _dwUSOFC=0;" \n
" {" \n
" //_isOk = {!alive _x} count (nearestObjects [_x, [""CAManBase""], 2]);" \n
" _isOk = {!alive _x} count (_x nearEntities [[""CAManBase""], 2]);" \n
" if (_isOk>-1) then {" \n
" diag_log (""DW_DEBUG _isOK: "" + str(_isOK) );" \n
" };" \n
" if ((_isOk>-1) AND (_isOK<1)) then {" \n
" //diag_log (""CLEANUP: DELETING A SOUND OF FLIES"");" \n
" _dwUSOFC=_dwUSOFC+1;" \n
" deleteVehicle _x;" \n
" diag_log (""CLEANUP: DELETED AN UNCONTROLLED SOUND OF FLIES:"" + str(_dwUSOFC) );" \n
" };" \n
" } forEach allMissionObjects ""Sound_Flies"";" \n
"" \n
"" \n
"//Let's move this into the body removal sequence so uncontrolled fireplaces are removed only if corpses are cleaned" \n
"//clean fireplaces" \n
"_dwUFPC=0;" \n
"{" \n
" if (local _x) then {" \n
" //diag_log (""CLEANUP: DELETING A UNCONTROLLED FIREPLACE"");" \n
" deleteVehicle _x;" \n
"_dwUFPC=_dwUFPC+1;" \n
" diag_log (""CLEANUP: DELETED AN UNCONTROLLED FIREPLACE:"" + str(_dwUFPC) );" \n
" //Let's move this into the body removal sequence so uncontrolled fireplaces are removed only if corpses are cleaned" \n
" //clean fireplaces" \n
" _dwUFPC=0;" \n
" {" \n
" if (local _x) then {" \n
" //diag_log (""CLEANUP: DELETING A UNCONTROLLED FIREPLACE"");" \n
" deleteVehicle _x;" \n
" _dwUFPC=_dwUFPC+1;" \n
" diag_log (""CLEANUP: DELETED AN UNCONTROLLED FIREPLACE:"" + str(_dwUFPC) );" \n
" };" \n
" } forEach allMissionObjects ""Land_Fire_DZ"";" \n
"" \n
" };" \n
"} forEach allMissionObjects ""Land_Fire_DZ"";" \n
" _deadBodies = _deadBodies - [""DEL""];" \n
"" \n
" diag_log (""CLEANUP: DELETED "" + str(_delQtyP) + "" PLAYER BODIES AND "" + str(_delQtyZ) + "" BODIES"");" \n
"" \n
"};" \n
"_deadBodies = _deadBodies - [""DEL""];" \n
"" \n
"diag_log (""CLEANUP: DELETED "" + str(_delQtyP) + "" PLAYER BODIES AND "" + str(_delQtyZ) + "" BODIES"");" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
@@ -232,25 +233,27 @@ class FSM
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "cleanup_objects">*/
class cleanup_objects
/*%FSM<STATE "cleanup_items">*/
class cleanup_items
{
name = "cleanup_objects";
name = "cleanup_items";
init = /*%FSM<STATEINIT""">*/"_missionObjs = allMissionObjects ""WeaponHolder"";" \n
"_qty = count _missionObjs;" \n
"" \n
"//diag_log (""CLEANUP: PERFORMING ITEM CLEANUP: TOTAL "" + str(_qty) + "" LOOT BAGS"");" \n
"_delQty = 0;" \n
"_qtyLoc = 0;" \n
"{" \n
" if (local _x) then {" \n
" _qtyLoc = _qtyLoc + 1; // debugging" \n
" _keep = _x getVariable [""permaLoot"",false];" \n
" _nearby = {isPlayer _x} count (_x nearEntities [[""CAManBase""], 100]);" \n
" _nearby = {isPlayer _x} count (_x nearEntities [[""CAManBase""], 100]);" \n
" if ( (!_keep) && (_nearby==0) ) then {" \n
" deleteVehicle _x;" \n
" _delQty = _delQty + 1;" \n
" };" \n
" };" \n
"} forEach _missionObjs;" \n
"" \n
"if (_delQty > 0) then {" \n
" diag_log (""CLEANUP: DELETED "" + str(_delQty) + "" LOOT BAGS"");" \n
"};" \n
@@ -287,8 +290,8 @@ class FSM
" setDate _date;" \n
" dayzSetDate = _date;" \n
" publicVariable ""dayzSetDate"";" \n
" diag_log (""TIME SYNC: Local Time set to "" + str(_date));" \n
"};" \n
" diag_log (""TIME SYNC: Local Time set to "" + str(_date));" \n
" };" \n
"};" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
@@ -330,36 +333,8 @@ class FSM
" } forEach allMissionObjects ""ReammoBox"";" \n
"*/" \n
"" \n
"//Check for hackers" \n
" {" \n
" if(vehicle _x != _x && !(vehicle _x in _safety) && (typeOf vehicle _x) != ""ParachuteWest"") then {" \n
" diag_log (""CLEANUP: KILLING A HACKER "" + (name _x) + "" "" + str(_x) + "" IN "" + (typeOf vehicle _x));" \n
" (vehicle _x) setDamage 1;" \n
" _x setDamage 1;" \n
" };" \n
" } forEach allUnits;" \n
"" \n
"/*" \n
"//Let's move this into the body removal sequence so uncontrolled flies are removed only if corpses are cleaned" \n
"//Check Flies" \n
"_isOK=-1;" \n
"_dwUSOFC=0;" \n
"{" \n
" //_isOk = {!alive _x} count (nearestObjects [_x, [""CAManBase""], 2]);" \n
" _isOk = {!alive _x} count (_x nearEntities [[""CAManBase""], 2]);" \n
" if (_isOk>-1) then {" \n
" diag_log (""DW_DEBUG _isOK: "" + str(_isOK) );" \n
" };" \n
" if ((_isOk>-1) AND (isOK<1)) then {" \n
" //diag_log (""CLEANUP: DELETING A SOUND OF FLIES"");" \n
"_dwUSOFC=_dwUSOFC+1;" \n
" deleteVehicle _x;" \n
" diag_log (""CLEANUP: DELETED AN UNCONTROLLED SOUND OF FLIES:"" + str(_dwUSOFC) );" \n
" };" \n
"} forEach allMissionObjects ""Sound_Flies"";" \n
"*/" \n
"" \n
"dayz_serverObjectMonitor = _safety;"/*%FSM</STATEINIT""">*/;
"dayz_serverObjectMonitor = _safety;" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
@@ -384,10 +359,12 @@ class FSM
"" \n
"_safety = dayz_serverObjectMonitor;" \n
"" \n
"_lastUpdate = time;" \n
"_timeNem = time;" \n
"_lastTimeSync = time;" \n
"_lastDeadCheck = time;" \n
"_lastItemCheck = time;" \n
"_lastObjectUpdateCheck = time;" \n
"_timeHackCheck = time;" \n
"_deadBodies = [];" \n
"_lastNeedUpdate = time;" \n
"_maxBodies = 15;" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
@@ -410,13 +387,16 @@ class FSM
class update_objects
{
name = "update_objects";
init = /*%FSM<STATEINIT""">*/"diag_log format[""DEBUG: needUpdate_objects=%1"",needUpdate_objects];" \n
"{" \n
"// _x setVariable [""needUpdate"",false,true];" \n
" needUpdate_objects = needUpdate_objects - [_x];" \n
" [_x,""all""] spawn server_updateObject;" \n
init = /*%FSM<STATEINIT""">*/"if ((count needUpdate_objects) > 0) then {" \n
"" \n
"} forEach needUpdate_objects;" \n
" diag_log format[""DEBUG: needUpdate_objects=%1"",needUpdate_objects];" \n
"" \n
" {" \n
" //_x setVariable [""needUpdate"",false,true];" \n
" needUpdate_objects = needUpdate_objects - [_x];" \n
" [_x,""all""] call server_updateObject; //should be call!!!" \n
" } forEach needUpdate_objects;" \n
"};" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
@@ -434,6 +414,37 @@ class FSM
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "check_for_hacker">*/
class check_for_hacker
{
name = "check_for_hacker";
init = /*%FSM<STATEINIT""">*/"//Check for hackers" \n
" {" \n
" if(vehicle _x != _x) then {" \n
" if (!(vehicle _x in _safety) && ((typeOf vehicle _x) != ""ParachuteWest"")) then {" \n
" diag_log (""CLEANUP: KILLING A HACKER "" + (name _x) + "" "" + str(_x) + "" IN "" + (typeOf vehicle _x));" \n
" (vehicle _x) setDamage 1;" \n
" _x setDamage 1;" \n
" };" \n
" };" \n
" } forEach allUnits;" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "true">*/
class true
{
priority = 0.000000;
to="waiting";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
};
initState="init";
finalStates[] =

View File

@@ -144,7 +144,6 @@ diag_log "HIVE: Starting";
_countr = _countr + 1;
} forEach _objWpnTypes;
};
};
if (_object isKindOf "AllVehicles") then {
{