Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
go-cqhttp
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
nanahira
go-cqhttp
Commits
d6762148
Commit
d6762148
authored
Sep 19, 2020
by
Mrs4s
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update MiraiGo. fix #278
parent
c4e54446
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
12 deletions
+10
-12
go.mod
go.mod
+1
-1
go.sum
go.sum
+2
-6
main.go
main.go
+7
-5
No files found.
go.mod
View file @
d6762148
...
@@ -3,7 +3,7 @@ module github.com/Mrs4s/go-cqhttp
...
@@ -3,7 +3,7 @@ module github.com/Mrs4s/go-cqhttp
go 1.14
go 1.14
require (
require (
github.com/Mrs4s/MiraiGo v0.0.0-2020091
5071055-1607cdf2bff8
github.com/Mrs4s/MiraiGo v0.0.0-2020091
9083021-4013c077186d
github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 // indirect
github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 // indirect
github.com/gin-gonic/gin v1.6.3
github.com/gin-gonic/gin v1.6.3
github.com/go-playground/validator/v10 v10.3.0 // indirect
github.com/go-playground/validator/v10 v10.3.0 // indirect
...
...
go.sum
View file @
d6762148
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Mrs4s/MiraiGo v0.0.0-20200913112343-ad5531c3db09 h1:zTe9IBmO+z6icSwjT2PgI9aMIIwlfWc00cFEz2+j9rc=
github.com/Mrs4s/MiraiGo v0.0.0-20200919083021-4013c077186d h1:LZ1pjJJ7sD/AOL8tvkTB9bPc0DiOErCNN+wWXUMyvX0=
github.com/Mrs4s/MiraiGo v0.0.0-20200913112343-ad5531c3db09/go.mod h1:cwYPI2uq6nxNbx0nA6YuAKF1V5szSs6FPlGVLQvRUlo=
github.com/Mrs4s/MiraiGo v0.0.0-20200919083021-4013c077186d/go.mod h1:cwYPI2uq6nxNbx0nA6YuAKF1V5szSs6FPlGVLQvRUlo=
github.com/Mrs4s/MiraiGo v0.0.0-20200913133024-ad43b3f471e2 h1:otRnJmFOuRfK2ts5x6eOqc/vTIhUN4IYKcldjhN/IQY=
github.com/Mrs4s/MiraiGo v0.0.0-20200913133024-ad43b3f471e2/go.mod h1:cwYPI2uq6nxNbx0nA6YuAKF1V5szSs6FPlGVLQvRUlo=
github.com/Mrs4s/MiraiGo v0.0.0-20200915071055-1607cdf2bff8 h1:plwKkvIVzntjTS5tz96Hf+46Hxaf0Bv/Pp9nIADD/i4=
github.com/Mrs4s/MiraiGo v0.0.0-20200915071055-1607cdf2bff8/go.mod h1:cwYPI2uq6nxNbx0nA6YuAKF1V5szSs6FPlGVLQvRUlo=
github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0=
github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0=
github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE=
github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
...
...
main.go
View file @
d6762148
...
@@ -237,7 +237,7 @@ func main() {
...
@@ -237,7 +237,7 @@ func main() {
}
}
})
})
cli
.
OnServerUpdated
(
func
(
bot
*
client
.
QQClient
,
e
*
client
.
ServerUpdatedEvent
)
{
cli
.
OnServerUpdated
(
func
(
bot
*
client
.
QQClient
,
e
*
client
.
ServerUpdatedEvent
)
{
log
.
Infof
(
"收到服务器地址更新通知, 将在下一次重连时应用.
服务器地址: %v:%v 服务器位置: %v"
,
e
.
Servers
[
0
]
.
Server
,
e
.
Servers
[
0
]
.
Port
,
e
.
Servers
[
0
]
.
Location
)
log
.
Infof
(
"收到服务器地址更新通知, 将在下一次重连时应用.
地址信息已储存到 servers.bin 文件"
)
_
=
ioutil
.
WriteFile
(
"servers.bin"
,
binary
.
NewWriterF
(
func
(
w
*
binary
.
Writer
)
{
_
=
ioutil
.
WriteFile
(
"servers.bin"
,
binary
.
NewWriterF
(
func
(
w
*
binary
.
Writer
)
{
w
.
WriteUInt16
(
uint16
(
len
(
e
.
Servers
)))
w
.
WriteUInt16
(
uint16
(
len
(
e
.
Servers
)))
for
_
,
s
:=
range
e
.
Servers
{
for
_
,
s
:=
range
e
.
Servers
{
...
@@ -251,10 +251,12 @@ func main() {
...
@@ -251,10 +251,12 @@ func main() {
if
global
.
PathExists
(
"servers.bin"
)
{
if
global
.
PathExists
(
"servers.bin"
)
{
if
data
,
err
:=
ioutil
.
ReadFile
(
"servers.bin"
);
err
==
nil
{
if
data
,
err
:=
ioutil
.
ReadFile
(
"servers.bin"
);
err
==
nil
{
r
:=
binary
.
NewReader
(
data
)
r
:=
binary
.
NewReader
(
data
)
r
.
ReadUInt16
()
var
addr
[]
*
net
.
TCPAddr
cli
.
CustomServer
=
&
net
.
TCPAddr
{
for
i
:=
0
;
i
<
int
(
r
.
ReadUInt16
());
i
++
{
IP
:
net
.
ParseIP
(
r
.
ReadString
()),
addr
=
append
(
addr
,
&
net
.
TCPAddr
{
Port
:
int
(
r
.
ReadUInt16
()),
IP
:
net
.
ParseIP
(
r
.
ReadString
()),
Port
:
int
(
r
.
ReadUInt16
()),
})
}
}
}
}
}
}
...
...
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