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
fc99e972
Commit
fc99e972
authored
Jan 18, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
298d0139
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
114 deletions
+76
-114
mirai-console/build.gradle
mirai-console/build.gradle
+2
-1
mirai-console/src/main/kotlin/MiraiConsole.kt
mirai-console/src/main/kotlin/MiraiConsole.kt
+19
-26
mirai-console/src/main/kotlin/net/mamoe/mirai/plugin/PluginBase.kt
...sole/src/main/kotlin/net/mamoe/mirai/plugin/PluginBase.kt
+55
-87
No files found.
mirai-console/build.gradle
View file @
fc99e972
...
@@ -3,7 +3,8 @@ apply plugin: "java"
...
@@ -3,7 +3,8 @@ apply plugin: "java"
dependencies
{
dependencies
{
api
project
(
':mirai-core'
)
api
project
(
':mirai-core'
)
runtimeOnly
files
(
':mirai-core-timpc'
)
api
project
(
':mirai-core-timpc'
)
runtimeOnly
files
(
'../mirai-core-timpc/build/classes/kotlin/jvm/main'
)
runtimeOnly
files
(
'../mirai-core/build/classes/kotlin/jvm/main'
)
runtimeOnly
files
(
'../mirai-core/build/classes/kotlin/jvm/main'
)
// classpath is not set correctly by IDE
// classpath is not set correctly by IDE
}
}
mirai-console/src/main/kotlin/MiraiConsole.kt
View file @
fc99e972
...
@@ -18,34 +18,27 @@ fun main() {
...
@@ -18,34 +18,27 @@ fun main() {
println
(
"\"login qqnumber qqpassword \" to login a bot"
)
println
(
"\"login qqnumber qqpassword \" to login a bot"
)
println
(
"\"login qq号 qq密码 \" 来登陆一个BOT"
)
println
(
"\"login qq号 qq密码 \" 来登陆一个BOT"
)
thread
{
processNextCommandLine
()
}
thread
{
PluginManager
.
loadPlugins
()
loop
@
while
(
true
)
{
}
var
command
=
readLine
()
if
(
command
!=
null
)
{
tailrec
fun
processNextCommandLine
()
{
var
commandArgs
=
command
.
split
(
" "
)
val
commandArgs
=
readLine
()
?.
split
(
" "
)
?:
return
when
(
commandArgs
[
0
])
{
when
(
commandArgs
[
0
])
{
"login"
->
{
"login"
->
{
if
(
commandArgs
.
size
<
3
)
{
if
(
commandArgs
.
size
<
3
)
{
println
(
"\"login qqnumber qqpassword \" to login a bot"
)
println
(
"\"login qqnumber qqpassword \" to login a bot"
)
println
(
"\"login qq号 qq密码 \" 来登陆一个BOT"
)
println
(
"\"login qq号 qq密码 \" 来登录一个BOT"
)
continue
@
loop
return
processNextCommandLine
()
}
}
val
qqNumber
=
commandArgs
[
1
].
toLong
()
val
qqNumber
=
commandArgs
[
1
].
toLong
()
val
qqPassword
=
commandArgs
[
2
]
val
qqPassword
=
commandArgs
[
2
]
println
(
"login..."
)
println
(
"login..."
)
GlobalScope
.
launch
{
GlobalScope
.
launch
{
Bot
(
qqNumber
,
qqPassword
)
Bot
(
qqNumber
,
qqPassword
)
}
}
}
}
}
}
}
}
}
return
processNextCommandLine
()
PluginManager
.
loadPlugins
()
}
}
mirai-console/src/main/kotlin/net/mamoe/mirai/plugin/PluginBase.kt
View file @
fc99e972
This diff is collapsed.
Click to expand it.
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