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
785ddd73
Commit
785ddd73
authored
Dec 06, 2019
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use enum class to make it available from Java
parent
075d5ca2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
93 deletions
+63
-93
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/login/LoginResult.kt
...oe.mirai/network/protocol/tim/packet/login/LoginResult.kt
+63
-93
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/login/LoginResult.kt
View file @
785ddd73
@
file
:
Suppress
(
"unused"
)
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.packet.login.LoginResult.
Companion.
SUCCESS
import
net.mamoe.mirai.network.protocol.tim.packet.login.LoginResult.SUCCESS
import
net.mamoe.mirai.utils.BotConfiguration
import
net.mamoe.mirai.utils.BotConfiguration
import
kotlin.contracts.ExperimentalContracts
import
kotlin.contracts.ExperimentalContracts
import
kotlin.contracts.InvocationKind
import
kotlin.contracts.InvocationKind
import
kotlin.contracts.contract
import
kotlin.contracts.contract
import
kotlin.jvm.JvmStatic
/**
/**
* 登录结果. 除 [SUCCESS] 外均为失败.
* 登录结果. 除 [SUCCESS] 外均为失败.
* @see LoginResult.requireSuccess 要求成功
* @see LoginResult.requireSuccess 要求成功
*/
*/
inline
class
LoginResult
(
val
id
:
Byte
)
{
enum
class
LoginResult
(
val
id
:
Byte
)
{
companion
object
{
/**
/**
* 登录成功
* 登录成功
*/
*/
@JvmStatic
SUCCESS
(
0
),
val
SUCCESS
=
LoginResult
(
0
)
/**
/**
* 密码错误
* 密码错误
*/
*/
@JvmStatic
WRONG_PASSWORD
(
1
),
val
WRONG_PASSWORD
=
LoginResult
(
1
)
/**
/**
* 被冻结
* 被冻结
*/
*/
@JvmStatic
BLOCKED
(
2
),
val
BLOCKED
=
LoginResult
(
2
)
/**
/**
* QQ 号码输入有误
* QQ 号码输入有误
*/
*/
@JvmStatic
UNKNOWN_QQ_NUMBER
(
3
),
val
UNKNOWN_QQ_NUMBER
=
LoginResult
(
3
)
/**
/**
* 账号开启了设备锁. 暂不支持设备锁登录
* 账号开启了设备锁. 暂不支持设备锁登录
*/
*/
@JvmStatic
DEVICE_LOCK
(
4
),
val
DEVICE_LOCK
=
LoginResult
(
4
)
/**
/**
* 账号被回收
* 账号被回收
*/
*/
@JvmStatic
TAKEN_BACK
(
5
),
val
TAKEN_BACK
=
LoginResult
(
5
)
/**
/**
* 未知. 更换服务器或等几分钟再登录可能解决.
* 未知. 更换服务器或等几分钟再登录可能解决.
*/
*/
@JvmStatic
UNKNOWN
(
6
),
val
UNKNOWN
=
LoginResult
(
6
)
/**
/**
* 包数据错误
* 包数据错误
*/
*/
@JvmStatic
INTERNAL_ERROR
(
7
),
val
INTERNAL_ERROR
=
LoginResult
(
7
)
/**
/**
* 超时
* 超时
*/
*/
@JvmStatic
TIMEOUT
(
8
),
val
TIMEOUT
=
LoginResult
(
8
)
/**
/**
* 网络不可用
* 网络不可用
*/
*/
@JvmStatic
NETWORK_UNAVAILABLE
(
9
),
val
NETWORK_UNAVAILABLE
=
LoginResult
(
9
)
/**
/**
* 需要验证码且 [BotConfiguration.failOnCaptcha] 为 `true`
* 需要验证码且 [BotConfiguration.failOnCaptcha] 为 `true`
*/
*/
@JvmStatic
CAPTCHA
(
10
),
val
CAPTCHA
=
LoginResult
(
10
)
/**
/**
* 该号码长期未登录, 为了保证账号安全, 已被系统设置成保护状态, 请用手机 TIM 最新版本登录, 登录成功后即可自动解除保护模式
* 该号码长期未登录, 为了保证账号安全, 已被系统设置成保护状态, 请用手机 TIM 最新版本登录, 登录成功后即可自动解除保护模式
*/
// TIM的错误代码为 00020
*/
// TIM的错误代码为 00020
val
PROTECTED
=
LoginResult
(
11
)
PROTECTED
(
11
),
@JvmStatic
val
values
:
List
<
LoginResult
>
by
lazy
{
listOf
(
BLOCKED
,
DEVICE_LOCK
,
SUCCESS
,
WRONG_PASSWORD
,
UNKNOWN
,
UNKNOWN_QQ_NUMBER
,
TAKEN_BACK
,
INTERNAL_ERROR
,
TIMEOUT
,
NETWORK_UNAVAILABLE
,
CAPTCHA
,
PROTECTED
)
}
}
}
}
/**
/**
...
...
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