Update Core to 0.24

This commit is contained in:
PeratX 2020-03-02 23:53:09 +08:00
parent 9ab7a2a865
commit 0d290d1464
2 changed files with 5 additions and 4 deletions

View File

@ -1,7 +1,7 @@
# style guide
kotlin.code.style=official
# config
miraiVersion=0.23.0
miraiVersion=0.24.0
mirai_console_version=0.3.1
kotlin.incremental.multiplatform=true
kotlin.parallel.tasks.in.project=true
@ -17,4 +17,4 @@ coroutinesIoVersion=0.1.16
ktorVersion=1.3.1
klockVersion=1.7.0
# gradle plugin
protobufJavaVersion=3.10.0
protobufJavaVersion=3.10.0

View File

@ -30,6 +30,7 @@ import java.io.File
import java.io.OutputStream
import java.io.PrintStream
import java.io.RandomAccessFile
import java.nio.ByteBuffer
import java.nio.charset.Charset
import java.util.*
import java.util.concurrent.ConcurrentHashMap
@ -147,14 +148,14 @@ object MiraiConsoleTerminalUI : MiraiConsoleUI {
override fun createLoginSolver(): LoginSolver {
return object : LoginSolver() {
override suspend fun onSolvePicCaptcha(bot: Bot, data: IoBuffer): String? {
override suspend fun onSolvePicCaptcha(bot: Bot, data: ByteArray): String? {
val tempFile: File = createTempFile(suffix = ".png").apply { deleteOnExit() }
withContext(Dispatchers.IO) {
tempFile.createNewFile()
pushLog(0, "[Login Solver]需要图片验证码登录, 验证码为 4 字母")
try {
tempFile.writeChannel().apply {
writeFully(data)
writeFully(ByteBuffer.wrap(data))
close()
}
pushLog(0, "请查看文件 ${tempFile.absolutePath}")