mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-02 12:50:16 +08:00
Add @UseExperimental
This commit is contained in:
parent
b104f7b102
commit
b56e0ace2e
@ -1,28 +1,15 @@
|
|||||||
package japttest;
|
package japttest;
|
||||||
|
|
||||||
import kotlinx.coroutines.BuildersKt;
|
|
||||||
import kotlinx.coroutines.GlobalScope;
|
|
||||||
import net.mamoe.mirai.Bot;
|
|
||||||
import net.mamoe.mirai.BotAccount;
|
|
||||||
import net.mamoe.mirai.network.protocol.tim.packet.login.LoginResult;
|
import net.mamoe.mirai.network.protocol.tim.packet.login.LoginResult;
|
||||||
import net.mamoe.mirai.network.protocol.tim.packet.login.SubmitPasswordPacket;
|
|
||||||
import test.JaptTestKt;
|
import test.JaptTestKt;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public class SuspendTest {
|
public class SuspendTest {
|
||||||
|
|
||||||
public static void main(String[] args) throws InterruptedException {
|
public static void main(String[] args) {
|
||||||
// TODO: 2019/12/6 Kotlin or IDE bug here
|
// TODO: 2019/12/6 Kotlin or IDE bug here
|
||||||
boolean bool = JaptTestKt.getLoginResult() == LoginResult.YOU_CAN_WRITE_ANY_THING;
|
boolean bool = JaptTestKt.getLoginResult() == LoginResult.YOU_CAN_WRITE_ANY_THING;
|
||||||
|
|
||||||
BuildersKt.runBlocking(GlobalScope.INSTANCE.getCoroutineContext(), (scope, continuation) -> {
|
|
||||||
Bot bot = new Bot(new BotAccount(1994701021L, ""), scope.getCoroutineContext());
|
|
||||||
if (bot.network.login(continuation) instanceof SubmitPasswordPacket.LoginResponse.Success) {
|
|
||||||
System.out.println("login successful");
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
|
|
||||||
System.out.println("Hello world finished");
|
System.out.println("Hello world finished");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ import net.mamoe.mirai.network.protocol.tim.packet.login.LoginResult
|
|||||||
import net.mamoe.mirai.network.protocol.tim.packet.login.ShareKey
|
import net.mamoe.mirai.network.protocol.tim.packet.login.ShareKey
|
||||||
import net.mamoe.mirai.network.protocol.tim.packet.login.TouchKey
|
import net.mamoe.mirai.network.protocol.tim.packet.login.TouchKey
|
||||||
import net.mamoe.mirai.utils.DecryptionFailedException
|
import net.mamoe.mirai.utils.DecryptionFailedException
|
||||||
|
import net.mamoe.mirai.utils.MiraiInternalAPI
|
||||||
import net.mamoe.mirai.utils.decryptBy
|
import net.mamoe.mirai.utils.decryptBy
|
||||||
import net.mamoe.mirai.utils.io.*
|
import net.mamoe.mirai.utils.io.*
|
||||||
import org.pcap4j.core.BpfProgram.BpfCompileMode
|
import org.pcap4j.core.BpfProgram.BpfCompileMode
|
||||||
@ -329,6 +330,7 @@ internal object DebugNetworkHandler : BotNetworkHandler<DataPacketSocketAdapter>
|
|||||||
|
|
||||||
override suspend fun login(): LoginResult = LoginResult.SUCCESS
|
override suspend fun login(): LoginResult = LoginResult.SUCCESS
|
||||||
|
|
||||||
|
@UseExperimental(MiraiInternalAPI::class)
|
||||||
override suspend fun addHandler(temporaryPacketHandler: TemporaryPacketHandler<*, *>) {
|
override suspend fun addHandler(temporaryPacketHandler: TemporaryPacketHandler<*, *>) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user