Bases disappear, probably because of no stored scrap?Bug

Hello,

my players found out that bases that used to use the online/offline protection, who no longer have stored the necessary amount of scrap, decay or nearly disappear. Thats pretty bad and im not sure how to fix that.

Bases disappear when they used protection. Bases that never stored scrap in their tc dont decay... any help?

Just to clear things up, you're not expecting the raid protecion to also protect from decay right? Because this plugin does not protect bases from decaying, if players don't put in the neccesary resources (wood, stones, ect..) their bases will still decay and eventually disappear, even if they have "Raid Protection". This plugin protects bases from raiding damage, not decay.

Does this help? Or am I misunderstanding the issue? Let me know!

Hi mate, yes, I am aware that the plugin doesnt stop decay. I didnt noticed any further bases that have been wiped out of nowhere. So maybe it was just a server side temporary bug.

Oh okay, just making sure, let me know if anything else seems off. The plugin shouldn't affect decay or disappearing bases, maybe their protection ran out and got raided?

I also have had two players report this exact same thing happening. Both had plenty of scrap and resources in their TC yet one base completely dissapered and the other vanished all but a few foundations and walls.

Its a pve server so it was not raided by any players. 

I'm not having a moan but I think you need to look into this. I have removed the plugin for now and all seems ok. Would be nice if you could replicate this matter and hopefully come up with some sort of resolution.

Merged post

Don't know if its related but this has also been an issue:

