It would be awesome if this plugin could have a setting to include logging of any destroyed player-owned deployables. But most notably locked storage containers, for example: boxes, fridges, lockers, etc.
Option to log destruction of any player-owned deployables (but most notably locked storage containers)Suggestion
Im not sure. I may transfer ownership of the plugin to someone else who is working on a rewrite
you can edit the .cs and add this on a new line below line 783
if (entity is StorageContainer) LogToFile("explosions", ins.msg("ExplosionMessage").Replace("{AttackerName}", attacker.displayName).Replace("{AttackerId}", attacker.UserIDString).Replace("{EndPos}", PositionToGrid(position)).Replace("{Distance}", Vector3.Distance(position, position).ToString("N2")).Replace("{Weapon}", shortname).Replace("{EntityHit}", entity.ShortPrefabName).Replace("{VictimName}", entity.OwnerID > 0 ? ins.covalence.Players.FindPlayerById(entity.OwnerID.ToString())?.Name ?? entity.OwnerID.ToString() : "No owner").Replace("{OwnerID}", entity.OwnerID.ToString()), this); Hi, and thank you for this, very happy to try and implement this.
So, I modifed the file like so, and this is the diff output:
--- rust_server/oxide/plugins/RaidTracker.cs.orig 2021-06-04 00:05:28.000000000 +0200+++ rust_server/oxide/plugins/RaidTracker.cs 2022-07-15 04:31:15.001080065 +0200@@ -781,6 +781,7 @@{if (_ignoreNoOwners && !entity.OwnerID.IsSteamId()) return;CreateFeed(position, entity.OwnerID, attacker.displayName, attacker.UserIDString, position, shortname, entity.ShortPrefabName);+ if (entity is StorageContainer) LogToFile("explosions", ins.msg("ExplosionMessage").Replace("{AttackerName}", attacker.displayName).Replace("{AttackerId}", attacker.UserIDString).Replace("{EndPos}", PositionToGrid(position)).Replace("{Distance}", Vector3.Distance(position, position).ToString("N2")).Replace("{Weapon}", shortname).Replace("{EntityHit}", entity.ShortPrefabName).Replace("{VictimName}", entity.OwnerID > 0 ? ins.covalence.Players.FindPlayerById(entity.OwnerID.ToString())?.Name ?? entity.OwnerID.ToString() : "No owner").Replace("{OwnerID}", entity.OwnerID.ToString()), this);}}@@ -1475,4 +1476,4 @@#endregion}-}\ No newline at end of file+}
However, this change produces the following error:
RaidTracker.cs(786,255+): error CS1056: Unexpected character `'
Merged post
Ok, I figured out the error, a hidden CRLF character snuck in at the very end of the line while copy-pasting from the forum. I remove it and the error is gone.
So, now I've tested if destroying a Large Wood Box would trigger a notification, but it did not, no errors were logged to the console either... any ideas?
Merged post
Also, if we get this to work, will this log to the in-game chat as well? The LogToFile() makes me think not.
hi, no, it is just to the file