A3Wasteland / ArmA3_Wasteland.Altis

A3Wasteland is a survival sandbox mission for Arma 3 where two teams and independent players fight for survival. Built in collaboration between GoT, TPG, KoS, 404Games, and others.
http://a3wasteland.com
GNU Affero General Public License v3.0
104 stars 185 forks source link

Despawning crates. #245

Open LouDnl opened 9 years ago

LouDnl commented 9 years ago

Could the A3W_extDB_SaveUnlockedObjects setting also declare why I am having problems with despawning crates? After about 1 or 2 restarts some (ofcourse not all :() crates are not spawned back in and are gone from the database. Ofcourse no errors to be found.

// Persistence settings A3W_savingMethod = "extDB"; // Method used for saving data ("profile", "iniDB", "extDB") A3W_playerSaving = 1; // Save player data like position, health, inventory, etc. (0 = no, 1 = yes) A3W_moneySaving = 1; // If playerSaving = 1, save player money amount (0 = no, 1 = yes) A3W_combatAbortDelay = 60; // If playerSaving = 1, delay in seconds for which to disable abort and respawn buttons after firing or being shot (0 = none) A3W_purchasedVehicleSaving = 1; // Save vehicles purchased at vehicle stores between server restarts (0 = no, 1 = yes) A3W_missionVehicleSaving = 1; // Save vehicles captured from missions between server restarts (0 = no, 1 = yes) A3W_baseSaving = 1; // Save locked base parts between server restarts (0 = no, 1 = yes) A3W_boxSaving = 1; // Save locked weapon crates and their contents between server restarts (0 = no, 1 = yes) A3W_staticWeaponSaving = 1; // Save locked static weapons and their magazines between server restarts (0 = no, 1 = yes) A3W_warchestSaving = 1; // Save warchest objects deployed by players between server restarts (0 = no, 1 = yes) A3W_warchestMoneySaving = 1; // Save warchest team money between server restarts (0 = no, 1 = yes) A3W_spawnBeaconSaving = 1; // Save spawn beacons between server restarts (0 = no, 1 = yes) A3W_cctvCameraSaving = 1; // Save cctv cameras between restarts (0 = no, 1 = yes) A3W_objectLifetime = 7_24; // Maximum lifetime in hours for saved objects (baseparts, crates, etc. except vehicles) across server restarts (0 = no time limit) A3W_vehicleLifetime = 0; // Maximum lifetime in hours for saved vehicles across server restarts, regardless of usage (0 = no time limit) A3W_vehicleMaxUnusedTime = 2_24; // Maximum parking time in hours after which unused saved vehicles will be marked for deletion (0 = no time limit) A3W_serverSavingInterval = 5*60; // Interval in seconds between automatic vehicle & object saves; should be kept at 1 min for profileNamespace and iniDB, while for extDB it can be relaxed to 3-5 mins

// extDB settings A3W_extDB_SaveUnlockedObjects = 0; // Save and restore unlocked baseparts that were locked at least once during their lifetime (0 = no, 1 = yes)

LouDnl commented 9 years ago

I changed A3W_extDB_SaveUnlockedObjects to 1 and will test again.

LouDnl commented 9 years ago

Could this be related to this error?

3:01:34 "A3Wasteland - world persistence loaded 507 objects from extDB" 3:01:34 Error in expression <[(_vars select _forEachIndex) select 1, _x]; } forEach _x;

vehicles pushBack > 3:01:34 Error position: <_x]; } forEach _x;

vehicles pushBack > 3:01:34 Error Undefined variable in expression: _x 3:01:34 File mpmissions\ArmA3_Wasteland_v1_NLU.Altis\persistence\server\world\extDB\getVehicles.sqf, line 57

LouDnl commented 9 years ago

With A3W_extDB_SaveUnlockedObjects set to 1 the crates were still there after one restart. Will report tomorrow after two more restarts.

LouDnl commented 9 years ago

For now it seems that setting A3W_extDB_SaveUnlockedObjects to 1 'fixes' this problem. Will test more!

LouDnl commented 9 years ago

Rev,

If this is in the mysql log. Is the object (in this case a crate) deleted because it was unlocked or because it expired?

        4 Prepare   DELETE FROM ServerObjects WHERE ID IN (2065)
        4 Execute   DELETE FROM ServerObjects WHERE ID IN (2065)

