
Mods / Grief Logger
Author: codeAtorium
Side: Server
Created: Mar 27th 2024 at 4:22 PM
Last modified: Apr 30th 2024 at 5:05 PM
Downloads: 3025
Follow Unfollow 12
Latest release (for Vintage Story 1.19.0 - 1.19.3, 1.19.4 and 1.19.5 - 1.19.7, outdated):
grief_logger_0.0.23.zip
1-click install
This mod works by storing information about placed and broken/used blocks in the savegame file. When a user first places a block in a chunk, it marks the chunk with a unique id, and used that id to key the placed block information in the file. Then, when a user breaks a block, it checks for the presence of that id, and if it finds it, compares the block being broken to the blocks in that chunk's placed block information. If it finds a matching block that was placed by a different player, it marks that in a single table. The mod creates a grief-log.csv file that is openable in Google Sheets or Microsoft Excel.
It outputs a grief_log.json file to the modconfig folder where you can set a few settings. This will allow you to trim the length of the grief log, whitelist low value items like soil, set the chat group that receives the grief announcement (acceptable vakyes are: AllChatGroups, ConsoleGroup, DamageLogChatGroup, GeneralChatGroup, InfoLogChatGroup, ServerInfoChatGroup), and limit the announcements by the player's role (remove any roles from the list you don't want).
The mod also detects when a player places a bomb within radius of a griefable block and announces it once (not for all blocks in threat, since there are many).
The mod also detects animal griefing. In order to be recognized, the animal must be non-wild (generation 1), and must be on claimed land that is not the killing player's. Thanks to funnybunnyofdoom whose code on github helped me to accomplish this.
Remember that this mod tracks ownership of all placed blocks. That means it can be used to determine who placed a block next to claimed land, or on top of public paths. (Breaking the block will reveal who placed it in the grieflog.)
Please let me know if you're experiencing any errors or slowdowns on your server.
UPDATE: I will not be continuing development of this or any of my mods. Please feel free to fork them and continue development.
Mod Version | For Game version | Downloads | Release date | Changelog | Download | 1-click mod install* |
---|---|---|---|---|---|---|
0.0.23 | 285 | Apr 30th 2024 at 5:05 PM | grief_logger_0.0.23.zip | 1-click install | ||
silenced logging | ||||||
0.0.22 | 117 | Apr 29th 2024 at 4:40 AM | grief_logger_0.0.22.zip | 1-click install | ||
-fixed a modconfig issue with CHAT_CODE_WHITELIST and CHAT_ROLES | ||||||
0.0.21 | 174 | Apr 26th 2024 at 3:45 AM | grief_logger_0.0.21.zip | 1-click install | ||
attempting to fix the streamwriter closing | ||||||
0.0.20 | 149 | Apr 24th 2024 at 9:28 PM | grief_logger_0.0.20.zip | 1-click install | ||
dealing with null claims | ||||||
0.0.19 | 127 | Apr 21st 2024 at 8:03 AM | grief_logger_0.0.19.zip | 1-click install | ||
auto log output | ||||||
0.0.18 | 127 | Apr 17th 2024 at 12:25 AM | grief_logger_0.0.18.zip | 1-click install | ||
with animals again; different claim check :P | ||||||
0.0.17 | 135 | Apr 16th 2024 at 11:58 PM | grief_logger_0.0.17.zip | 1-click install | ||
disabled animals for now | ||||||
0.0.16 | 134 | Apr 16th 2024 at 9:39 PM | grief_logger_0.0.16.zip | 1-click install | ||
replaced all api with sapi | ||||||
0.0.14 | 120 | Apr 16th 2024 at 8:55 PM | grief_logger_0.0.14.zip | 1-click install | ||
more checking | ||||||
0.0.13 | 127 | Apr 16th 2024 at 5:05 PM | grief_logger_0.0.13.zip | 1-click install | ||
animals update | ||||||
0.0.12 | 126 | Apr 16th 2024 at 3:13 AM | grief_logger_0.0.12.zip | 1-click install | ||
loglines to catch null errors | ||||||
0.0.11 | 133 | Apr 16th 2024 at 1:19 AM | grief_logger_0.0.11.zip | 1-click install | ||
Detects when a bomb has been placed near an owned block. Big refactor. Hopefully I didn't break anything... | ||||||
0.0.10 | 138 | Apr 15th 2024 at 4:30 AM | grief_logger_0.0.10.zip | 1-click install | ||
Another try to prevent unreproducable error in possibleGriefEvent. Here I've patched it out before the function call on blockSel and byPlayer. I dunno.... | ||||||
0.0.9 | 141 | Apr 15th 2024 at 3:18 AM | grief_logger_0.0.9.zip | 1-click install | ||
This removes an unneccesary servent/client side check that was causing an error for an unknown reason on some block breaks. It shouldn't be necessary since it's server only anyway. | ||||||
0.0.8 | 133 | Apr 13th 2024 at 4:19 AM | grief_logger_0.0.8.zip | 1-click install | ||
Added a few additional null checks to prevent errors | ||||||
0.0.7 | 132 | Apr 12th 2024 at 4:49 PM | grief_logger_0.0.7.zip | 1-click install | ||
This was a significant update.
| ||||||
0.0.6 | 150 | Mar 29th 2024 at 5:56 AM | grief_logger_0.0.6.zip | 1-click install | ||
Added config file and chat logging | ||||||
0.0.2 | 150 | Mar 28th 2024 at 7:24 AM | grief_logger_0.0.2.zip | 1-click install | ||
Now stores placed data on a per chunk basis to reduce lag. Source is in zip. | ||||||
0.0.1 | 154 | Mar 27th 2024 at 4:46 PM | Empty | griefloggerwithharmony_0.0.1.zip | 1-click install | |
0.0.0 | 134 | Mar 28th 2024 at 6:18 PM | grief_logger_0.0.4.zip | |||
Cleaned up the code quite a bit. Also added map coordinates to the grief log. | ||||||
0.0.0 | 132 | Mar 28th 2024 at 2:17 PM | grief_logger_0.0.4.zip | |||
Updated to run on server only. |
works on 1.20, but every time a stone block or dirt block is mined, it says "object refrence is not set to an instance of an object" in the server console. Doesn't cause any issues other than console bloat
Does anyone know if this works on 1.20?
And where is that csv file located?
28.5.2024 16:29:35 [Error] Object reference not set to an instance of an object.
28.5.2024 16:29:43 [Error] Exception: Index and count must refer to a location within the string. (Parameter 'count')
at System.String.Remove(Int32 startIndex, Int32 count)
at grieflogger.griefloggerModSystem.OnEntityDeath(Entity entity, DamageSource damageSource) in C:\Users\jgord\source\repos\grief_logger\grief_logger\grief_loggerModSystem.cs:line 532
at Vintagestory.API.Common.Entities.Entity.Die(EnumDespawnReason reason, DamageSource damageSourceForDeath) in VintagestoryApi\Common\Entity\Entity.cs:line 1706
at Vintagestory.API.Common.EntityPlayer.Die(EnumDespawnReason reason, DamageSource damageSourceForDeath) in VintagestoryApi\Common\Entity\EntityPlayer.cs:line 1177
at Vintagestory.GameContent.EntityBehaviorHealth.OnEntityReceiveDamage(DamageSource damageSource, Single& damage) in VSEssentials\Entity\Behavior\BehaviorHealth.cs:line 169
at Vintagestory.API.Common.Entities.Entity.ReceiveDamage(DamageSource damageSource, Single damage) in VintagestoryApi\Common\Entity\Entity.cs:line 813
at Vintagestory.GameContent.AiTaskMeleeAttack.attackTarget() in VSEssentials\Entity\AI\Task\TasksImpl\AiTaskMeleeAttack.cs:line 173
at Vintagestory.GameContent.AiTaskMeleeAttack.ContinueExecute(Single dt) in VSEssentials\Entity\AI\Task\TasksImpl\AiTaskMeleeAttack.cs:line 146
at Vintagestory.GameContent.AiTaskManager.OnGameTick(Single dt) in VSEssentials\Entity\AI\Task\AiTaskManager.cs:line 174
at Vintagestory.GameContent.EntityBehaviorTaskAI.OnGameTick(Single deltaTime) in VSEssentials\Entity\AI\Task\BehaviorTaskAI.cs:line 114
at Vintagestory.API.Common.Entities.Entity.OnGameTick(Single dt) in VintagestoryApi\Common\Entity\Entity.cs:line 874
at Vintagestory.API.Common.EntityAgent.OnGameTick(Single dt) in VintagestoryApi\Common\Entity\EntityAgent.cs:line 540
at Vintagestory.Server.ServerSystemEntitySimulation.TickEntities(Single dt) in VintagestoryLib\Server\Systems\World\EntitySimulation.cs:line 330
at Vintagestory.Server.ServerSystemEntitySimulation.OnServerTick(Single dt) in VintagestoryLib\Server\Systems\World\EntitySimulation.cs:line 169
at Vintagestory.Server.ServerMain.Process() in VintagestoryLib\Server\ServerMain.cs:line 886
GRIEFLOG (claim error): Object reference not set to an instance of an object.
shown in console without further infos
Also the grief logger makes players jump to the info chat tab every time someone is griefing, which is kind of annoying.
It should log without forcing people to another chat tab.
@MadGnome
You might need to delete your old modconfig file to get this new version working.
Getting quite a few error messages in my logs:
server-main, server-event
9.4.2024 07:59:26 [Error] Mod exception during DidUseBlock
9.4.2024 07:59:26 [Error] Exception: Object reference not set to an instance of an object.
at grieflogger.griefloggerModSystem.getLogString(String locString, IServerPlayer byPlayer, BlockSelection blockSel, List`1 oldData) in C:\Users\jgord\source\repos\grief_logger\grief_logger\grief_loggerModSystem.cs:line 172
at grieflogger.griefloggerModSystem.possibleGriefEvent(IServerPlayer byPlayer, BlockSelection blockSel) in C:\Users\jgord\source\repos\grief_logger\grief_logger\grief_loggerModSystem.cs:line 214
at Vintagestory.Server.ServerEventManager.TriggerDidUseBlock(IServerPlayer player, BlockSelection blockSel) in VintagestoryLib\Server\ServerEventManager.cs:line 553
Some feedback from testing this out on a server currently, we seem to avg around 6-15 players online. We are currently running it on VS 1.19.7, server has 100+ mods on it.
Haven't noticed any performance issues yet, it's handy getting the grief notifications, our players have been poking and prodding it to see how it works.
Couple of things.
Is there anyway to filter the messages to just the admins, or by role?
It logs griefs when a small team is sharing the same claimed space, even though they have the permissions from claims to mine those blocks. Could a feature be added to not report griefing, or disable that chat message, when players have permissions to mine blocks in a claim?
Would there be a way to get the messages in the main chat, since discord bots don't recognize other chat channels. If the server does a reset the logs are lost, but if it's in the main chat to discord it's recorded there forever for an Admin to find it.
I appreciate the work you've put into this, so far it's working very well and we haven't encountered any errors while testing. (I'm in the main VS Discord under the same name)
This is great! Let's colaborate if you'd like to. I'd like to help get animal tracking into this. I sent you a discord request.
Currently this is only tested on 1.19.5, but I expect that it proably works for 1.19.* and maybe 1.18.*. If you test it and find it does or doesn't work, please let me know.
Has this been tested for 1.19.3?
I think it will work in 1.19.4, but I haven't tested it. I marked it as compatible, but let me know if you have issues.
work in 1.19.4 ?
Now it requires installation on the server only. The client doesn't need it.
I think I have a solution to the lag issues that other mod ran into. I'm storing the placement data on a per chunk basis, which makes it much quicker to query and save. That new version is live. I've included the source in it, if anyone wants to take a look.
i guess ill wait.
check out https://mods.vintagestory.at/blocklog i think all its code wasnt turned into a dll file. it might help, with progression. RogueRaiden, yah the one i posted. we stopped using it, cause of the lag it would cause xD having something like https://www.spigotmc.org/resources/logblock.67333/ for VS would be amazing xD
This could be an absolutely amazing addition to servers!
The last mod that was doing this was fantastic for a while but it ended up causing world saves to take several seconds, 5-10+ seconds at times with lots of activity (20+ player activity after several hours, problem would compound). Made it too much of a issue to use.
Looking forward to more updates!