Jump to content
  • 0

Vehicles repair themselves on accessing Repair menu


Sandbird

Question

I am having a weird bug on our server, and i cant seem to follow the trail to repair it.

If you get damage on a vehicle, the client says that the vehicle is damaged but, if you get out and select Repair menu (where it loads the hitpoints) the vehicle gets automatically repaired.

Its as if...while you are getting attacked nothing registers in the database...so accessing the Repair menu and bringing the hitpoints, it brings 0 damage.

 

If you get in back in the vehicle then the damage gets written in the db, and bringing the repair menu does show the damaged parts.

 

I am trying to follow the calls to figure this out, but i ended up in PVDZE_veh_Update which never gets called in dayz_server or mission files....

Anyone experienced this bug before ? Or can tell me what gets called exactly when a player shoots a vehicle, in which order ?

 

I am not overwriting anything vehicle related in compiles.sqf

fnc_usec_damageVehicle =        compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerVehicle.sqf";        //Event handler run on damage
object_setHitServer =            compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setHitServer.sqf";
object_setFixServer =            compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setFixServer.sqf";
object_setHit =                compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setHit.sqf";   
vehicle_handleDamage    =         compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";
vehicle_handleKilled    =         compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf";
vehicle_getHitpoints =            compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_getHitpoints.sqf";

and in my server files, server_updateObject.sqf

_object_damage = {
    private["_hitpoints","_array","_hit","_selection","_key","_damage"];
        _hitpoints = _object call vehicle_getHitpoints;
        _damage = damage _object;
        _array = [];
        {
            _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];
        } count _hitpoints;
    
        _key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage];
        //diag_log ("HIVE: WRITE: "+ str(_key));
        _key call server_hiveWrite;
    _object setVariable ["needUpdate",false,true];
};
Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 0

Yeah i do have service points, i am not sure when i got this bug...could be any modification really.

I'll list some vehicle modification i got, maybe we got some common ones.

 

- Service vehicles

- Infistar safezone (no vehicle godmode though)

- Paint vehicles

- Base Building

- JAEM

- VASP

- Arma2Net to handle CharacterID cell in database, to hold playerUID instead

   This is basically the major overhaul on the server..Everything that has to do with CharacterID in object_data table is done by Arma2net. Table cell has been replaced with bigint(24) and all SQL queries are   done by arma2net...But it cant be this one that is causing this, i was very thorough tweaking the files.

Link to comment
Share on other sites

  • 0

And again one more time we fall into the pit that epoch team has left for us behind.....

Inside the _object_damage in dayz_server\compile\server_updateObject.sqf we find this line: 

_object setVariable ["needUpdate",false,true];

What's this value for? Its never used. I've searched mission files, dayz_server and dayz_code files...and none of the files use value needUpdate.

 

 

Or function vehicle_handleInteract for that matter in server_functions.sqf.

vehicle_handleInteract = {
    private["_object"];
    _object = _this select 0;
    needUpdate_objects = needUpdate_objects - [_object];
    [_object, "all"] call server_updateObject;
};

I mean, shouldnt this function get called at any time ? Looks important to me, doesnt it ?....It does call server_updateObject.....and handles the needUpdate_objects array.

 

If you put a 

diag_log format[">>>>Type: %1", _type];

above switch (_type) do { in server_updateObject.sqf and then ingame you shoot a vehicle....you'll see that you get >>>>Type: damage entry in the log....so the _object_damage function gets called.

If you add a

diag_log (">>> HIVE: UPDATE OBJECT: "+ str(_key));

inside the _object_data though, you'll see that the db does NOT get update on every hit. That means that this:

            if (!(_object in needUpdate_objects)) then {
                //diag_log format["DEBUG Damage: Added to NeedUpdate=%1",_object];
                needUpdate_objects set [count needUpdate_objects, _object];
            };

gets called instead.......

So how come vehicle_handleInteract is never called ?

Sure, server_cleanup.fsm does the job, by calling server_updateObject but thats every 5 seconds, IF the objects needs an update.

 

So to recap, we have:

 

- Player shoots object's tires for like 10 times.

  We get 10 entries of ">>>>Type: damage" in the log, on every hit. (0 updates in the database)

  We wait 5 seconds, then shoot again....THEN the db gets updated. (and object is removed from the needs_update array in .fsm file)

  We shoot the object like 2343453 times.......... we get tons of ">>>>Type: damage" entries....but 0 database updates

  We wait for 5 seconds again.....shoot it and then the db updates.

 

a) Why wait for 5 seconds ? If the vehicle is hit....why dont we register the hit immediately to the db ?

b) Why doesnt the db get updated automatically after 5 sec ? Why do we have to shoot the vehicle again ?

Whats the point in having a needUpdate_objects array if the code never executes it automatically ?

 

I dont know how, but some players are exploiting this delay....They repair their vehicle and remove all the damage. Probably they bring up the repair menu, and that brings back the hitpoints from the db....Since no hits were written in the db, i guess it somehow repairs the vehicle.

We used to have something similar back in the old days, where you would see your chopper damaged, and then the co-pilot would get in the drivers seat then get out and when you get back in, you see everything back to green.

Everyone was dismissing this as a client bug....but now i think its more than that...

Link to comment
Share on other sites

  • 0

Same problem here, i realy dont understand how this happens with some vehicles and others not. Sandbird any updates bro?

I dont remember what happened and that bug stopped on my server.

I remember i looked at all the files and couldnt understand why it was happening...everything looked fine.

If i am not mistaken i think it had to do with safezones.

Link to comment
Share on other sites

  • 0

I dont remember what happened and that bug stopped on my server.

I remember i looked at all the files and couldnt understand why it was happening...everything looked fine.

If i am not mistaken i think it had to do with safezones.

I start all new in mine test server , the only mod i have now is admin tools, and guess what... he is causing problems , i test and same thing, some vehicles auto repairing... Sandbird you remember what you do to fix?   

Link to comment
Share on other sites

  • 0

Hmm, good to know , but now i only put admin tools and he make the mess, i tried to install only one mod per time, to test, and when i put admin tools same thing. any idea ?

 

I am trying really hard to remember what was the cause of this....I even asked the admin who found the bug if he remembered what i told him the cause was....but he cant remember.

I am scared now that if the bug returns i'll be back to 0 searching for 13231 files for the solution

Link to comment
Share on other sites

  • 0

I am trying really hard to remember what was the cause of this....I even asked the admin who found the bug if he remembered what i told him the cause was....but he cant remember.

I am scared now that if the bug returns i'll be back to 0 searching for 13231 files for the solution

Nice bro, i just reinstall all db, and start all fresh , i put one mod, tested and uninstall, and try another, then i find the one who cause that , its admin tools .... but how do solve that ,thats i dont know yet rsrssr , i hope you can help bro :D

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...