Jump to content

SKO85

Member
  • Posts

    12
  • Joined

  • Last visited

Posts posted by SKO85

  1. 1 minute ago, icomrade said:

    No, the only time an objectUID changes is the first server startup after a vehicle is created. Otherwise it will be ObjectID + 1, where ObjectID is an autoincremented value in the MySQL DB - ObjectID is never reused for any object. These changes cannot be implemented into 1.0.5.1, unless the hive DLL is rebuilt with the fix posted, but 1.0.6 contains other changes to the hive which make it unsuitable for direct replacement.

    Yeah, I've checked the code in 1.0.6 on this. It is much clear now. And the structure is different a bit in the DB, so I understand that the Hive DLL is also changed. But good to read that it is fixed by default in 1.0.6. Thanks for the update.

  2. 14 minutes ago, icomrade said:

    Regardless of modifications it's fixed in the HiveExt. SQF Key generation is temporary until restart, and is more robust than in 1.0.5.1, making collisions practically impossible.

    https://github.com/icomrade/DayZhiveEpoch/blob/master/Hive/Source/HiveLib/DataSource/SqlObjDataSource.cpp#L98-L112

     

    Edit: Also moved to 1.0.5.1 mods

    That's good to know, thanks. So ObjectUID's are always different on server restart, because a timestamp is included right? So this fix would only apply for 1.0.5.1 issues. I will will leave the testing part then of 1.0.6 ;)

  3. (Will cover 1.0.5.1 for now, but will also cover a pack for 1.0.6 later. Some of the scripts are already included in 1.0.6, but a customization will be provided in the pack)

    I am starting this thread here for a new script pack for 1.0.5.1 which is going to be tested and optimized for FPS. I will create a GitHub Repository for the files (server & client mission PBO's). Please provide suggestions for scripts to include in the pack. Also let me know if you want to participate and work on the pack on my GitHub repository. The goal is to include basic scripts in the pack. I will try to keep the most scripts as realistic as possible. FPS is an important factor. Scripts that will affect FPS too much will not be included or will be disabled by default.

    The pack will also include a Tool for Windows that will restart and update your server automatically from a GitHub Release or Hotfix. I have created an auto-update system for my server. Configuration can be separated so only the scripts update (Arma2NET files, Server files and Missiion Files)

     

    Scripts to include:

    1. Script Configuration System (Script can be enabled/disabled and settings can be configured per script)
    2. Coin System
    3. Customized WAI Mission system
    4. Customized DZMS Mission system
    5. Customized DZAI Mission system (patrols, custom AI spawns, etc)
    6. Advanced Trading
    7. Safe Zones
    8. Custom Loot Table
    9. Self blood transfusion
    10. Fog Distance View (Binoculars, RangeFinder)
    11. Lift & Tow Vehicles
    12. Welcome Message Script
    13. In-game Rules Script (with database connection)
    14. In-game Update Script (with database connection)
    15. Plot 4 Life
    16. Snap Building Pro
    17. Vector Building
    18. Plot Management
    19. Door Management
    20. Custom GUI
    21. Custom Loading Screen
    22. Humanity-Level Perks (Bike Spawn, ...)
    23. Kill Messages at traders
    24. Kill Notifications
    25. Convoy Missions
    26. Battle Zone (PVP)
    27. Custom Buildings
    28. Custom Traders (Drugs, ...)
    29. Customized Admin Tools (fixed, added starter-packs, anti-hack)
    30. Loyalty Reward for Players
    31. Automated Database Cleaning (old players, old objects, etc.)
    32. Abandoned Vaults Missions (Safes and Lockboxes)
    33. Custom Loot Events (Building Material, Supplies, Weapons, Treasure)
    34. Animated Heli-Crashes and custom loot (configure heavy/light weapons and loot)
    35. Custom Vehicle Spawn List (add/remove vehicles that can spawn)
    36. Quest System
    37. Most Wanted Mission
    38. ... (will be updated soon)

     

    Tools to include:

    1. Auto-Update for the Pack (Configurable)
    2. Trader Configuration
    3. Database Cleaner
  4. 7 minutes ago, LunatikCH said:

    Was fixed in 106 by default afaik

    Also with vector building and plot management? I know some of them are included already, but I have not finished my 1.0.6 server yet to test it :P Does 1.0.6 include Vector Building by default and how does 1.0.6 handle same Worldspace values for the ObjectUID? Is the fix for 0-0 position vehicle spawning also fixed in there?

  5. I have been spending a lot of time to find a robust solution with a calculation algorithm with SQF, but still had issues with it. I have created an Arma2NET AddIn to fix this issue. It requires you to use Arma2NET on the server only. Feel free to try this solution. It does not matter if you are using custom scripts or not like: Plot Management, Vector Building etc.

     

  6. 4 hours ago, LunatikCH said:

    Nive one but wrong forum maybe? this is 106 section 1051 is here: https://epochmod.com/forum/forum/34-a2-epoch-mods-1051/

    This should be working with 1.0.6 too, but I have not tested it yet. I don't know if version 1.0.6 has this problem with ObjectUID's when using Vector Building and Plot Management, but will test that out soon or if someone already has this issue with 1.0.6, please feel free to test the fix and report it here.

  7. NOTE: Still in edit. Could contain some mistakes :)

    Hi everyone,

    I have been struggling a lot finding a working solution for the duplicate ObjectUID generation in the 1.0.5.1 version of the Epoch Mod. On my server I am using custom scripts like:

    • Plot Management
    • Snap Pro
    • Vector Building
    • And more...

    All these custom scripts require additional values in the Worldspace column of your database. In a lot of changes that I have seen, the dayz_objectUID2 function was adapted to to generate some kind of a unique value for each object in your database. This was never working well for me. My database had about 3000-4000 objects and we got sometimes 5-10 duplicates in it. So I decided to use my software coding skills and create a more robust solution which is clean and easy to implement. It does not matter how your worldspace looks like and if you are using several of the above mentioned custom scripts.

    The fix is using numerical 2 hashing alghorithms: MD5 and SHA1. Both are merged with a numerical transformation which provides a unique value. I will test the performance and release separated DLL's using only MD5 or SHA1 soon with some performance results for comparison.

    IMPORTANT:

    It is important not to have duplicate worldspace items in your database. Sometimes the server will spawn several vehicles at position 0,0 on the map. This will cause having same ObjectUID's. I have fixed this too and it is included in the instructions bellow. You will also need to clean your database. This can be done manually or with a tool that I provide with this solution.

    Also, make a backup of your database so you can avoid loosing changes. If anything goes wrong, you can go back and restore as it was before ;)

     

    ARMA2NET:

    First of all, you will need an additional MOD to include on your server. This does not affect your players and they will not need to download anything. I am using Arma2NET as a mod which allows me to create custom DLL's for Arma 2 OA. This DLL contains code to generate hashes of the Worldspace which are unique.

    1. Follow the tutorial on "How to Install and setup Arma2NET".
    2. Download Arma2NET files from Armaholic's website: Click here to download.

     

    Arma2NET Directory:

    1. Go to your @Arma2NET directory in the root of Arma 2 OA.
    2. Go to the AddIns directory.
    3. Download the ZIP from this post and place the ObjectUID directory inside the AddIns folder.
    4. It should look like: @Arma2NET\AddIns\ObjectUID\ObjectUID.dll

     

    Epoch Server Changes:

    Go to your server's PBO file or folder and open server_functions.sqf. Now replace the dayz_objectUID2 and dayz_objectUID3 code with:

    function dayz_objectUID2

    Spoiler

    dayz_objectUID2 = {
        // Credits: FP4P
        // Date: 2017-02-16
        // PayPal: paypal.me/fp4p

        private["_key", "_worldspace", "_tmpArray", "_quoteUnicode"];
        _key = "";
        _worldspace = _this;

        // Convert WorldSpace to a string.
        if(typeName(_worldspace) != "STRING") then {
            _worldspace = str (_this);
            _tmpArray = toArray(_worldspace);
            _quoteUnicode = toArray("""") select 0;
            _tmpArray = _tmpArray - [_quoteUnicode];
            _worldspace = toString(_tmpArray);
        };

        // Call custom UID extension
        _key = "Arma2Net.Unmanaged" callExtension format["GenerateUID %1", _worldspace];

        // Return the generated key.
        _key
    };

    function dayz_objectUID3

    Spoiler

    dayz_objectUID3 = {
        private["_key"];
        _key = _this call dayz_objectUID2;    
        _key
    };

    function spawn_vehicles

    This is a fix for the 0-0 position spawn of vehicles.

    Find code:

    Spoiler

    _objPosition = getPosATL _veh;

    After the above line, place the following check:

    Spoiler

    // Check if position is [0,0]
    _objPosition select 0) == 0 && (_objPosition select 1) == 0) exitWith { diag_log("DEBUG: POSITION: Skip vehicle spawn at position 0-0"); };    

    So end result will be:

    Spoiler

    _objPosition = getPosATL _veh;
            
    // Check if position is [0,0]
    if((_objPosition select 0) == 0 && (_objPosition select 1) == 0) exitWith { diag_log("DEBUG: POSITION: Skip vehicle spawn at position 0-0"); };

     

    Database Fix:

    If you already have a database which is used and contains conflicted ObjectUID's, you will need to fix them manually by changing them before restart or you could use a simple tool I created for this. The tool will be posted here soon. I will make it configurable so you can use it to fix the ObjectUID's in your database.

     

    Credits:

    You are not allowed to change any of the above code or distribute this without my knowledge and permission. Download this resource only from this page to avoid hacked versions. Suggestions for improvements are welcome.

     

    Donations:

    Donations for my work are always welcome. You can donate at http://paypal.me/fp4p. Thank you!

     

    Downloads:

    - ObjectUID Fix - GitHub Download

  8. On 25-11-2015 at 5:09 AM, g0thic_ice_cream said:

    I fixed that and some other bugs with the code, I gave zupa what I fixed so he may have an update for that at some point. I figured I'd let him take a look and decide if he wanted to incorporate the changes.

    The main changes were separating out the vision toolbelt items (binoculars, rangefinders, night vision) because if your toolbelt is full, and those slots are filled it would think you had -2 slots available and would prevent all buying. There was also a section where its looking at the total items vs total space but it was using total space after it had been altered, so I added an extra variable to track the original total space determination.

    There's also a problem for people who don't use coins that I fixed in there too.

    Could you please share this fix with us? I've downloaded the code from Github, but it still contains this bug. Thank you.

×
×
  • Create New...