23/08/2021 08:27:53 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1894ms
23/08/2021 08:27:43 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2332ms
23/08/2021 08:27:33 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2236ms
23/08/2021 08:27:23 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1897ms
23/08/2021 08:27:13 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1042ms
22/08/2021 21:34:06 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1555ms
22/08/2021 21:33:46 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2341ms
22/08/2021 21:33:36 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2290ms
22/08/2021 21:33:26 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1662ms
22/08/2021 21:24:53 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1394ms
22/08/2021 21:24:43 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1737ms
22/08/2021 21:24:23 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 4075ms
22/08/2021 21:24:12 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 3846ms
22/08/2021 21:24:02 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 3862ms
22/08/2021 21:23:52 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 3353ms
22/08/2021 21:23:42 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2744ms
22/08/2021 21:16:09 | Calling 'OnEntitySpawned' on 'ScrapRaidProtection v1.2.4' took average 1746ms
22/08/2021 21:15:59 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1973ms
22/08/2021 21:15:49 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2383ms
22/08/2021 21:15:29 | Calling 'OnEntitySpawned' on 'ScrapRaidProtection v1.2.4' took average 2394ms
22/08/2021 21:15:19 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1816ms
22/08/2021 21:15:09 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1793ms
22/08/2021 21:14:59 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1900ms
22/08/2021 21:14:49 | Calling 'OnEntitySpawned' on 'ScrapRaidProtection v1.2.4' took average 1606ms
22/08/2021 21:14:29 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1049ms
22/08/2021 21:11:38 | Calling 'OnEntityKill' on 'ScrapRaidProtection v1.2.4' took average 1018ms
22/08/2021 21:11:17 | Calling 'OnEntityKill' on 'ScrapRaidProtection v1.2.4' took average 1641ms
22/08/2021 21:11:07 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2109ms
22/08/2021 21:10:57 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2440ms
22/08/2021 21:10:50 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took 242ms [GARBAGE COLLECT]
22/08/2021 21:10:37 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2720ms
22/08/2021 21:10:27 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2406ms
22/08/2021 21:10:17 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2977ms
22/08/2021 21:10:07 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 3631ms
22/08/2021 21:09:57 | Calling 'OnEntityKill' on 'ScrapRaidProtection v1.2.4' took average 4039ms
22/08/2021 21:09:47 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 4104ms
22/08/2021 21:09:37 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 4000ms
22/08/2021 21:09:17 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 3239ms
22/08/2021 21:09:07 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2439ms
22/08/2021 21:08:57 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2531ms
22/08/2021 21:08:47 | Calling 'OnEntityKill' on 'ScrapRaidProtection v1.2.4' took average 2731ms
22/08/2021 21:08:26 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 3104ms
22/08/2021 21:08:16 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 3052ms
22/08/2021 21:08:06 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2534ms
22/08/2021 21:07:56 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1947ms
22/08/2021 19:37:32 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1930ms
22/08/2021 19:37:22 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2065ms
22/08/2021 19:35:01 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1707ms
22/08/2021 19:34:21 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1362ms
22/08/2021 19:34:11 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2038ms
22/08/2021 19:33:51 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2041ms
22/08/2021 19:33:41 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2086ms
22/08/2021 19:33:20 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1986ms
22/08/2021 19:33:10 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2106ms
22/08/2021 19:33:00 | Calling 'OnEntityDeath' on 'ScrapRaidProtection v1.2.4' took average 2108ms
22/08/2021 19:32:50 | Calling 'OnEntityKill' on 'ScrapRaidProtection v1.2.4' took average 2115ms
22/08/2021 19:32:40 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2167ms
22/08/2021 19:32:30 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2138ms
22/08/2021 19:32:20 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2209ms
22/08/2021 19:32:10 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2071ms
22/08/2021 19:32:00 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2058ms
22/08/2021 19:31:50 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2065ms
22/08/2021 19:31:40 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2085ms
22/08/2021 19:31:20 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2029ms
22/08/2021 19:30:50 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2139ms
22/08/2021 19:30:39 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2080ms
22/08/2021 19:30:29 | Calling 'OnEntitySpawned' on 'ScrapRaidProtection v1.2.4' took average 1912ms
22/08/2021 19:30:19 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2015ms
22/08/2021 19:30:09 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1880ms
22/08/2021 19:29:59 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1999ms
22/08/2021 19:29:49 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1990ms
22/08/2021 19:29:39 | Calling 'OnEntitySpawned' on 'ScrapRaidProtection v1.2.4' took average 1918ms
22/08/2021 19:29:29 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1843ms
22/08/2021 19:29:19 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1941ms
22/08/2021 19:29:09 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2020ms
22/08/2021 19:28:59 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2082ms
22/08/2021 19:28:38 | Calling 'OnEntityKill' on 'ScrapRaidProtection v1.2.4' took average 2073ms
22/08/2021 19:28:28 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1445ms
22/08/2021 19:28:18 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1363ms
22/08/2021 19:28:08 | Calling 'OnEntityKill' on 'ScrapRaidProtection v1.2.4' took average 1373ms
22/08/2021 19:27:58 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1412ms
22/08/2021 19:27:48 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1397ms
22/08/2021 19:27:38 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1515ms
22/08/2021 19:27:28 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1465ms
22/08/2021 19:27:07 | Calling 'OnEntityDeath' on 'ScrapRaidProtection v1.2.4' took average 1482ms
22/08/2021 19:26:47 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1368ms
22/08/2021 19:26:27 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1475ms
22/08/2021 19:26:17 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1481ms
22/08/2021 19:26:07 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1456ms
22/08/2021 19:25:57 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1411ms
22/08/2021 19:25:47 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1595ms
22/08/2021 19:25:37 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1478ms
22/08/2021 19:25:27 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1532ms
22/08/2021 19:25:06 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1432ms
22/08/2021 19:24:56 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1526ms
22/08/2021 19:24:46 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1512ms
22/08/2021 19:24:36 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1527ms
22/08/2021 19:24:16 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1530ms
22/08/2021 19:24:06 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1434ms
22/08/2021 19:23:56 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1530ms
22/08/2021 19:23:36 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1481ms
22/08/2021 19:23:26 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1442ms
22/08/2021 19:23:16 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1435ms
22/08/2021 19:23:06 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1523ms
22/08/2021 19:22:56 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1488ms
22/08/2021 19:22:36 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1504ms
22/08/2021 19:22:25 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1370ms
22/08/2021 19:22:15 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1377ms
22/08/2021 19:22:05 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1413ms
22/08/2021 19:21:55 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1397ms
22/08/2021 19:21:45 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1332ms
22/08/2021 19:21:35 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1420ms
22/08/2021 19:21:25 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1414ms
22/08/2021 19:21:05 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1355ms
22/08/2021 19:20:55 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1468ms
22/08/2021 19:20:45 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1528ms
22/08/2021 19:20:35 | Calling 'OnEntitySpawned' on 'ScrapRaidProtection v1.2.4' took average 1571ms
22/08/2021 19:20:25 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1480ms
22/08/2021 19:19:44 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1586ms
22/08/2021 19:19:34 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1485ms
22/08/2021 19:19:24 | Calling 'OnEntitySpawned' on 'ScrapRaidProtection v1.2.4' took average 1646ms
22/08/2021 19:19:04 | Calling 'OnEntitySpawned' on 'ScrapRaidProtection v1.2.4' took average 1424ms
22/08/2021 19:18:54 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1438ms
22/08/2021 19:18:44 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1567ms
22/08/2021 19:18:34 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1442ms
22/08/2021 19:18:14 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1411ms
22/08/2021 19:17:54 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1457ms
22/08/2021 19:17:44 | Calling 'OnEntitySpawned' on 'ScrapRaidProtection v1.2.4' took average 1453ms
22/08/2021 19:17:34 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1470ms
22/08/2021 19:17:24 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1497ms
22/08/2021 19:17:13 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1527ms
22/08/2021 19:17:03 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1435ms
22/08/2021 19:16:33 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1329ms
22/08/2021 19:16:23 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1364ms
22/08/2021 19:16:03 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1296ms
22/08/2021 19:15:53 | Calling 'OnEntitySpawned' on 'ScrapRaidProtection v1.2.4' took average 1297ms
22/08/2021 19:15:43 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1362ms
22/08/2021 19:15:33 | Calling 'OnEntitySpawned' on 'ScrapRaidProtection v1.2.4' took average 1271ms
22/08/2021 19:15:23 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1301ms
22/08/2021 19:15:13 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1350ms
22/08/2021 19:15:03 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1369ms
22/08/2021 19:14:53 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1396ms
22/08/2021 19:14:32 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1408ms
22/08/2021 19:14:22 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 1392ms
22/08/2021 17:53:22 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2471ms
22/08/2021 17:53:12 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2490ms
22/08/2021 17:52:51 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2461ms
22/08/2021 17:52:41 | Calling 'OnEntitySpawned' on 'ScrapRaidProtection v1.2.4' took average 2381ms
22/08/2021 17:52:21 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2414ms
22/08/2021 17:52:11 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2386ms
22/08/2021 17:52:01 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2257ms
22/08/2021 17:51:41 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2482ms
22/08/2021 17:51:21 | Calling 'OnEntityKill' on 'ScrapRaidProtection v1.2.4' took average 2508ms
22/08/2021 17:51:10 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2404ms
22/08/2021 17:51:00 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2489ms
22/08/2021 17:50:50 | Calling 'OnEntitySpawned' on 'ScrapRaidProtection v1.2.4' took average 2472ms
22/08/2021 17:50:40 | Calling 'OnEntityKill' on 'ScrapRaidProtection v1.2.4' took average 2424ms
22/08/2021 17:50:30 | Calling 'OnEntityKill' on 'ScrapRaidProtection v1.2.4' took average 2494ms
22/08/2021 17:50:20 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2555ms
22/08/2021 17:50:00 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2348ms
22/08/2021 17:49:50 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2435ms
22/08/2021 17:49:40 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2439ms
22/08/2021 17:49:30 | Calling 'OnEntityKill' on 'ScrapRaidProtection v1.2.4' took average 2489ms
22/08/2021 17:49:20 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2492ms
22/08/2021 17:49:00 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2480ms
22/08/2021 17:48:50 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2420ms
22/08/2021 17:48:40 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2368ms
22/08/2021 17:48:30 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2350ms
22/08/2021 17:48:19 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2507ms
22/08/2021 17:48:09 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2405ms
22/08/2021 17:47:49 | Calling 'OnEntityKill' on 'ScrapRaidProtection v1.2.4' took average 2429ms
22/08/2021 17:47:39 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2486ms
22/08/2021 17:47:29 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2392ms
22/08/2021 17:47:19 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2563ms
22/08/2021 17:47:09 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2423ms
22/08/2021 17:46:59 | Calling 'OnEntitySpawned' on 'ScrapRaidProtection v1.2.4' took average 2417ms
22/08/2021 17:46:49 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2480ms
22/08/2021 17:46:38 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2493ms
22/08/2021 17:46:18 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2399ms
22/08/2021 17:46:08 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2426ms
22/08/2021 17:45:58 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2351ms
22/08/2021 17:45:48 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2433ms
22/08/2021 17:45:38 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2383ms
22/08/2021 17:45:28 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2266ms
22/08/2021 17:45:18 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2246ms
22/08/2021 17:45:08 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2374ms
22/08/2021 17:44:58 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2437ms
22/08/2021 17:44:48 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2378ms
22/08/2021 17:44:38 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2315ms
22/08/2021 17:44:28 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2307ms
22/08/2021 17:44:18 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2236ms
22/08/2021 17:44:08 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2218ms
22/08/2021 17:43:57 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2293ms
22/08/2021 17:43:47 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2279ms
22/08/2021 17:43:37 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2210ms
22/08/2021 17:43:27 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2421ms
22/08/2021 17:43:17 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2424ms
22/08/2021 17:43:07 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2409ms
22/08/2021 17:42:57 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2424ms
22/08/2021 17:42:47 | Calling 'OnEntitySpawned' on 'ScrapRaidProtection v1.2.4' took average 2414ms
22/08/2021 17:42:37 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2349ms
22/08/2021 17:42:27 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2425ms
22/08/2021 17:42:07 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2414ms
22/08/2021 17:41:57 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2350ms
22/08/2021 17:41:47 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2358ms
22/08/2021 17:41:37 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2426ms
22/08/2021 17:41:27 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2434ms
22/08/2021 17:41:06 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2371ms
22/08/2021 17:40:56 | Calling 'OnEntityTakeDamage' on 'ScrapRaidProtection v1.2.4' took average 2458ms
22/08/2021 17:40:46 | Calling 'OnEntitySpawned' on 'ScrapRaidProtection v1.2.4' took average 2417ms
 
