Skip to content

Commit

Permalink
add android auto reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
ffdfgdfg committed Apr 7, 2021
1 parent d251431 commit cb8464f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions gui/npc/npc.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,14 @@ func onclick(s, v, c string) {
if sp != s || vk != v || ct != c {
saveConfig(s, v, c)
}
cl = client.NewRPClient(s, v, c, "", nil, 60)
go cl.Start()
go func() {
for {
cl = client.NewRPClient(s, v, c, "", nil, 60)
cl.Start()
logs.Info("client disconnected, reconnecting in 5 seconds...")
time.Sleep(time.Second * 5)
}
}()
} else {
// close the npc
status = "Start!"
Expand Down

0 comments on commit cb8464f

Please sign in to comment.