Fix build

This commit is contained in:
Him188 2021-06-13 11:10:12 +08:00
parent c9f98e46d7
commit bebb786b9a
2 changed files with 14 additions and 0 deletions

View File

@ -24,6 +24,8 @@ import net.mamoe.mirai.internal.network.handler.NetworkHandler
import net.mamoe.mirai.internal.network.handler.NetworkHandler.State
import net.mamoe.mirai.internal.network.handler.NetworkHandlerContextImpl
import net.mamoe.mirai.internal.network.handler.NetworkHandlerFactory
import net.mamoe.mirai.internal.network.protocol.data.jce.SvcRespRegister
import net.mamoe.mirai.internal.network.protocol.packet.login.StatSvc
import net.mamoe.mirai.internal.test.AbstractTest
import net.mamoe.mirai.internal.utils.subLogger
import net.mamoe.mirai.utils.MiraiLogger
@ -90,6 +92,12 @@ internal abstract class AbstractRealNetworkHandlerTest<H : NetworkHandler> : Abs
nhEvents.add(NHEvent.DoHeartbeatNow)
networkLogger.debug { "HeartbeatProcessor.doStatHeartbeatNow" }
}
override suspend fun doRegisterNow(networkHandler: NetworkHandler): StatSvc.Register.Response {
nhEvents.add(NHEvent.DoHeartbeatNow)
networkLogger.debug { "HeartbeatProcessor.doRegisterNow" }
return StatSvc.Register.Response(SvcRespRegister())
}
})
set(KeyRefreshProcessor, object : KeyRefreshProcessor {
override suspend fun keyRefreshLoop(handler: NetworkHandler) {}

View File

@ -16,6 +16,7 @@ import net.mamoe.mirai.internal.network.context.SsoSession
import net.mamoe.mirai.internal.network.handler.NetworkHandler
import net.mamoe.mirai.internal.network.handler.logger
import net.mamoe.mirai.internal.network.handler.state.StateObserver
import net.mamoe.mirai.internal.network.protocol.data.jce.SvcRespRegister
import net.mamoe.mirai.internal.network.protocol.packet.login.StatSvc
import net.mamoe.mirai.utils.debug
@ -33,4 +34,9 @@ internal open class TestSsoProcessor(private val bot: QQAndroidBot) : SsoProcess
override suspend fun logout(handler: NetworkHandler) {
bot.network.logger.debug { "SsoProcessor.logout" }
}
override suspend fun sendRegister(handler: NetworkHandler): StatSvc.Register.Response {
bot.network.logger.debug { "SsoProcessor.sendRegister" }
return StatSvc.Register.Response(SvcRespRegister())
}
}