Maybe @nivex can help find what's going on?



Merged post

I did try the new verion the other day and have just installed it again and now this error is coming up in the console:

25/08 05:19:53 | Failed to run a 1.00 timer in 'RaidProtection v2.1.4' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.RaidProtection+ProtectedCupboard.UpdateHighestProtectionLevel () [0x000c5] in <35391e99ccf2487a99ed138edd000d37>:0
at Oxide.Plugins.RaidProtection+ProtectedCupboard..ctor (BuildingPrivlidge priv) [0x000c4] in <35391e99ccf2487a99ed138edd000d37>:0
at Oxide.Plugins.RaidProtection+ProtectedCupboard.InitCupboard (BuildingPrivlidge priv) [0x00030] in <35391e99ccf2487a99ed138edd000d37>:0
at Oxide.Plugins.RaidProtection.<LoadAllTcs>m__0 () [0x0002b] in <35391e99ccf2487a99ed138edd000d37>:0
at Oxide.Core.Libraries.Timer+TimerInstance.FireCallback () [0x00018] in <0fbce81d88d64454b3e7abb24df7026b>:0

I think a cache for GetBuildingPrivilege() is the only real solution. perhaps some implementation of this would work:

using Oxide.Plugins.TCacheEx;
using System;
using System.Collections.Generic;
using System.Linq;

