Closed CharlesChou73 closed 5 months ago
The update introduces a new module MultiDialingBlocker
in the PeerBanHelperServer, enhancing its capability to detect and prevent multiple downloads of the same torrent from a single network segment. This is complemented by utility enhancements and new language constants to support the functionality.
File Path | Change Summary |
---|---|
.../PeerBanHelperServer.java |
Added registration for MultiDialingBlocker module. |
.../module/impl/rule/MultiDialingBlocker.java |
New module to block simultaneous torrent downloads from the same network segment. |
.../text/Lang.java & .../util/IpUtil.java |
Added string constants and IP conversion utilities. |
🐰✨ In the code's burrow, deep and wide,
A clever module now resides.
It watches close with keenest eyes,
For sneaky peers in clever guise.
Oh, hop and code, let's block those tries!
🌟🐾
src/main/java/com/ghostchu/peerbanhelper/util/IpUtil.java (2)
`4-12`: The method `ipStr2Int` correctly handles IP string to integer conversion with appropriate error management. --- `15-17`: The method `int2IpStr` efficiently converts an integer IP address back to its string representation.src/main/java/com/ghostchu/peerbanhelper/module/impl/rule/MultiDialingBlocker.java (4)
`56-59`: Constructor initializes module settings correctly. Note the design change to not use direct database interactions (`this.db = db;` is commented out). --- `91-98`: The `reloadConfig` method correctly loads and calculates necessary configuration settings for the module. --- `101-164`: The `shouldBanPeer` method effectively implements the logic for detecting and handling peers that violate the multi-dialing rules, with appropriate use of concurrency and synchronization. --- `174-194`: Utility methods `recoverHuntingList` and the `HuntingTarget` record are correctly implemented to support the module's functionality.src/main/java/com/ghostchu/peerbanhelper/text/Lang.java (1)
`40-43`: Newly added string constants in the `Lang` class are correctly formatted and relevant for the multi-dialing detection feature.src/main/java/com/ghostchu/peerbanhelper/PeerBanHelperServer.java (1)
`262-262`: The registration of the `MultiDialingBlocker` module in the `registerModules` method is correctly implemented with appropriate parameters.
打开 PR 时,请向最新的 btn-2 分支提交更改。并同时添加配置文件升级脚本和示例配置文件。
抱歉不熟悉流程,整改中…
😂没事,没必要搞得这么严肃
通过子网内的ip下载同一种子检测多拨,进行封禁
Summary by CodeRabbit
New Features
MultiDialingBlocker
to detect and block multiple simultaneous downloads of the same torrent from a single network segment, enhancing fair resource usage.Enhancements