Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
2c35f9e4
Commit
2c35f9e4
authored
Oct 07, 2019
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change id type to UByte
parent
2b3deb24
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
mirai-console/src/main/java/net/mamoe/mirai/MiraiServer.kt
mirai-console/src/main/java/net/mamoe/mirai/MiraiServer.kt
+1
-1
mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/network/protocol/tim/packet/login/ClientChangeOnlineStatusPacket.kt
...otocol/tim/packet/login/ClientChangeOnlineStatusPacket.kt
+3
-1
mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/ClientLoginStatus.kt
...jvmMain/kotlin/net/mamoe/mirai/utils/ClientLoginStatus.kt
+3
-2
No files found.
mirai-console/src/main/java/net/mamoe/mirai/MiraiServer.kt
View file @
2c35f9e4
...
@@ -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
}
}
...
...
mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/network/protocol/tim/packet/login/ClientChangeOnlineStatusPacket.kt
View file @
2c35f9e4
@
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"
)
}
}
}
}
...
...
mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/ClientLoginStatus.kt
View file @
2c35f9e4
@
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
(
0
x0A
)
ONLINE
(
0
x0A
u
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment