Jump to content

Sandbird

Member
  • Posts

    1045
  • Joined

  • Last visited

  • Days Won

    16

Posts posted by Sandbird

  1. too much of hassle, but doable.

    All you have to do is where you check if the player has the money to sell the object to get damage of the vehicle...and then do a percentage check like if the the damage is 0.2 and the vehicle sells for 2000 then the selling price would be (2000 - (2000x0.2)) so -400. And use that value instead of the one it retrieves from the db or the config file.

    But i am pretty sure people would not like this.

  2. 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...

  3. 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.

  4. 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];
    };
  5.  

    Right, i forgot about that one....so i could make it static lets say at 10:00.

    And make a check in server init.sqf using kk's .dll to see about what 'real' time it is....so when the next server starts in 3h i could switch it to 12:00

    After 3h again, when it would normally start to get dark in game, i could setDate to 14:00 and so on and so on, till i get my loooonger day and shorter night :)

    Right?

  6.  

    Yeah i know about the real date thing. I think though that time doesnt dynamically change once the mission has started unless i use a mod like Jey says.

     

    Why not using a time control mangament like @Donovan?

     

    You can either increase or decraese the time's speed.

     

     I would recommand just going static at some hours and you can do the math to make day light : starting hour -> 4pm30 or so

     

    So basically the only solution is having different hiveext.inis right?

    During the day have it at static and towards the night switch to a regular local time

     

    If set to static the day/night is stuck to that time right ? Or does it continue the day/night cycle from 'that' hour ?

  7. I am trying to tweak the date/time in my test server to achieve the following.

    Morning starts around 6-7ish and the day last all day till about 22:00..

    I've been reading everything i could get my hands on but all i find that come close to that are 3, 4 hive.inis that you switch on restarts.

    Is there an easy way of doing this ? Like set the date of the server somewhere in July and just let it work its magic on its own....since summer has the longest days.

    -thanks

  8. What I did for bigger sizes:

    8x8 panels and changed their textures so all of them zould get 1/8 of the whole image :)

     

    For little ones I use a tiny billboard, can't remember of the classname. :(

     

    The only small ones i can find that accept a texture are the ones here: http://www.armatechsquad.com/ArmA2Class151656165165341654165165165165f/A2/Objects/signs/

    1 row up before the end. But i cant attach them to anything...cause they are not 'flat' on the back... :/

    Damn arma objects grrr

     

    If you ever find out the classnames let me know xBowBii :)

    -ty

  9. Besides WarfareBunkerSign and SignM_FARP_Winchester_EP1 type of billboards, is there a 'smaller' type of object i can use to texture map an image ?

    Something like the width/ 2xheight of the killboard.

     

    Or anyone knows where i can find which config.bin has all these signs so i can search for  hiddenselection in them ?

    -Ty

  10. No, they are correct :P I am using same structure as the .dll

    "INSERT INTO `"+_objTableName+"` (`ObjectUID`, `Instance`, `Classname`, `Damage`, `CharacterID`, `Worldspace`, `Inventory`, `Hitpoints`, `Fuel`, `Datestamp`) "
    "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, CURRENT_TIMESTAMP)");

     

    Notice the CURRENT_TIMESTAMP ? That's been sent instead of a value...so the db cell gets the current time.

    So it should send 10 values but 9 of them are real arma values.

     

    I kinda solved it with a hack....i am beta testing now and get 100% correct results.

    I noticed in the past (dont remember in which function though), epoch was doing it also in an select query,.....they had a query run inside a for loop 8 times....I guess to make sure it gets the results.

    So i did this:

    - In the objects_data table i set the ObjectUID to UNIQUE

    - And inside a loop i ran this sql:

    _i = 0;
    for "_i" from 0 to 5 do {
        "Arma2Net.Unmanaged" callExtension format["Arma2NETMySQLCommand ['dayz','INSERT INTO object_data (ObjectUID, Instance, Classname, CharacterID, Worldspace, Inventory, Hitpoints, Fuel, Damage, Datestamp) VALUES ('%1','%2','%3','%4','%5','%6','%7','%8','%9',CURRENT_TIMESTAMP)']",_uid,dayZ_instance,_class,_characterID,_worldspace,_inventory,_array,_fuel,_damage];
        sleep 0.1;
    };

    It works 100%....

     

    I think this whole file 'breaks' due to the server_deleteObj function above the new insert.

    It probably takes its sweet time to delete the object from the db, so when my sql query comes...it finds an object there...and doesnt execute.

    I guess i could change the insert to update to test it better...but its 20:31 and i've been on this since 12:00...

  11. Since the SteamID update i had to resolve to Arma2Net and redo all server_publish, and server_swapObject functions with it...in order to save the playerUID in the CharacterID cell instead of the characterID one. Why ? cause the hiveext.dll doesnt support bigint(24) values for CharacterID.

    Anyways...I've been rewriting the server_swapObject.sqf and i noticed something REALLY WEIRD.

    My hivewrite:

    vgserver_hiveWrite = {
        private["_mykey","_mydata"];
        _mykey = _this;
        _mydata = format["Arma2NETMySQLCommand ['dayz',""%1""]",_mykey];
        SQL_RESULT = "Arma2Net.Unmanaged" callExtension _mydata;
    };

    While the sql in the server_publishObject.sqf works fine:

    _keyobj = format["insert into object_data (ObjectUID, Instance, Classname, CharacterID, Worldspace, Inventory, Hitpoints, Fuel, Damage, Datestamp) values ('%1','%2','%3','%4','%5','%6','%7','%8','%9', CURRENT_TIMESTAMP)",_uid,dayZ_instance,_class,_charID,_worldspace,_inventory,_hitpoints,_fuel,'0'];
    //diag_log ("HIVE: WRITE: >>> Player Build <<<"+ str(_keyobj));
    _keyobj call vgserver_hiveWrite;

    The same SQL in server_swapObject.sqf,

    _keyvg= format["insert into object_data (ObjectUID, Instance, Classname, CharacterID, Worldspace, Inventory, Hitpoints, Fuel, Damage, Datestamp) values ('%1','%2','%3','%4','%5','%6','%7','%8','%9',CURRENT_TIMESTAMP)",_uid,dayZ_instance,_class,_characterID,_worldspace,_inventory,_hitpoints,_fuel,_damage];
    diag_log ("HIVE: WRITE: >>>>>>>>> Player UPGRADED/DOWNGRADE <<<<<<<<<<<"+ str(_keyvg));
    _keyvg call vgserver_hiveWrite;

    although there is a proper mysql entry in arma2net log, it DOESNT get executed (or it does but epoch deletes the entry...i cant figure this out) and instead just the 1st object in the database gets deleted (as it should be since its deleting it and then creates and publishes the upgraded object).

     

    No matter what i do, no matter how i tweak the SQL query, i cant get a 100% successful result.

    Sometimes it upgrades the object and writes it in the db and sometimes it doesnt.

     

    IF the object doesnt have a lock, then it will 90% work. If it does then i get about 50% chance the sql will get executed (like i said, not sure if it gets deleted by epoch after insertion....no logs no nadda).

     

    I found a guy here: http://forums.dayzgame.com/index.php?/topic/163482-issue-with-door-locks-on-my-server/

    That had the same problem....and he was also pointing to the same file....

    Also i say that Plot for Life people experience the same difficulties ( i dont have that mod ).

     

    Whats going on here ? Anyone knows ?

     

    To test this i build a CinderWallDoor_DZ and change it to a CinderWallDoorLocked_DZ with a Lock....upgrading / downgrading it all the time and checking the db and logs to catch the error.

     

     

    Is epoch (like server_monitor or something else) checking/deleting stuff and not post anything in the logs ?

    Or simple for some FREAKING WEIRD reason arma2net is not getting executed ?

     

    In the logs all looks fine :

    10/17/2014 17:05:02 function: Arma2NETMySQLCommand ['dayz',"insert into object_data (ObjectUID, Instance, Classname, CharacterID, Worldspace, Inventory, Hitpoints, Fuel, Damage, Datestamp) values ('6035813732696','13','CinderWallDoorLocked_DZ','634','[96.4591,[6035.77,1373.21,-0.0568657]]','[]','[]','0','0',CURRENT_TIMESTAMP)"]
    10/17/2014 17:05:02 maxResultSize: 10239
    10/17/2014 17:05:02 Result size: 4
    10/17/2014 17:05:02 Result: [[]]

    but the object does not exist in the db....and if i manually execute this SQL it inserts fine.

     

    ps: Same thing for downgrading objects.

  12. Well to be honest this whole thing could fail if it goes inside the if...and not the else, true jahangir.

     

    The proper way to do this Rythron is to overwrite the variables.sqf file (if you havent done it already in your init.sqf)

     

    And in there set all these variables you find from removeAction to an initial value of -1. In your case :

    dayz_addsirens = objNull;
    s_player_sirens_on = -1;
    s_player_sirens_off = -1;

    I dont know if you are initializing dayz_addsirens....thats why i did that as well.

  13.  

    Hey sandbird same problem here.. spam spam spam in the client log ... dont like it either ...

    Any idea what it can cause?

     

     

    yeah pretty much you got the same problem...You see with this latest arma patch the fracked up pretty good...for example in your case....you see this ?

    } else {
        dayz_addsirens removeAction s_player_sirens_on;
        dayz_addsirens removeAction s_player_sirens_off;
        s_player_sirens_on = -1;
        s_player_sirens_off = -1;
    };

    you first say remoteaction s_player_sirens_on  but the engine doesnt know wtf is that value...is it a number ? is it an array ? what it is ?

    but you bellow you declare it.....s_player_sirens_on is a number and its -1.

    So doing that first then it would not give you an error anymore.....so you have to rewrite you else like this:

    } else {
        s_player_sirens_on = -1;
        s_player_sirens_off = -1;
        dayz_addsirens removeAction s_player_sirens_on;
        dayz_addsirens removeAction s_player_sirens_off;
    };
    

    And this has to happen for tons of other variables..... :/

×
×
  • Create New...