Closed midspace closed 8 years ago
At the moment, I think there is a startup state issue. If you have just set the protection area, it doesn't work. Restarting the Server, it will work. I'm still investigating to verify.
I've retested with the published mod on a clean server, and it works as expected. I'm really confused now. Whatever is failing is intermittent, and hard to narrow down.
Ok, that indeed is weird... I'll look into it later, probably around weekend.
I could not reproduce it at all. I'll look into the code again but I don't have a clue what could've gone wrong. Same thing with the indestructible blocks on servers. I should not be an issue that the protection is enabled by default as there isn't any PA. Only if they invert the protection everything becomes indestructible. But how do you do that by mistake? Oo
That first piece of logic in the DamageHandler may be at fault. Do missiles identify the attacker? If they don't then it will fall through and prevent damage.
But, the defaulting on was bad. In testing I switched it off. Saved the server. Shut down the server. Confirmed the setting in the file. Restarted the server. The setting was back on.
private static void DamageHandler(object target, ref MyDamageInformation info)
{
if (!Config.ProtectionEnabled)
return;
IMySlimBlock block = target as IMySlimBlock;
if (block != null)
{
IMyEntity attacker;
if (MyAPIGateway.Entities.TryGetEntityById(info.AttackerId, out attacker))
{
if (CanDamageBlock(info.AttackerId, block, info.Type))
return;
}
info.Amount = 0;
return;
}
I'll have a look again tomorrow at my protection area config files in case I missed something with the Invert. i don't remember turning it on. It was in my published development mod where the grinding didn't work for anything. The codebase is the same, but the config file may be different from what I tested today. It could be on. Very easy to miss. If that's the case, then we need to make the current state more visible in the List and Cfg sub commands.
Though it does not explain why it suddenly started working for demolish50, when I had not published any updates.
.... Unless it was that Steam Publish bug. :confounded:
In all my testing, the files all show <ProtectionInverted>false</ProtectionInverted>
Ok, I just fixed the issue with missiles/explosions in general. I hope we're done with it now but I leave this open for now in case there are still issues.
Eight months have passed, as there have not been any new concerns raised about this issue, I'm closing it.
I haven't had a close look at the code yet. I have tested on current public version 1.112.013, and it is most definitely not working on dedicated servers. If I run it as single player, it works.