Update vanilla building

Vanilla commits:

9b2092c9f7

674624d122
This commit is contained in:
ebaydayz
2016-11-25 16:25:26 -05:00
parent 1097eaba0c
commit b6d88b1329
13 changed files with 161 additions and 172 deletions

View File

@@ -158,15 +158,17 @@ _object_damage = {
//Walls
_objWallDamage = {
private "_key";
_damage = _this select 2;
_object setDamage _damage;
private ["_key","_damage"];
_damage = (damage _object);
if (_objectID == "0") then {
_key = format["CHILD:306:%1:%2:%3:",_objectUID,[],_damage];
} else {
_key = format["CHILD:306:%1:%2:%3:",_objectID,[],_damage];
};
diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
};

View File

@@ -7,17 +7,7 @@ _owner = owner _unit;
//diag_log format ["%1, %2, %3, %4", _unit, _variable, _arraytosend, _owner];
switch (_variable) do {
case "objWallDamage": {
_object = _arraytosend select 0;
if (local _object) then {
_arraytosend call fnc_Obj_FenceHandleDam;
} else {
PVCDZ_obj_Damage = _arraytosend;
_owner publicVariableClient "PVCDZ_obj_Damage";
};
};
switch (_variable) do {
case "VehHandleDam": {
_vehicle = _arraytosend select 0;
if (local _vehicle) then {

View File

@@ -79,6 +79,20 @@ dayz_Achievements = {
_player setVariable ["Achievements",_achievements];
};
*/
//Send fences to this array to be synced to db, should prove to be better performaince wise rather then updaing each time they take damage.
server_addtoFenceUpdateArray = {
//Potential problem no current way to say what is setting the damage.
if ((_this select 0) isKindOf "DZ_buildables") then {
(_this select 0) setDamage (_this select 1);
if !((_this select 0) in needUpdate_FenceObjects) then {
needUpdate_FenceObjects set [count needUpdate_FenceObjects, (_this select 0)];
};
};
};
vehicle_handleServerKilled = {
private ["_unit","_killer"];
_unit = _this select 0;

View File

@@ -5,15 +5,14 @@ item0[] = {"init",0,250,-75.000000,-425.000000,25.000000,-375.000000,0.000000,"i
item1[] = {"true",8,218,-75.000000,-200.000000,25.000000,-150.000000,0.000000,"true"};
item2[] = {"waiting",2,250,-75.000000,-125.000000,25.000000,-75.000000,0.000000,"waiting"};
item3[] = {"true",8,218,-75.000000,250.000000,25.000000,300.000000,0.000000,"true"};
item4[] = {"",7,210,-129.000015,271.000000,-120.999977,279.000031,0.000000,""};
item5[] = {"",7,210,-129.000000,-104.000000,-120.999992,-96.000000,0.000000,""};
item4[] = {"",7,210,-204.000015,271.000000,-195.999985,279.000031,0.000000,""};
item5[] = {"",7,210,-204.000015,-104.000000,-196.000000,-96.000000,0.000000,""};
item6[] = {"initialized",4,218,-75.000000,-350.000000,25.000000,-300.000000,0.000000,"initialized"};
item7[] = {"prepare",2,250,-75.000000,-275.000000,25.000000,-225.000000,0.000000,"prepare"};
item8[] = {"update_objects",2,4346,-75.000000,75.000000,25.000000,125.000000,0.000000,"update objects"};
item9[] = {"Objects_need_upd",4,218,-75.000000,0.000000,25.000000,50.000000,1.000000,"Objects" \n "need update"};
item10[] = {"",7,210,58.500000,-104.000000,66.500000,-96.000000,0.000000,""};
item11[] = {"",7,210,58.500031,271.000000,66.499969,279.000000,0.000000,""};
item12[] = {"New_Cleanup_Obje",2,250,375.000000,75.000000,475.000000,125.000000,0.000000,"New Cleanup" \n "Objects"};
item8[] = {"update_objects",2,250,-125.000000,75.000000,-25.000000,125.000000,0.000000,"update objects"};
item9[] = {"Objects_need_upd",4,218,-125.000000,0.000000,-25.000000,50.000000,1.000000,"Objects" \n "need update"};
item10[] = {"FenceObjects_need",4,218,-25.000000,0.000000,75.000000,50.000000,1.000000,"FenceObjects" \n "need update"};
item11[] = {"update_objects_1",2,250,-25.000000,75.000000,75.000000,125.000000,0.000000,"update objects"};
link0[] = {0,6};
link1[] = {1,2};
link2[] = {2,9};
@@ -27,8 +26,8 @@ link9[] = {8,3};
link10[] = {9,8};
link11[] = {10,11};
link12[] = {11,3};
globals[] = {25.000000,1,0,0,0,640,480,1,13,6316128,1,-520.235962,640.978394,444.212921,-448.684845,779,598,1};
window[] = {2,-1,-1,-1,-1,858,130,1459,130,3,797};
globals[] = {25.000000,1,0,0,0,640,480,1,15,6316128,1,-520.235962,640.978394,444.212921,-448.684845,779,598,1};
window[] = {2,-1,-1,-32000,-32000,780,52,1381,52,3,797};
*//*%FSM</HEAD>*/
class FSM
{
@@ -64,26 +63,26 @@ class FSM
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "FenceObjects_need">*/
class FenceObjects_need
{
priority = 1.000000;
to="update_objects_1";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(( (count needUpdate_FenceObjects) > 0) && (diag_tickTime -_lastfenceUpdate> 5) && (!isNil ""sm_done""))"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_lastfenceUpdate = diag_tickTime;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "Objects_need_upd">*/
class Objects_need_upd
{
priority = 1.000000;
to="update_objects";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(( (count needUpdate_objects) > 0) && (diag_tickTime -_lastNeedUpdate> 5) && (!isNil ""sm_done""))"/*%FSM</CONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(( (count needUpdate_objects) > 0) && (diag_tickTime -_lastVehicleUpdate> 5) && (!isNil ""sm_done""))"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_lastNeedUpdate = diag_tickTime;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%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>*/
@@ -94,7 +93,8 @@ class FSM
init = /*%FSM<STATEINIT""">*/"diag_log (""CLEANUP: INITIALIZING Vehicle SCRIPT"");" \n
"" \n
"" \n
"_lastNeedUpdate = diag_tickTime;" \n
"_lastVehicleUpdate = diag_tickTime;" \n
"_lastfenceUpdate = diag_tickTime;" \n
"" \n
"" \n
""/*%FSM</STATEINIT""">*/;
@@ -141,83 +141,30 @@ class FSM
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "New_Cleanup_Obje">*/
class New_Cleanup_Obje
/*%FSM<STATE "update_objects_1">*/
class update_objects_1
{
name = "New_Cleanup_Obje";
init = /*%FSM<STATEINIT""">*/"diag_log ""DEBUG: New_Cleanup_Obje ""; " \n
"_lootingrids = [];" \n
name = "update_objects_1";
init = /*%FSM<STATEINIT""">*/"diag_log format[""INFO: needUpdate_FenceObjects=%1"",needUpdate_FenceObjects];" \n
"" \n
"{" \n
" _loc = _x select 0;" \n
" _ref = _x select 1;" \n
"" \n
" _nearBy = nearestObjects [_loc, [""ReammoBox""], 1500];" \n
" {" \n
" _lootingrids set [count _lootingrids,[_x,_ref]];" \n
" } foreach _nearBy;" \n
"" \n
" dayz_deseedloot set [0,-1];" \n
" dayz_deseedloot = dayz_deseedloot - [-1];" \n
"" \n
"}foreach dayz_deseedloot;" \n
"" \n
"_qty = count _lootingrids;" \n
"diag_log (""CLEANUP:TOTAL "" + str(_qty) + "" LOOT BAGS"");" \n
"" \n
"_delQty = 0;" \n
"_delQtyDroped = 0;" \n
"_delQtySpawned = 0;" \n
"_delQtyPerma = 0;" \n
"" \n
"{" \n
" " \n
" _obj = _x select 0;" \n
" _ref = _x select 1;" \n
"" \n
" diag_log format [""%1,%2"", _obj, _ref];" \n
"" \n
" _Dropped = (_obj getVariable [""Dropped"",false]);" \n
" _Spawned = (_obj getVariable [""spawnedLoot"",false]);" \n
" _Perma = (_obj getVariable [""permaLoot"",false]);" \n
"" \n
" if (!_Spawned and !_Perma) then {" \n
" _obj setVariable [""Dropped"",true];" \n
" };" \n
"" \n
" //Dropped loot" \n
" if (_Dropped) then {" \n
" " \n
" [""Dropped_Loot"",_obj,_ref] call server_systemCleanup;" \n
" _delQtyDroped = _delQtyDroped + 1;" \n
"" \n
" };" \n
"" \n
" //Spawned Loot" \n
" if (_Spawned) then {" \n
"" \n
" [""Spawned_Loot"",_obj,_ref] call server_systemCleanup;" \n
" _delQtySpawned = _delQtySpawned + 1; " \n
" " \n
" };" \n
"" \n
" //Permaloot" \n
" if (_Perma) then {" \n
"" \n
" _delQtyPerma = _delQtyPerma + 1;" \n
"" \n
" };" \n
"" \n
"} foreach _lootingrids;" \n
"" \n
"if ((_delQtySpawned > 0) or (_delQtyDroped > 0) or (_delQtyPerma > 0)) then {" \n
" //diag_log (""CLEANUP: DELETED "" + str(_delQty) + "" LOOT BAGS"");" \n
" diag_log format [""CLEANUP: (DELETED, DroppedLoot: %1, SpawnedLoot: %2), (KEPT, PermaLoot: %3)"", _delQtyDroped, _delQtySpawned, _delQtyPerma];" \n
"};" \n
" needUpdate_FenceObjects = needUpdate_FenceObjects - [_x];" \n
" [_x,""objWallDamage""] call server_updateObject;" \n
"} forEach needUpdate_FenceObjects;" \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>*/