EpochModTeam / DayZ-Epoch

Experimental DayZ Mod for Arma 2
http://epochmodteam.github.io/DayZ-Epoch
226 stars 398 forks source link

if "cont(str(gear vehcile))">2048, DB didn`t save it. Players can dupe anything. #1924

Closed F507DMT closed 7 years ago

F507DMT commented 7 years ago

if "cont(str(gear vehcile))">2048, DB didn`t save it. Players can dupe anything.

full fix: "ItemBandage" to "0", "ItemPainkiller" to "1" IN all mod, or jast for save in vehices. Or shrink an array by driver.dll

more 2048 can be in vault or truck, just put the different things in the vehicle.

my temp fix in object_monitorGear.sqf if((count toArray(str((getWeaponCargo _object)+(getMagazineCargo _object)+(getBackpackCargo _object))))>1850)then{ //bla bla error, not all be save in BD

in server_updateObject.sqf, in _object_inventory

//after
if ((str _inventory != _previous) || {_forceUpdate}) then {
if((count toArray(str((_inventory select 0)+(_inventory select 1)+(_inventory select 2))))>1850)then{
    _inventory=[_object]call fnc_resizeInvArray;
};

in server_functions.sqf

fnc_resizeInvArray.txt fnc_resizeInvArray={ private["_object","_NewInv","_step","_array","_a","_cntNewInv","_abort"]; _object=_this select 0; _NewInv=[]; _abort=-1; { _step=100; //better use while{_step>0}do{ while{true}do{ _array=[]; { _a=_x; if((count _a)>_step)then{ _a resize _step; }; _array set[count _array,_a]; }forEach _x; _cntNewInv=count toArray(str(_NewInv+_array)); //diag_log(format["DEBAG: fnc_resizeInvArray _step:%1",_step]); if(_cntNewInv<1830)exitWith{ _NewInv set[_forEachIndex,_array]; if(_cntNewInv>1700)then{_abort=_forEachIndex}; }; _step=_step-50; }; if(_abort!=-1)exitWith{ switch(_abort)do{ case 0:{ _NewInv set[1,[[],[]]]; _NewInv set[2,[[],[]]]; }; case 1:{ _NewInv set[2,[[],[]]]; }; }; }; }forEach [getWeaponCargo _object,getMagazineCargo _object,getBackpackCargo _object]; //diag_log(format["DEBAG: fnc_resizeInvArray obj:%1 objID:%2",typeof _object,GetObjID(_object)]); _NewInv };

ebayShopper commented 7 years ago

46a1441 145fbf0