LogOres 是什么?
我编写了这个反作弊插件,其思路类似于 NoCheat、FoundDiamonds 和 AntiXRay。它的主要功能是记录玩家挖掘矿石的行为,以便你能够查找作弊模式。它还进行一些计算,使查找这些模式变得更加容易,而不是像以前那样手动关联 FoundDiamonds、LogBlock 等数据(这是我过去使用的方法)。
如何安装?
- 在此处 下载最新版本
- 将 jar 文件复制到你的 plugins 目录中
- 重启 Minecraft 服务器(如果使用 PlugMan,可以通过输入 "/plugman load LogOres" 来实时加载)
- (可选)调整 plugins/LogOres/config.yml 配置文件,然后输入 '/lo reload'(权限 'logores.admin')
源代码可在 此处 获取
更新日志
最新的 config.yml
它是如何工作的?
LogOres 会对矿石活动进行一些基本的检查和计算,帮助你发现作弊者,而无需你自己进行所有手动关联工作。你可以在配置文件中指定想要记录的矿石:
# 默认值为 14 (金), 15 (铁) 和 56 (钻石) - 必须使用数据值
# [URL]http://www.minecraftwiki.net/wiki/Data_values[/URL]
loggedOres:
- 14
- 15
- 56
随后,它会将任何对这些矿石的挖掘行为记录到文件中,如下所示:
[Sat Jul 09 09:30:59 PDT 2011] IRON_ORE broken by morganm at (x= -91, y= 11, z= -47, world=world)
[Sat Jul 09 09:30:59 PDT 2011] IRON_ORE broken by morganm at (x= -92, y= 11, z= -48, world=world)
[Sat Jul 09 09:30:59 PDT 2011] IRON_ORE broken by morganm at (x= -91, y= 10, z= -47, world=world)
[Sat Jul 09 09:31:59 PDT 2011] IRON_ORE broken by morganm at (x= -90, y= 9, z= -48, world=world)
[Sat Jul 09 09:31:59 PDT 2011] IRON_ORE broken by morganm at (x= -90, y= 9, z= -49, world=world)
[Sat Jul 09 09:33:49 PDT 2011] IRON_ORE broken by morganm at (x= -67, y= 38, z= -63, world=world) [t= 109 sec / (d= 40 / b= 101) = r=278.2]
[Sat Jul 09 09:34:39 PDT 2011] IRON_ORE broken by morganm at (x= -49, y= 31, z= -61, world=world) [t= 54 sec / (d= 19 / b= 59) = r=164.1] [flagged]
注意某些条目中新增的额外详细信息,我稍后会对此进行解释。
LogOres 会记录玩家最近开采的矿石,并将其与当前所在位置的矿石进行比较。如果两种矿石之间的距离大于 minDistance(默认值为 5)个方块(以忽略矿石集群),它将输出距离上次开采矿石的时间(t=)、距离(d=)、非矿石方块数量(b=)以及它们之间的比率(r=)。比率的计算方式为:时间 / (距离 / 方块数)。较小的比率数值表示更高的作弊可能性,下文将对此进行更详细的解释。
示例
以下是一些记录的额外信息示例:
# 矿石之间间隔 60 秒,距离为 60,共破坏 120 个方块
# 这是在矿石之间直线挖掘(2 个方块 * 60 的距离 = 120 个方块,即刚好有足够的空间行走)
[t= 60sec / (d= 60 / b= 120) = r=120.0]
# 矿石生成间隔180秒,距离=60,需破坏250个方块
# 此配置下距离相同,但耗时更长且需破坏更多方块才能到达——更符合“正常”挖矿体验
[t= 180秒 / (d= 60 / b= 250) = r=750.0]
# 矿石间间隔180秒,距离=20,破坏250个方块
# 这是一个正常的水平之字形矿道的示例,其中矿石更近,但耗时与上一个示例相同
[t= 180sec / (d= 20 / b= 250) = r=2250.0]
由此可见,矿石之间的距离越近,且到达那里所需的时间/方块数越多,我们作弊的可能性就越小,比率就越高。反之,矿石之间距离越远,且到达那里所需的时间/方块数越少,比率就越低,作弊的可能性就越大。
务必在游戏中核实作弊行为是否确实发生!
请注意,某人拥有较低的比率并不意味着他们一定是作弊者。矿石可能恰好排成一条直线,或者某人只是身处一个幸运的高产矿区域。另一方面,持续出现低比率的挖矿模式,尤其是在极不可能呈直线分布的矿石(如钻石)之间,则表明存在较高的作弊概率。我个人总是传送至这些位置并寻找具有特征性的“作弊隧道”以进行核实——这个插件只是让我能更轻松地将注意力集中在可疑的作弊者身上,而不是手动筛选大量日志来查找他们。
为了进一步帮助轻松聚焦于高概率作弊情况,有一个名为 "flagRatio" 的配置选项,任何低于此值的比率都会在日志条目的末尾追加 '[flagged]'。默认设置为250,我发现这很合理,但你当然可以尝试调整以找到适合你的值。因此,查找可能的作弊变得非常容易:
> grep flagged oreLog.txt
[Sat Jul 09 09:34:39 PDT 2011] IRON_ORE broken by morganm at (x= -49, y= 31, z= -61, world=world) [t= 54sec / (d= 19 / b= 59) = r=164.1] [flagged]
[Sat Jul 09 09:35:09 PDT 2011] IRON_ORE broken by morganm at (x= -51, y= 30, z= -72, world=world) [t= 17sec / (d= 12 / b= 19) = r=26.6] [flagged]
[Sat Jul 09 09:35:39 PDT 2011] GOLD_ORE broken by morganm at (x= -50, y= 30, z= -85, world=world) [t= 23sec / (d= 13 / b= 28) = r=49.0] [flagged]
[Sat Jul 09 09:35:59 PDT 2011] IRON_ORE broken by morganm at (x= -54, y= 30, z= -95, world=world) [t= 19sec / (d= 10 / b= 24) = r=46.3] [flagged]
[2011年7月9日 星期六 09:39:09 PDT] IRON_ORE 被 morganm 破坏 位于 (x= 78, y= 34, z= -104, world=world) [t= 28秒 / (d= 23天 / b= 14块) = r=16.8] [已标记] [洞穴?]
(注:是的,我确实在本地运行了一个矿石作弊来测试,所以这是“真正”的作弊行为,正如你所见,它捕获了我)
补充信息
你还会注意到该插件具备一些基本的洞穴检测功能。它并不会查询大量区块并寻找真正的洞穴,而是简单地计算距离与破坏方块数量之间的关系。如果距离较大且破坏的方块数量较少,那么很可能是一个洞穴(因为玩家无需破坏许多方块就能在矿石之间移动)。这种方法并非绝对可靠,但我发现它相当准确,能够一眼就排除掉大部分误报。
如前所述,你不会在每条日志条目中看到时间/方块数/距离/比率文本。插件仅会在满足配置文件中定义的最小距离/方块条件的方块破坏事件时打印这些信息。这有助于过滤掉矿石簇中那些彼此紧邻的大多数方块破坏事件。因此,如果我只是想大致了解比率系统并排除干扰噪声,一个简单的 grep 命令就会非常有用:
> grep 'r=' oreLog.txt
[周六 7月 09 03:35:15 PDT 2011] IRON_ORE 被破坏 by Player1 at (x= -786, y= 12, z= 1899, world=world) [t= 127sec / (d= 25 / b= 63) = r=318.8]
[周六 7月 09 03:36:35 PDT 2011] IRON_ORE 被破坏 by Player2 at (x= -152, y= 49, z= -249, world=world) [t=1202sec / (d= 3 / b= 403) = r=153182.6]
[周六 7月 09 03:40:45 PDT 2011] IRON_ORE 被破坏 by Player2 at (x= -153, y= 46, z= -252, world=world) [t= 249sec / (d= 5 / b= 147) = r=7178.4]
[Sat Jul 09 03:42:25 PDT 2011] GOLD_ORE broken by Player1 at (x= -836, y= 13, z= 1893, world=world) [t= 418sec / (d= 52 / b= 86) = r=697.1]
关于性能的说明
由于我自己运营服务器,我深知每安装一个新插件都会增加服务器负担,导致在满负载时出现卡顿和延迟。因此,我非常重视插件的性能表现。该插件在主 Bukkit 线程上仅执行最少的处理工作:以最快的整数比较方式完成矿石匹配的基础检查;一旦找到匹配的矿石,便将信息推入队列,由后台工作线程负责后续的所有处理。这意味着,对于拥有多核高性能系统的用户,本插件会充分利用额外的 CPU 核心,确保主 Bukkit 线程不被阻塞,从而保障服务器的流畅运行。
What is LogOres?
I wrote this as an anti-cheat plugin, along the lines of NoCheat, FoundDiamonds and AntiXRay. It's purpose is to log ores that people are mining so that you can look for cheat patterns. It also does some calculations that make it easier to look for these patterns rather than just manually correlating FoundDiamonds, LogBlock, etc (which is what I used to do).
How do I install it?
- Download the latest version here
- Copy the jar file into your plugins directory
- Restart your minecraft server (or if using PlugMan, you can live-load by typing "/plugman load LogOres")
- (Optional) Tweak the plugins/LogOres/config.yml and then type '/lo reload' (permission 'logores.admin')
Source code available here
Changelog
Latest config.yml
How does it work?
LogOres does some basic checks/calculations on ore activity to help you find cheaters without having to do all the manual correlation yourself. You specify the ores you want to log in a config file:
# default 14 (gold), 15 (iron) and 56 (diamond) - MUST USE DATA VALUES
# [URL]http://www.minecraftwiki.net/wiki/Data_values[/URL]
loggedOres:
- 14
- 15
- 56
and then it will log any mining of those ores to a file, like so:
[Sat Jul 09 09:30:59 PDT 2011] IRON_ORE broken by morganm at (x= -91, y= 11, z= -47, world=world)
[Sat Jul 09 09:30:59 PDT 2011] IRON_ORE broken by morganm at (x= -92, y= 11, z= -48, world=world)
[Sat Jul 09 09:30:59 PDT 2011] IRON_ORE broken by morganm at (x= -91, y= 10, z= -47, world=world)
[Sat Jul 09 09:31:59 PDT 2011] IRON_ORE broken by morganm at (x= -90, y= 9, z= -48, world=world)
[Sat Jul 09 09:31:59 PDT 2011] IRON_ORE broken by morganm at (x= -90, y= 9, z= -49, world=world)
[Sat Jul 09 09:33:49 PDT 2011] IRON_ORE broken by morganm at (x= -67, y= 38, z= -63, world=world) [t= 109sec / (d= 40 / b= 101) = r=278.2]
[Sat Jul 09 09:34:39 PDT 2011] IRON_ORE broken by morganm at (x= -49, y= 31, z= -61, world=world) [t= 54sec / (d= 19 / b= 59) = r=164.1] [flagged]
Note the extra details that were added to some entries, I'll explain those further in just a moment.
LogOres keeps track of the most recent ore a person mined and compares that to the current ore. If the ores are > minDistance (default 5) blocks apart (in order to ignore clusters of ore), it will print out the time since last ore (t=), distance (d=), number of non-ore blocks (b=) and the ratio between them (r=) all. The ratio calculation is: time / (distance / blocks). This has the effect that smaller ratio numbers indicate a higher likelihood of cheating, as explained in more detail below.
Examples
Here are some examples of the extra information that is logged:
# 60 seconds between ores, distance=60, 120 blocks broken
# this is mining straight between ores (2 blocks * 60 distance = 120 blocks, ie. just enough room to walk)
[t= 60sec / (d= 60 / b= 120) = r=120.0]
# 180 seconds between ores, distance=60, 250 blocks broken
# this is same distance, but taking longer and breaking more blocks to get there - more "normal" mining
[t= 180sec / (d= 60 / b= 250) = r=750.0]
# 180 seconds between ores, distance=20, 250 blocks broken
# this is an example of a normal horizontal zig-zag mine, where the ore is closer but took just as long as previous example
[t= 180sec / (d= 20 / b= 250) = r=2250.0]
So we can see that the closer the ores are together and the longer time/blocks it takes us to get there, the less likely we are cheating and the higher the ratio. The further the ores are apart and the less time/blocks it takes us to get there, the lower the ratio and the more likely that we are cheating to do it.
Be sure to verify in-game that cheating actually took place!
Please note that someone having a low ratio does not immediately mean they are a cheater. It's possible for ores to just be in a straight line, or for someone to just be in a lucky ore-rich area. On the other hand, a consistent pattern of low ratio ore mining, especially between ores that are very unlikely to be in straight lines (like diamonds) indicates a high cheat probability. I always personally tp to the locations and look for the tell-tale "cheat tunnels" just to verify - this plugin just makes it much easier to focus my attention on likely cheaters rather than manually sifting through lots of logs to find them.
To additionally help make it easy to focus on high-probability cheating, there is a "flagRatio" config option, for which any ratio below this value will append a '[flagged]' to the end of the log entry. By default this is set to 250, which I've found to be reasonable but you can certainly play around with it to find the value that works for you. Thus it becomes a very easy matter to look for possible cheating:
> grep flagged oreLog.txt
[Sat Jul 09 09:34:39 PDT 2011] IRON_ORE broken by morganm at (x= -49, y= 31, z= -61, world=world) [t= 54sec / (d= 19 / b= 59) = r=164.1] [flagged]
[Sat Jul 09 09:35:09 PDT 2011] IRON_ORE broken by morganm at (x= -51, y= 30, z= -72, world=world) [t= 17sec / (d= 12 / b= 19) = r=26.6] [flagged]
[Sat Jul 09 09:35:39 PDT 2011] GOLD_ORE broken by morganm at (x= -50, y= 30, z= -85, world=world) [t= 23sec / (d= 13 / b= 28) = r=49.0] [flagged]
[Sat Jul 09 09:35:59 PDT 2011] IRON_ORE broken by morganm at (x= -54, y= 30, z= -95, world=world) [t= 19sec / (d= 10 / b= 24) = r=46.3] [flagged]
[Sat Jul 09 09:39:09 PDT 2011] IRON_ORE broken by morganm at (x= 78, y= 34, z= -104, world=world) [t= 28sec / (d= 23 / b= 14) = r=16.8] [flagged] [cave?]
(ps. yes I was actually running an ore cheat to test locally, so this is "real" cheating and as you can see, it caught me)
Additional info
You'll also note the plugin has some minimal cave-detection. This doesn't query a bunch of blocks and looking for actual caves, instead it simply does a basic calculation of the distance vs. the number of blocks broken. If the distance is large and the number of blocks broken is low, it's probably a cave (since they didn't have to break many blocks to get between ores). This is not fool-proof, but I've found it to be pretty accurate and it helps weed out false positives at a glance.
As mentioned before, you won't see the time/block/distance/ratio text on every log entry. The plugin only prints it on block breaks that meet the minimum distance/block criteria as defined in the config file. This helps weed out the majority of block breaks in ore clusters, which are right next to each other. Thus if I just want to get a good feel for the ratio system and weed out the noise, another simple grep proves useful:
> grep 'r=' oreLog.txt
[Sat Jul 09 03:35:15 PDT 2011] IRON_ORE broken by Player1 at (x= -786, y= 12, z= 1899, world=world) [t= 127sec / (d= 25 / b= 63) = r=318.8]
[Sat Jul 09 03:36:35 PDT 2011] IRON_ORE broken by Player2 at (x= -152, y= 49, z= -249, world=world) [t=1202sec / (d= 3 / b= 403) = r=153182.6]
[Sat Jul 09 03:40:45 PDT 2011] IRON_ORE broken by Player2 at (x= -153, y= 46, z= -252, world=world) [t= 249sec / (d= 5 / b= 147) = r=7178.4]
[Sat Jul 09 03:42:25 PDT 2011] GOLD_ORE broken by Player1 at (x= -836, y= 13, z= 1893, world=world) [t= 418sec / (d= 52 / b= 86) = r=697.1]
A note on Performance
As I run a server myself, I'm keenly aware that every new plugin I install has a tendency to slow down the server and thus make my server lag and feel sluggish when at max capacity, so I take performance of my plugins very seriously. Minimal processing happens on the main Bukkit thread; it does the bare minimum checks as fast integer comparisons for an ore match and if found, pushes the info into a Queue where it is then picked up by a worker thread that all processing is done on. This means for those of you with beefy multicore systems, this plugin does it's best to take advantage of your additional cores and keep the Main Bukkit thread free to do it's processing in order to keep the server running smooth.
评论 0
登录后参与评分
还没有评论,来抢沙发吧