告示牌记录器
这是一个服务器端模组,允许追踪世界中告示牌的编辑行为。它可以将这些事件记录到服务器的控制台,并将其存储到数据库中。该模组提供了一个检查模式,可以快速查看与特定坐标相关的告示牌编辑日志。
功能
检查模式
如果你在服务器上拥有 OP(管理员)权限,可以通过 /sign-logger inspect true 和 /sign-logger inspect false 分别切换开启或关闭检查模式。进入检查模式后,你将无法破坏或放置任何方块。左键点击当前已放置的任意方块,即可查看该方块坐标处的告示牌编辑日志。你还可以右键点击一个方块,以查看你右键所点击的面相邻坐标处的告示牌编辑日志。
死亡或离开服务器时,检查模式将自动禁用。
告示牌编辑日志
目前会存储四种类型的告示牌编辑事件,它们均包含关于作者、位置、世界以及事件发生时间的信息。具体如下:
-
文本更改事件:对应玩家将告示牌的文本更改为其他内容时发生的事件。包括告示牌旧文本和新文本的信息,以及文本编辑发生的告示牌侧面。将鼠标悬停在日志中的告示牌侧面部分,即可查看编辑前后文本的对比。
-
上蜡告示牌事件:对应玩家对告示牌进行上蜡操作,使其无法再被进一步编辑时发生的事件。
-
染色告示牌事件:对应玩家使用染料更改告示牌文字颜色的操作。包含旧颜色与新颜色的信息,以及发生颜色变化的告示牌侧面。将鼠标悬停在日志中的“告示牌侧面”部分,可查看文字颜色的变更前后的对比。
-
发光告示牌事件:对应玩家使用发光墨囊或墨囊为告示牌文字添加或移除发光效果的操作。包含执行此操作的告示牌侧面的信息。
你还可以通过 /sign-logger settings do_console_logs true|false 在控制台中切换告示牌编辑日志的记录。
数据库
签名编辑日志会被存储在一个简单的数据库中。你可以通过 /sign-logger database purge 命令配置以天为单位的保留时间,用于清除超过该时间的旧日志。你也可以使用 /sign-logger database purge_older_than_x_days <整数值> 来指定具体要清除多少天前的日志。
服务器关闭时,数据库也将根据配置文件中指定的 purge_logs_older_than_x_amount 值自动清除。
配置文件
服务器启动时,模组会在游戏的配置文件夹中查找已有的 sign-logger.toml 文件。如果存在,则会从中读取配置值;如果不存在,则会在 /config/sign-logger.toml 处创建一个新的配置文件。随后你可以编辑该文件以配置模组,并通过重启服务器来应用更改,或者使用游戏内的命令 /sign-logger reload_config。
以下是在模组首次初始化,或在服务器/世界关闭期间模组未能找到配置文件时生成的默认配置文件:
#与数据库行为相关的设置。
[database]
#(默认 = 30) 配置用于清理过期日志条目的天数(即清理早于指定时间的日志条目)。
#不能设置为低于 1 的值或小数。
purge_logs_older_than_x_amount = 1
#可切换的设置,用于自定义模组的行为。
[settings]
#(默认 = true) 切换是否在控制台中记录告示牌编辑实例。
do_console_logging = true
支持
如果你想报告错误或提出建议,可以通过模组的 问题追踪器 进行反馈,或加入我的 Discord 服务器。
Sign Logger
This server side mod allows for the tracking of sign editions in the world. It can log these events to the server's console, as well as store them to a database. The mod features an inspection mode to quickly see the sign=edit logs associated with a specific coordinate.
Features
Inspection mode
If you have OP permissions in the server, you are able to toggle inspection mode via /sign-logger inspect true and /sign-logger inspect false, respectively. Once in inspection mode, you will not be able to break or place any blocks. Left click any currently placed block to see the sign-edit logs of the coordinates of the clicked block. You can also right click a block to to see the sign-edit logs of the coordinate adjacent to the face of the block you right clicked.
Inspection mode will be automatically disabled upon dying or leaving the server.
Sign-edit logging
There are currently four types of sign edit events that get stored, all of which include information about the author, the position, the world, and the time at which this event happened. These are:
- Changed Text event: Corresponds to when a player changes the text of a sign to another. Includes information about the old and new text of the sign, as well as the side of the sign where the text edition happened. Hover your cursor over the sign side section of the log to see the before and after the of the edited text.
- Waxed Sign event: Corresponds to when a player waxes a sign, preventing it from being edited further.
- Dyed Sign event: Corresponds to when a player changes the color of the text of a sign by applying a dye. Includes information about the old and new color of the text, and the side of the sign where the color change happened. Hover your cursor over the sign side section of the log to see the before and after of the color of the text.
- Glowed Sign event: Corresponds to when a player applies or removes the glow effect from the text of a sign, by using a glow ink sac or an ink sac, respectively. Includes information about the side of the sign where this action was performed.
You can also toggle the logging of sign-edits in the console via /sign-logger settings do_console_logs true|false.
Database
The sign-edit logs get stored in a simple database. You can configure the time in days that will be used to purge logs older than the time specified via /sign-logger database purge. You can specify the amount of days with /sign-logger database purge_older_than_x_days <whole number value>.
The database will also be automatically purged upon server shutdown, using the purge_logs_older_than_x_amount value specified in the configuration file.
Configuration File
When the server is started, the mod will look for an existing sign-logger.toml file for the config folder of your game. If it exists, it will read the values from there. If not, it will create a new config file in /config/sign-logger.toml. You can then edit this file to configure the mod, and restart the server to apply the changes, or use the /sign-logger reload_config in-game command.
The following is the default configuration file generated upon first mod initialization or whenever the mod fails to find the config file during server or world shutdown.
#Settings related to the behavior of the database.
[database]
#(Default = 30) Configure the time in days that will be used to purge log entries older than the time specified.
#Cannot be set to a value lower than 1 or a decimal value.
purge_logs_older_than_x_amount = 1
#Toggleable settings to customize the behavior of the mod.
[settings]
#(Default = true) Toggle the logging of sign edit instances in the console.
do_console_logging = true
Support
If you would like to report a bug, or make a suggestion, you can do so via the mod's issue tracker or join my Discord server.
评论 0
登录后参与评分
还没有评论,来抢沙发吧