Commit 2c35f9e4 authored by Him188's avatar Him188

Change id type to UByte

parent 2b3deb24
...@@ -175,7 +175,7 @@ object MiraiServer { ...@@ -175,7 +175,7 @@ object MiraiServer {
val strings = it.split("----").dropLastWhile { it.isEmpty() }.toTypedArray() val strings = it.split("----").dropLastWhile { it.isEmpty() }.toTypedArray()
val bot = Bot(BotAccount(strings[0].toLong(), strings[1]), Console()) val bot = Bot(BotAccount(strings[0].toLong(), strings[1]), Console())
if (runBlocking { bot.network.login(200) } === LoginState.SUCCESS) { if (runBlocking { bot.login() } === LoginState.SUCCESS) {
bot.green("Login succeed") bot.green("Login succeed")
return bot return bot
} }
......
@file:Suppress("EXPERIMENTAL_API_USAGE")
package net.mamoe.mirai.network.protocol.tim.packet.login package net.mamoe.mirai.network.protocol.tim.packet.login
import net.mamoe.mirai.network.protocol.tim.TIMProtocol import net.mamoe.mirai.network.protocol.tim.TIMProtocol
...@@ -25,7 +27,7 @@ class ClientChangeOnlineStatusPacket( ...@@ -25,7 +27,7 @@ class ClientChangeOnlineStatusPacket(
this.writeHex(TIMProtocol.fixVer2) this.writeHex(TIMProtocol.fixVer2)
this.encryptAndWrite(sessionKey) { this.encryptAndWrite(sessionKey) {
writeHex("01 00") writeHex("01 00")
writeByte(loginStatus.id) writeByte(loginStatus.id.toInt())
writeHex("00 01 00 01 00 04 00 00 00 00") writeHex("00 01 00 01 00 04 00 00 00 00")
} }
} }
......
@file:Suppress("EXPERIMENTAL_UNSIGNED_LITERALS", "EXPERIMENTAL_API_USAGE")
package net.mamoe.mirai.utils package net.mamoe.mirai.utils
/** /**
...@@ -8,10 +9,10 @@ package net.mamoe.mirai.utils ...@@ -8,10 +9,10 @@ package net.mamoe.mirai.utils
*/ */
enum class ClientLoginStatus( enum class ClientLoginStatus(
// TODO: 2019/8/31 add more ClientLoginStatus // TODO: 2019/8/31 add more ClientLoginStatus
val id: Int//1 ubyte val id: UByte//1 ubyte
) { ) {
/** /**
* 我在线上 * 我在线上
*/ */
ONLINE(0x0A) ONLINE(0x0Au)
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment