IrishOfficial
Detailed logging for player loot events. Supports logging to Console, File System, and Discord

Supported Games
GameServerKingsGameServerKings
works with

Player Loot Logs records detailed looting events and sends them to the configured outlets (Console, File System, and Discord).

Configuration

Default configuration

{
  "Console": {
    "Enabled": false,
    "FormatLootDropSelf": "[{0:yyyy/MM/dd HH:mm:ss}] {8} dropped {3} ({4}) while looting {1}",
    "FormatLootDropTarget": "[{0:yyyy/MM/dd HH:mm:ss}] {8} dropped {3} ({4}) from {1}",
    "FormatLootGive": "[{0:yyyy/MM/dd HH:mm:ss}] {8} gave {3} ({4}) to {1}",
    "FormatLootTake": "[{0:yyyy/MM/dd HH:mm:ss}] {8} looted {3} ({4}) from {1}"
  },
  "Discord": {
    "WebHookUrl": null
    "Enabled": false,
    "FormatLootDropSelf": "[{0:yyyy/MM/dd HH:mm:ss}] {8} dropped {3} ({4}) while looting {1}",
    "FormatLootDropTarget": "[{0:yyyy/MM/dd HH:mm:ss}] {8} dropped {3} ({4}) from {1}",
    "FormatLootGive": "[{0:yyyy/MM/dd HH:mm:ss}] {8} gave {3} ({4}) to {1}",
    "FormatLootTake": "[{0:yyyy/MM/dd HH:mm:ss}] {8} looted {3} ({4}) from {1}",
  },
  "File": {
    "DelaySeconds": 60,
    "FileNameFormat": "{0:yyyyMMdd}",
    "Enabled": false,
    "FormatLootDropSelf": "[{0:yyyy/MM/dd HH:mm:ss}] {8} dropped {3} ({4}) while looting {1}",
    "FormatLootDropTarget": "[{0:yyyy/MM/dd HH:mm:ss}] {8} dropped {3} ({4}) from {1}",
    "FormatLootGive": "[{0:yyyy/MM/dd HH:mm:ss}] {8} gave {3} ({4}) to {1}",
    "FormatLootTake": "[{0:yyyy/MM/dd HH:mm:ss}] {8} looted {3} ({4}) from {1}"
  },
  "Tracking": {
    "Player": true,
    "PlayerCorpse": true,
    "PlayerTeam": true
  },
    "TrackSpecificSteamIds": [
  ]
}

Enhanced Discord Configuration

  "Discord": {
    "WebHookUrl": null,
    "Enabled": true,
    "FormatLootGive": "``[{8}]{9}`` gave __{3}__ ({4}) to ``[{1}]{2}`` at ``teleportpos ({11},{12},{13})``",
    "FormatLootTake": "``[{8}]{9}`` looted __{3}__ ({4}) from ``[{1}]{2}`` at ``teleportpos ({11},{12},{13})``",
    "FormatLootDropSelf": "``[{8}]{9}``  dropped __{3}__ ({4}) while looting ``[{1}]{2}`` at ``teleportpos ({11},{12},{13})``",
    "FormatLootDropTarget": "``[{8}]{9}`` dropped __{3}__ ({4}) from ``[{1}]{2}`` at ``teleportpos ({11},{12},{13})``"
  }

Format

The format messages in the configuration can use any of the below arguments.

