Track RB Raids

We have been using RaidTracker for a long time on our PvE server for tracking Raids with RaidableBases, Unfortunetly with the new V2 version these are no longer tracked. Could this be added back to the V2 version please ? ThanksΒ 

Interesting, I didn't think anyone would care about tracking raids from RaidableBases so I ignored it. I haven't tested this but you can try to remove the code that ignores RaidableBases.

Change:Β 

        private bool IsDecayEntityIgnored(DecayEntity entity)
        {
            if (entity is LootContainer || entity.OwnerID == 0)
                return true;

            if (!_dev && _decayEntityIgnoreList.ContainsKey(entity.PrefabName) && _decayEntityIgnoreList[entity.PrefabName].ignore)
                return true;

            var buildingBlock = entity as BuildingBlock;
            bool ignoreGrade;
            if (!_dev && buildingBlock != null && _config.ignoreBuildingGrades.TryGetValue(buildingBlock.grade, out ignoreGrade) && ignoreGrade)
                return true;

            if (Convert.ToBoolean(RaidableBases?.Call("EventTerritory", entity.transform.position)))
                return true;

            if (Convert.ToBoolean(AbandonedBases?.Call("EventTerritory", entity.transform.position)))
                return true;

            return false;
        }​


To this:

        private bool IsDecayEntityIgnored(DecayEntity entity)
        {
            if (entity is LootContainer || entity.OwnerID == 0)
                return true;

            if (!_dev && _decayEntityIgnoreList.ContainsKey(entity.PrefabName) && _decayEntityIgnoreList[entity.PrefabName].ignore)
                return true;

            var buildingBlock = entity as BuildingBlock;
            bool ignoreGrade;
            if (!_dev && buildingBlock != null && _config.ignoreBuildingGrades.TryGetValue(buildingBlock.grade, out ignoreGrade) && ignoreGrade)
                return true;

            //if (Convert.ToBoolean(RaidableBases?.Call("EventTerritory", entity.transform.position)))
                //return true;

           //if (Convert.ToBoolean(AbandonedBases?.Call("EventTerritory", entity.transform.position)))
                //return true;

            return false;
        }

I tried that but still didnt track unfortunetly, Not a problem though we can use the previous version for it, There is probably not many servers tracking those anyway its a odd request but we do have our reason for tacking them :).

We are using V2 on our pvp server though and it looks and works great, Good Job πŸ‘

I can look into it more when I have some spare time, I'm not sure how RaidableBases assigns ownership to bases spawned by the plugin and that might be blocking it from being tracked. In the same function try to change the first line to this:

    if (entity is LootContainer)
        return true;​

Removing the entity.OwnerID == 0 check will stop entities owned by the server from being ignored, so you might start seeing random entities being logged that aren't actually owned by any players.

A much cheaper resources way of handling this is to use the api Raidable bases offers. An simply keep a list of players that are in a raidable bases zone.

private bool EventTerritory(Vector3 position)
        {
            for (int i = 0; i < Raids.Count; i++)
            {
                if (InRange2D(Raids[i].Location, position, Raids[i].ProtectionRadius))
                {
                    return true;
                }
            }
            return false;
        }

Instead of doing all that, which checks every zone and does math calculations, you have have a very cheap list.Contains check.Β 

Β 

My background from using assembly code and hacking vehicles ecu's makes things like this bother me. I can't keep my silence.



Merged post

If you use my method, just make sure onServerIntialized, you do the foreach loop with the EventTerritory(playerPos) and intialize the list of players in raid zones.