mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-24 15:00:38 +08:00
Update Core to 0.24
This commit is contained in:
parent
9ab7a2a865
commit
0d290d1464
@ -1,7 +1,7 @@
|
|||||||
# style guide
|
# style guide
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
# config
|
# config
|
||||||
miraiVersion=0.23.0
|
miraiVersion=0.24.0
|
||||||
mirai_console_version=0.3.1
|
mirai_console_version=0.3.1
|
||||||
kotlin.incremental.multiplatform=true
|
kotlin.incremental.multiplatform=true
|
||||||
kotlin.parallel.tasks.in.project=true
|
kotlin.parallel.tasks.in.project=true
|
||||||
|
@ -30,6 +30,7 @@ import java.io.File
|
|||||||
import java.io.OutputStream
|
import java.io.OutputStream
|
||||||
import java.io.PrintStream
|
import java.io.PrintStream
|
||||||
import java.io.RandomAccessFile
|
import java.io.RandomAccessFile
|
||||||
|
import java.nio.ByteBuffer
|
||||||
import java.nio.charset.Charset
|
import java.nio.charset.Charset
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import java.util.concurrent.ConcurrentHashMap
|
import java.util.concurrent.ConcurrentHashMap
|
||||||
@ -147,14 +148,14 @@ object MiraiConsoleTerminalUI : MiraiConsoleUI {
|
|||||||
|
|
||||||
override fun createLoginSolver(): LoginSolver {
|
override fun createLoginSolver(): LoginSolver {
|
||||||
return object : 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() }
|
val tempFile: File = createTempFile(suffix = ".png").apply { deleteOnExit() }
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
tempFile.createNewFile()
|
tempFile.createNewFile()
|
||||||
pushLog(0, "[Login Solver]需要图片验证码登录, 验证码为 4 字母")
|
pushLog(0, "[Login Solver]需要图片验证码登录, 验证码为 4 字母")
|
||||||
try {
|
try {
|
||||||
tempFile.writeChannel().apply {
|
tempFile.writeChannel().apply {
|
||||||
writeFully(data)
|
writeFully(ByteBuffer.wrap(data))
|
||||||
close()
|
close()
|
||||||
}
|
}
|
||||||
pushLog(0, "请查看文件 ${tempFile.absolutePath}")
|
pushLog(0, "请查看文件 ${tempFile.absolutePath}")
|
||||||
|
Loading…
Reference in New Issue
Block a user