I'm trying to track down a missing crate. It was there and locked before the restart of 9 pm last night. It was there right after the restart but seemed to dissapear about 7 minutes after the restart. My guess is that someone unlocked it. But seeing as I have A3W_extDB_SaveUnlockedObjects set to 1 it shouldnt be gone right? Unless sold?

LouDnl commented 9 years ago

Apparantly some players saw crates smoke and burn in their bases and they dissapeared... so weird... I only have 1 mission that spawns damagable crates. So they can't all come from there >.<

LouDnl commented 9 years ago

store bought crates also burn...

LouDnl commented 9 years ago

Added the following to spawnStoreObject.sqf

                //Disable damage on store crate
                case ({_object isKindOf _x} count ["Box_NATO_Ammo_F"] > 0):
                {
                    _object allowDamage false;
                };
LouDnl commented 9 years ago

Despawning crates is still an issue on my server. Getting reports that crates that are unlocked, moved and locked again get deleted after a server restart. I tested this by unlocking a crate, waiting for the save rung and then relocking the crate on another place but the crate gets updated normally. Even the database ID stays the same. So can't reproduce it myself. Turning A3W_extDB_SaveUnlockedObjects to 1 temporarily fixes this as also once locked objects get saved. So weird...

LouDnl commented 9 years ago

My addition to spawnStoreObject.sqf didn't seem to help. Had a player who got dissapearing crates again. He bought 20 crates to test and placed them next to each other. They whent up in smoke one by one.... Am unable to reproduce it myself.

JoSchaap commented 9 years ago

IMHO an issue is only an issue if it's reproducible running the current vanilla mission. If we can't reproduce it, it becomes a guessing game (chasing ghosts) which is just a waste of time.

LouDnl commented 9 years ago

I disabled crates in stores. And turned A3W_extDB_SaveUnlockedObjects to 1. Not hearing complaints now. When A3W_extDB_SaveUnlockedObjects is set to 0 even mission objects despawn after relocking sometimes.

LouDnl commented 9 years ago

Rev,

We've been running with A3W_extDB_SaveUnlockedObjects set to 1 for a while now. But as this gave a lot of useless unlocked basebuilding and boxes clutter I set it to 0 yesterday.

Today I had a player complain about a dissapearing box again. He locked his box around 14.45pm and at 15.00pm the server restarted. The box did not spawn back in. The player was next to his boxes this whole time. He locked his boxes once and did not unlock them after he locked them. He found box in a city, so it was a random spawned one.

What I see in the SQL log is this. The object gets saved in the save run, but also gets deleted shortly after. Then gets saved again some minutes later (this was also the last save run before the restart). But for some reason it did not get restored. Why it gets deleted I have no idea.

SQL log:

Around: 150210 14:51:24 190395 Prepare UPDATE ServerObjects SET Class='"Box_IND_WpsSpecial_F"',Position='["11908.103516","9466.660156","0.387047"]',Direction='[[-0.413147,0.910662,-0.0022583],[-0.00159103,0.00175802,0.999997]]',Damage=0.00787402,AllowDamage=0,Variables='[["ownerUID","76561197972222110"],["cmoney",0],["R3F_Side","GUER"]]',Weapons='[["srifle_GM6_SOS_F",1],["arifle_SDAR_F",1],["arifle_MX_SW_F",1],["arifle_MXC_F",1],["arifle_Mk20_GL_F",1]]',Magazines='[["5Rnd_127x108_Mag",8],["20Rnd_556x45_UW_mag",4],["30Rnd_556x45_Stanag",4],["100Rnd_65x39_caseless_mag",3],["30Rnd_65x39_caseless_mag",4]]',Items='[["V_HarnessO_brn",1],["V_PlateCarrierGL_rgr",2],["U_I_GhillieSuit",2],["NVGoggles",4]]',Backpacks='[["B_Carryall_khk",2]]',TurretMagazines='[]',AmmoCargo=0,FuelCargo=0,RepairCargo=0,Locked=1,Deployable=0,LastInteraction=NOW() WHERE ID = 7257 190395 Execute UPDATE ServerObjects SET Class='"Box_IND_WpsSpecial_F"',Position='["11908.103516","9466.660156","0.387047"]',Direction='[[-0.413147,0.910662,-0.0022583],[-0.00159103,0.00175802,0.999997]]',Damage=0.00787402,AllowDamage=0,Variables='[["ownerUID","76561197972222110"],["cmoney",0],["R3F_Side","GUER"]]',Weapons='[["srifle_GM6_SOS_F",1],["arifle_SDAR_F",1],["arifle_MX_SW_F",1],["arifle_MXC_F",1],["arifle_Mk20_GL_F",1]]',Magazines='[["5Rnd_127x108_Mag",8],["20Rnd_556x45_UW_mag",4],["30Rnd_556x45_Stanag",4],["100Rnd_65x39_caseless_mag",3],["30Rnd_65x39_caseless_mag",4]]',Items='[["V_HarnessO_brn",1],["V_PlateCarrierGL_rgr",2],["U_I_GhillieSuit",2],["NVGoggles",4]]',Backpacks='[["B_Carryall_khk",2]]',TurretMagazines='[]',AmmoCargo=0,FuelCargo=0,RepairCargo=0,Locked=1,Deployable=0,LastInteraction=NOW() WHERE ID = 7257

