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
f695c9f7
Commit
f695c9f7
authored
Oct 28, 2019
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a logical mistake
parent
d4dd720e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/TIMBotNetworkHandler.kt
....mamoe.mirai/network/protocol/tim/TIMBotNetworkHandler.kt
+5
-8
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/TIMBotNetworkHandler.kt
View file @
f695c9f7
...
...
@@ -56,17 +56,14 @@ internal class TIMBotNetworkHandler internal constructor(private val bot: Bot) :
}
override
suspend
fun
login
(
configuration
:
BotNetworkConfiguration
):
LoginResult
=
withContext
(
this
.
coroutineContext
)
{
TIMProtocol
.
SERVER_IP
.
forEach
{
bot
.
logger
.
logInfo
(
"Connecting server $i
t
"
)
socket
=
BotSocketAdapter
(
i
t
,
configuration
)
TIMProtocol
.
SERVER_IP
.
forEach
{
ip
->
bot
.
logger
.
logInfo
(
"Connecting server $i
p
"
)
socket
=
BotSocketAdapter
(
i
p
,
configuration
)
loginResult
=
CompletableDeferred
()
val
state
=
socket
.
resendTouch
()
socket
.
resendTouch
().
takeIf
{
it
!=
LoginResult
.
TIMEOUT
}
?.
let
{
return
@
withContext
it
}
if
(
state
!=
LoginResult
.
TIMEOUT
)
{
return
@
withContext
state
}
bot
.
logger
.
logPurple
(
"Timeout. Retrying next server"
)
socket
.
close
()
...
...
@@ -206,7 +203,7 @@ internal class TIMBotNetworkHandler internal constructor(private val bot: Bot) :
// Remove first to release the lock
handlersLock
.
withLock
{
temporaryPacketHandlers
.
filter
{
it
.
filter
(
session
,
packet
)
}
temporaryPacketHandlers
.
filter
{
it
.
filter
(
session
,
packet
)
}
.
also
{
temporaryPacketHandlers
.
removeAll
(
it
)
}
}.
forEach
{
it
.
doReceiveWithoutExceptions
(
packet
)
}
...
...
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