mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-10 04:00:08 +08:00
Old network: delete account secrets on BotOfflineEvent.Force. #1205 for 2.7-M1
This commit is contained in:
parent
57eb716e31
commit
84d444843d
@ -17,7 +17,6 @@
|
||||
|
||||
package net.mamoe.mirai.internal
|
||||
|
||||
import io.ktor.util.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import net.mamoe.mirai.Bot
|
||||
@ -129,6 +128,7 @@ internal abstract class AbstractBot<N : BotNetworkHandler> constructor(
|
||||
}
|
||||
is BotOfflineEvent.Force -> {
|
||||
bot.logger.info { "Connection occupied by another android device: ${event.message}" }
|
||||
bot.asQQAndroidBot().accountSecretsFile.delete()
|
||||
if (event.reconnect) {
|
||||
bot.logger.info { "Reconnecting..." }
|
||||
// delay(3000)
|
||||
|
@ -72,7 +72,7 @@ internal class QQAndroidBot constructor(
|
||||
private val cacheDir: File by lazy {
|
||||
configuration.workingDir.resolve(bot.configuration.cacheDir).apply { mkdirs() }
|
||||
}
|
||||
private val accountSecretsFile: File by lazy {
|
||||
internal val accountSecretsFile: File by lazy {
|
||||
cacheDir.resolve("account.secrets")
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user