Additional Logging

delpi

Well-Known Member
I started to take a look at when an object (vehicle or tent) updates and adding some logging if someone just interacted with it. I can't seem to find a good way to do that.

Anyone have an idea?
 
write the the rpt log? When the server restarts make sure you save the current rpt with the time/date so you have a record.
 
I didn't ask that very well. What I meant was I'm looking for an easy way to put in the rpt, which player was responsible for a vehicle or tent saving. Basically how acessed it.
 
well ... lets see:
server_updateobject.sqf line 104 put something like this in:

diag_log format ["LOGGER: ID: %1/%2 PLAYER: %3 OLD_INVENTORY: %4 NEW_INVENTORY %5", _objectID, _objectUID, getplayeruid Player, _previous, _inventory];

and it should output something like this in the logs:
LOGGER: ID:0/1234567 PLAYER: 12345678 OLD_INVENTORY: ["item",[1][][][]] NEW_INVENTORY:[][][][]

the only caveat here is that instead of deciding whether it was a tent or a vehicle we just put both objectuid and objectid and you just have to match the one into the database. Of course as vehicles and tents are deleted from the database, the ID data will become invalid. So maybe you can put in the location and the owner instead which would be _object_position. We can get the owners id with _owner = _object getVariable ["CharacterID",0];

I don't think there is any variable in that file that describes the person who actually touched the tent last. So you either have to use getnearest player type of code or probably better would be to set a variable on the object when a player accesses the inventory with object setvariable["accessedby" name player,true].

Okay? thats a start to what you want maybe. i didn't test anything and its all just off the top of my head while referring to dayz 1.8.2 server_updateobject.sqf ... not sure how different epukes would be, probably not much.
 
that put me on the right track. Thanks.

Below is what I wrote. Feel free to comment on something better.

diag_log (" CLANDOOLITTLE Player interacting with Storage or Vehicle");
_myPlayer = nearestObject [_object, "Man"];
diag_log format [" - Player: %1", _myPlayer];

I put it down in the 'if (str(_inventory) != _previous) then {' section to avoid it spamming.
 
Back
Top