14:52:24 "A3W - 693 baseparts and objects have been saved with extDB"

Around: 150210 14:52:00 190399 Prepare DELETE FROM ServerObjects WHERE ID IN (7160,6546,7257,7258) 190399 Execute DELETE FROM ServerObjects WHERE ID IN (7160,6546,7257,7258)

Around: 150210 14:57:10 190461 Prepare UPDATE ServerObjects SET Class='"Box_IND_WpsSpecial_F"',Position='["11908.103516","9466.660156","0.387049"]',Direction='[[-0.413147,0.910662,-0.0022583],[-0.00159103,0.00175802,0.999997]]',Damage=0.015748,AllowDamage=0,Variables='[["ownerUID","76561197972222110"],["cmoney",0],["R3F_Side","GUER"]]',Weapons='[["srifle_GM6_SOS_F",1],["arifle_SDAR_F",1],["arifle_MX_SW_F",1],["arifle_MXC_F",1],["arifle_Mk20_GL_F",1]]',Magazines='[["5Rnd_127x108_Mag",8],["20Rnd_556x45_UW_mag",4],["30Rnd_556x45_Stanag",4],["100Rnd_65x39_caseless_mag",3],["30Rnd_65x39_caseless_mag",4]]',Items='[["V_HarnessO_brn",1],["V_PlateCarrierGL_rgr",2],["U_I_GhillieSuit",2],["NVGoggles",4]]',Backpacks='[["B_Carryall_khk",2]]',TurretMagazines='[]',AmmoCargo=0,FuelCargo=0,RepairCargo=0,Locked=1,Deployable=0 WHERE ID = 7257 190461 Execute UPDATE ServerObjects SET Class='"Box_IND_WpsSpecial_F"',Position='["11908.103516","9466.660156","0.387049"]',Direction='[[-0.413147,0.910662,-0.0022583],[-0.00159103,0.00175802,0.999997]]',Damage=0.015748,AllowDamage=0,Variables='[["ownerUID","76561197972222110"],["cmoney",0],["R3F_Side","GUER"]]',Weapons='[["srifle_GM6_SOS_F",1],["arifle_SDAR_F",1],["arifle_MX_SW_F",1],["arifle_MXC_F",1],["arifle_Mk20_GL_F",1]]',Magazines='[["5Rnd_127x108_Mag",8],["20Rnd_556x45_UW_mag",4],["30Rnd_556x45_Stanag",4],["100Rnd_65x39_caseless_mag",3],["30Rnd_65x39_caseless_mag",4]]',Items='[["V_HarnessO_brn",1],["V_PlateCarrierGL_rgr",2],["U_I_GhillieSuit",2],["NVGoggles",4]]',Backpacks='[["B_Carryall_khk",2]]',TurretMagazines='[]',AmmoCargo=0,FuelCargo=0,RepairCargo=0,Locked=1,Deployable=0 WHERE ID = 7257

14:58:08 "A3W - 695 baseparts and objects have been saved with extDB"

JoSchaap commented 9 years ago

i dont understand why it tries to update a deleted row. that isn't possible.. it should either NOT delete it at all, or invoke an insert instead of an update imho :)

