mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-05 23:50:08 +08:00
78d0b4fd54
* [core] process `wtlogin.trans_emp` to support qrcode login
* [core] fix `wtlogin.trans_emp` protocol
* [core] optimize QRCodeLoginProcessor logic
* [core] fix `wtlogin.trans_emp` outgoing packet
* [core] cancel login when logging a bot which is inconsistent from bot factory
* [core] ignore `flag3` check on ANDROID_WATCH & name `flag1` and `flag2`
* [core] provide default `QRCodeLoginListener` for jvm
* [core] don't catch IllegalStateException in QRCodeLoginProcessor
* [core] Use `LoginSolver.createQRCodeLoginListener()` instead of property; Rename configuration name
* [core] Code improvement
* [core] remove qrcode state lock
* [core] ignore `flag3` when command is `wtlogin.trans_emp` in packet codec
* [core] enable qrcode login for macos
* [core] remove debug property in log
* [core] reformat code
* [core] rename `TransEmpResponse` to `Response`
* [core] assert `flag3Exception` not null first
* [core] remove arg client
* [core] update qrcode login notes
* [core] set custom qrcode size
* [core] Draft BotAuthorization
* [core] make SecretsProtection mpp
* [core] BotAuthorization.byXXX
* [core] Move QRCodeLoginListener to `.auth`
* [core] Protect data of BotAccount
* [core] Add SelectorRequireReconnectException
* [core] Implementation of BotAuthorization
* Revert changes of BotConfiguration
* api dump
* [core] remove passwordMd5 in `BotAccount`
* [mock] Add new bot factory function to mock bot factory
* Delete LoginCommandTest
* [core] Improve QRCode render
* [core] Introduce UnsupportedCaptchaMethodException & UnsupportedQRCodeCaptchaException
* api dump
* update docs
* [core] update `DebugRunHelper`
* [core] add simple block for BotAuthorization
* api dump
* Rename `canDoQRLogin` to `supportsQRLogin`, and specify argument names for MiraiProtocolInternal
* Remove `phoneNumber` parameter from BotAccount
* Make `BotAccount.<init>` with String password parameter TestOnly
* Rename `InconsistentBotException` to `InconsistentBotIdException`
* Rename `QRCodeLoginListener.onStatusChanged` to `QRCodeLoginListener.onStateChanged`
* Rename `BotAuthorizationResult` to `BotAuthResult`
* Rename BotAuthComponent, move internal APIs to internal module
* Logic fixup
* doc update
* QRCodeLoginListener.qrCodeStateUpdateInterval & onIntervalLoop
* console login with BotAuthorization
* update testing
* Update mirai-core-api/src/jvmMain/kotlin/utils/LoginSolver.jvm.kt
* Move AuthControl outside SsoProcessor
* Redesign auth
* Add initialTicket to producerCoroutine
* Revert protocol changes of MACOS
* Fix latch death locking
* Fix CoroutineOnDemandValueScope.receiveOrNull exceptional finish
* Fix exception collecting
* Fix DefaultBotAuthorizationFactory loading
* [core] qrcode login for IPAD protocol
* Revert "[core] qrcode login for IPAD protocol"
This reverts commit
|
||
---|---|---|
.. | ||
compatibility-validation | ||
src | ||
.gitignore | ||
build.gradle.kts | ||
README.md |
mirai-core
mirai 核心实现模块。首先阅读 mirai-core-api/README.md。
本文仅介绍重要部分。
架构
包名 | 描述 |
---|---|
net.mamoe.mirai.internal |
mirai 核心 API 的实现 |
.contact |
联系人实现 |
.message |
消息系统的实现 |
.network |
网络层实现 |
.utils |
工具类 |
net.mamoe.mirai.internal.contact
AbstractContact
所有 Contact
实现的基类. 实现生命周期等.
SendMessageHandler
处理 mirai 消息系统 Message
到协议数据结构的转换, 并处理长消息上传, 音乐转发上传等.
net.mamoe.mirai.internal.message
ReceiveMessageTransformer
处理协议数据结构到 Message
的转换. 设有 RefinableMessage
处理长消息下载, 合并转发下载并展开等.
RefinableMessage
支持处理长消息下载, 合并转发下载并展开等.
Image
实现
图片的实现的基类为 AbstractImage
.
在底层协议, 群图片与私聊图片很不同. 因此图片实现可以是 GroupImage
或 FriendImage
.
图片又细分了 OnlineImage
和 OfflineImage
. 故有 OnlineGroupImage
等四个类型, 及他们分别的 Impl
.
OnlineImage
为通过 Contact.uploadImage
上传得到的, 或刚刚从服务器接收的图片对象. OfflineImage
则为反序列化得到的对象.
MessageSource
实现
MessageSource
在协议底层十分复杂,