0: DateTimeOffset use regular formatting, Ex: {0:yyyyMMddHHmmss} = 20220317155122
1: Target Display Name, Ex: RustGamer01
2: Target Steam ID, Ex: 01234567890123456
3: Item Name, Ex: scrap.item
4: Item Change Amount, Ex: 256
5: Item Condition (Value), Ex: {0:000.0000#} = 034.05897
6: Item Condition Max (Value), Ex: {0.00} = 42.00
7: Item Condition (Percent), Ex: {0:#.###} = 81.09
8: Looter Display Name(s), comma-delimited (if more than one), Ex: LootFirst, QuestionLater
9: Looter Steam ID(s), comma-delimited (if more than one), Ex: 54123678965432178, 98745321456872586
10: Display name and Id, comma-delimited (if more than one), Ex: LootFirst[54123678965432178], QuestionLater[98745321456872586]
11: The Target Entity X Position ("East/West"), Ex: 431
12: The Target Entity Y Position ("Height"), Ex: 7
13: The Target Entity Z Position ("North/South"), Ex: -104

These arguments can be used to further customize the log entries.

Integrations

There are currently three logging implementations available: Console, File System, and Discord.

Console

To enable console, simply set Console:Enabled to true.

File System

File system logging can be enabled by setting File:Enabled to true. By default, the logs will save to /oxide/logs/PlayerLootLogs/playerlootlogs_[yyyyMMdd].txt. The date format can be configured via the File.FileNameFormat setting.

To change the delay between updating the log file, you can change the File:DelaySeconds setting. By default, this is set to 60, which means the log will be updated every 60 seconds.

Warning: Updating the File:FileNameFormat will determine the interval that new log files are created. By default, it is set to daily. Be cautious when modifiying this file format. Please make sure that you are familiar with date and time format strings before updating this.

Discord

Discord integration is manged with the help of the Discord Logger plugin. Once the plugin is installed, a webhook for the desired discord channel must be configured. The newly created webhook url can be set in Discord:WebHookUrl before finally setting Discord:Enabled to true.

Note: There are additional settings in Discord Logger that can be configured. These setting interactions are not tested on my end and should only be used at your own discretion.

Limiting to specific players

The setting "TrackSpecificSteamIds" can be modified to allow only certain players to be tracked. This tracks both the id being looted and doing the looting. If this is left empty, all players will be tracked. You can add players for tracking by inputting their steam ids, separated by commas.

Output

By default, the output of these logs will look like:

[2022/03/18 04:06:21] zenmarev looted pumpkin.item (20) from RustGamer01
[2022/03/18 04:06:22] zenmarev looted ammo_rifle.item (13) from RustGamer01
[2022/03/18 04:06:23] zenmarev looted pumpkin_seed.item (13) from RustGamer01
[2022/03/18 04:07:47] zenmarev gave keycard_red.item (1) to RustGamer01
[2022/03/18 04:07:47] zenmarev gave keycard_red.item (1) to RustGamer01
[2022/03/18 04:07:54] zenmarev gave ak47u.item (1) to RustGamer01
[2022/03/18 04:07:55] zenmarev dropped ak47u.item (1) from RustGamer01

By using the arguments, the output can be customized. As an example:

    "FormatLootDropSelf": "[{0:yyyy/MM/dd HH:mm:ss}] {8} dropped {3} ({4}) while looting {1}",
    "FormatLootDropTarget": "[{0:yyyy/MM/dd HH:mm:ss}] Someone dropped {4} {3} right out of {1}'s bag!",
    "FormatLootGive": "[{0:yyyy/MM/dd HH:mm:ss}] {1} was gifted  {4} {3} from {8}!",
    "FormatLootTake": "[{0:yyyy/MM/dd HH:mm:ss}] {8} stole {4} x {3} from player {1}[{2}]"

This will produce:

[2022/03/18 04:06:21] zenmarev stole 20 x pumpkin.item from player RustGamer01[01234567890123456]
[2022/03/18 04:06:21] zenmarev stole 13 x ammo_rifle.item from player RustGamer01[01234567890123456]
[2022/03/18 04:06:21] zenmarev stole 13 x pumpkin_seed.item from player RustGamer01[01234567890123456]
[2022/03/18 04:07:47] RustGamer01 was gifted  1 keycard_red.item from zenmarev! 
[2022/03/18 04:07:47] RustGamer01 was gifted  1 ak47u.item from zenmarev!
[2022/03/18 04:07:55] Someone dropped 1 ak47u.item right out of RustGamer01's bag!

Enhanced Output

This will produce:

[Ha7riD]76561198877375763 looted metal_refined.item (5) from [YpreeGlosa]76561199044765413 at teleportpos (-437,12,311)
[Ha7riD]76561198877375763 looted leather.item (12) from [YpreeGlosa]76561199044765413 at teleportpos (-437,12,311)
[Ha7riD]76561198877375763 looted scrap.item (44) from [YpreeGlosa]76561199044765413 at teleportpos (-437,12,311)
MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.