so he only locked it once, and did not re-lock?

LouDnl commented 9 years ago

Well neither do I lol. It should not delete a locked object. This only happens if I set A3W_extDB_SaveUnlockedObjects to 0. Well it might still happen, but in a different way. The objects that were once locked do not get deleted when this is set to 1. Maybe it removes the saving variables right after a lock? Problem is that this does not always happen.

Also it seems that I am the only one with this problem I think? I implemented R3F 3.1 and reimplemented the objectLockStateMachine.sqf which saves objects. It has worked all this time, and if I did something wrong I cannot find where the problem would reside.

osuapoc commented 9 years ago

I've also gotten reports of crates disappearing, though I've not dug deep enough to see if it is the extDB getting wonky.

-----Original Message----- From: "LouDnl" notifications@github.com Sent: ‎2/‎10/‎2015 10:40 AM To: "A3Wasteland/ArmA3_Wasteland.Altis" ArmA3_Wasteland.Altis@noreply.github.com Subject: Re: [ArmA3_Wasteland.Altis] Despawning crates. (#245)

Well neither do I lol. It should not delete a locked object. This only happens if I set A3W_extDB_SaveUnlockedObjects to 0. Well it might still happen, but in a different way. The objects that were once locked do not get deleted when this is set to 1. Maybe it removes the saving variables right after a lock? Problem is that this does not always happen. Also it seems that I am the only one with this problem I think? I implemented R3F 3.1 and reimplemented the objectLockStateMachine.sqf which saves objects. It has worked all this time, and if I did something wrong I cannot find where the problem would reside. — Reply to this email directly or view it on GitHub.

LouDnl commented 9 years ago

Are you using the vanilla R3F?

osuapoc commented 9 years ago

Yes, we are using the standard R3F found in Vanilla A3Wasteland.

-----Original Message----- From: "LouDnl" notifications@github.com Sent: ‎2/‎10/‎2015 11:01 AM To: "A3Wasteland/ArmA3_Wasteland.Altis" ArmA3_Wasteland.Altis@noreply.github.com Cc: "Bill" springer.83@gmail.com Subject: Re: [ArmA3_Wasteland.Altis] Despawning crates. (#245)

Are you using the vanilla R3F? — Reply to this email directly or view it on GitHub.

LouDnl commented 9 years ago

Ok so that rules out my R3F 3.1 addition and it must be something else. But what -_-

LouDnl commented 9 years ago

Missed your question there. He only locked it once JoSchaap and stayed near it untill the restart. I though he had locked it twice too.

AgentRev commented 9 years ago

https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/commit/e00027fc00ad599733c2218e5c73a61194c81f2b

The crate was getting deleted from the DB due to not satisfying the isObjectSaveable condition after being unlocked, but it wasn't reinserted in the table after being locked again. My solution is to prevent the deletion of saved objects that have been unlocked while the server is running, but they will get cleaned up on restart if A3W_extDB_SaveUnlockedObjects is set to 0.

LouDnl commented 9 years ago

Thank you for this fix Rev. But why wouldn't objects have the right variable if you have just locked it?

This message has been scanned by E.F.A. Project and is believed to be clean.

AgentRev commented 9 years ago

What do you mean "the right variable"? This ain't a variable issue.

LouDnl commented 9 years ago

Nevermind, I was thinking wrong :) With the solution you now give there should be a fix. I'll report back in if crates still dissapear.

LouDnl commented 9 years ago

I have players complaining about despawning crates again. They said crates just whent up in flames right after they spawned in. This is weird as they shouldn't be able to as this gets set in oload.sqf. I can see that the crates that survive have some damage, so it must happen on spawning in.

LouDnl commented 9 years ago

Seems related to #287

LouDnl commented 9 years ago

I wish there was a way to track this problem down. Had someone have 22 crates go up into flames. Not even after a restart but during regular play time.

LouDnl commented 9 years ago

I made a tentative fix for despawning crates. Everything with allowDamage 0 will get its damage reset on spawn in. https://github.com/LouDnl/ArmA3_Wasteland.Altis/commit/01d513b53d9f084d44cea4cab07d3f802ad35451

defused commented 9 years ago

Gonna try this, im having people complaining about crates missing to .. but essentially base parts to, probably the same problem ?