namespace Oxide.Plugins
{
    [Info("TCache", "nivex", "0.1.0")]
    [Description("Cache to efficiently find a tool cupboard for an entity.")]
    class TCache : RustPlugin
    {
        private Cache cache = new Cache();

        public class Cache
        {
            public List<BuildingPrivlidge> TCs { get; set; }

            private Dictionary<BaseCombatEntity, BuildingPrivlidge> cache { get; set; } = new Dictionary<BaseCombatEntity, BuildingPrivlidge>();

            public BuildingPrivlidge Find(DecayEntity decayEntity)
            {
                foreach (var tc in TCs)
                {
                    if (tc.buildingID == decayEntity.buildingID)
                    {
                        return tc;
                    }
                }

                return decayEntity.GetBuildingPrivilege();
            }

            public BuildingPrivlidge Find(BaseCombatEntity entity)
            {
                BuildingPrivlidge priv;
                if (cache.TryGetValue(entity, out priv) && priv.IsValid() && !priv.IsDestroyed)
                {
                    return priv;
                }

                priv = entity.GetBuildingPrivilege();

                if (priv == null)
                {
                    return null;
                }

                cache[entity] = priv;

                return priv;
            }

            public void Remove(BuildingPrivlidge priv)
            {
                cache.RemoveAll((e, tc) => e == null || e.IsDestroyed || priv == tc);
            }
        }

        private void Init()
        {
            Unsubscribe(nameof(OnEntitySpawned));
            Unsubscribe(nameof(OnEntityKill));
            Unsubscribe(nameof(OnEntityDeath));
        }

        private void OnServerInitialized(bool isStartup)
        {
            cache.TCs = BaseNetworkable.serverEntities.OfType<BuildingPrivlidge>().ToList();
            Subscribe(nameof(OnEntitySpawned));
            Subscribe(nameof(OnEntityKill));
            Subscribe(nameof(OnEntityDeath));
        }

        private void OnEntitySpawned(BuildingPrivlidge priv) => cache.TCs.Add(priv);

        private void OnEntityKill(BuildingPrivlidge priv) => cache.Remove(priv);

        private void OnEntityDeath(BuildingPrivlidge priv, HitInfo hitInfo) => cache.Remove(priv);
    }
}

namespace Oxide.Plugins.TCacheEx
{
    public static class TCacheEx
    {
        public static void RemoveAll<TKey, TValue>(this IDictionary<TKey, TValue> dict, Func<TKey, TValue, bool> predicate)
        {
            var keys = new List<TKey>();

            foreach (var x in dict)
            {
                if (predicate(x.Key, x.Value))
                {
                    keys.Add(x.Key);
                }
            }

            keys.ForEach(key => dict.Remove(key));
        }
    }
}​

Structures are still dissapearing on my server which kind of sucks becasue this is a really good plugin and the idea is awesome. But I have now made the decision to remove it from the server unfortunately due to the instability and issues. I was hoping that with the new version it wouldn't happen anymore but since i instaled it, player and even myself have had items dissapearing. Since removing it 6 hours ago, everything is fine again and nothing has gone.

I really hope that you can get this plugin working without errors. I look forward to that day.

I'll look into this

Any more progress on this with the newer versions?