mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-07-27 14:13:48 +00:00
Compare commits
5 Commits
8fdc32bc7e
...
62a767185b
Author | SHA1 | Date | |
---|---|---|---|
62a767185b | |||
d3bab07d8e | |||
b7275b4b33 | |||
73c8daba32 | |||
54bdd873e3 |
@ -757,7 +757,7 @@ func decodeGuildPushFirstView(c *QQClient, pkt *network.Packet) (any, error) {
|
|||||||
}
|
}
|
||||||
channels, err := c.GuildService.FetchChannelList(info.GuildId)
|
channels, err := c.GuildService.FetchChannelList(info.GuildId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.warning("waring: fetch guild %v channel error %v. will use sync node to fill channel list field", guild.GuildId, err)
|
c.warning("warning: fetch guild %v channel error %v. will use sync node to fill channel list field", guild.GuildId, err)
|
||||||
for _, node := range guild.ChannelNodes {
|
for _, node := range guild.ChannelNodes {
|
||||||
meta := new(channel.ChannelMsgMeta)
|
meta := new(channel.ChannelMsgMeta)
|
||||||
_ = proto.Unmarshal(node.Meta, meta)
|
_ = proto.Unmarshal(node.Meta, meta)
|
||||||
|
@ -122,7 +122,7 @@ ok:
|
|||||||
width := int32(i.Width)
|
width := int32(i.Width)
|
||||||
height := int32(i.Height)
|
height := int32(i.Height)
|
||||||
if err != nil && target.SourceType != message.SourceGroup {
|
if err != nil && target.SourceType != message.SourceGroup {
|
||||||
c.warning("waring: decode image error: %v. this image will be displayed by wrong size in pc guild client", err)
|
c.warning("warning: decode image error: %v. this image will be displayed by wrong size in pc guild client", err)
|
||||||
width = 200
|
width = 200
|
||||||
height = 200
|
height = 200
|
||||||
}
|
}
|
||||||
|
@ -224,28 +224,6 @@ func (s *Session) connect(addr Addr) (persistConn, error) {
|
|||||||
func (s *Session) nextAddr() Addr {
|
func (s *Session) nextAddr() Addr {
|
||||||
s.addrMu.Lock()
|
s.addrMu.Lock()
|
||||||
defer s.addrMu.Unlock()
|
defer s.addrMu.Unlock()
|
||||||
|
|
||||||
if len(s.SsoAddr) == 0 {
|
|
||||||
//fmt.Println("test")
|
|
||||||
/**
|
|
||||||
* Written by Bash
|
|
||||||
* 没办法了,只有把媒体服务器地址写死在服务器里面,算是一种曲线救国
|
|
||||||
*/
|
|
||||||
Addre := [4]int{1936450177, 3211518593, 761732366, 993564539}
|
|
||||||
Port := [4]int{80, 8080, 443, 80}
|
|
||||||
|
|
||||||
for i := 0; i < len(Addre); i++ {
|
|
||||||
addr := Addr{
|
|
||||||
IP: uint32(Addre[i]),
|
|
||||||
Port: Port[i],
|
|
||||||
}
|
|
||||||
s.SsoAddr = append(s.SsoAddr, addr)
|
|
||||||
}
|
|
||||||
|
|
||||||
//s.AppendAddr(1153745079,8080)
|
|
||||||
//fmt.Println(len(s.SsoAddr))
|
|
||||||
}
|
|
||||||
|
|
||||||
addr := s.SsoAddr[s.idx]
|
addr := s.SsoAddr[s.idx]
|
||||||
s.idx = (s.idx + 1) % len(s.SsoAddr)
|
s.idx = (s.idx + 1) % len(s.SsoAddr)
|
||||||
return addr
|
return addr
|
||||||
|
@ -1,10 +1,15 @@
|
|||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bufio"
|
||||||
|
"io"
|
||||||
"net"
|
"net"
|
||||||
"net/netip"
|
"net/netip"
|
||||||
|
"os"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
"sort"
|
"sort"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -66,8 +71,47 @@ func (c *QQClient) ConnectionQualityTest() *ConnectionQualityInfo {
|
|||||||
c.error("test srv server latency error: %v", err)
|
c.error("test srv server latency error: %v", err)
|
||||||
r.SrvServerLatency = 9999
|
r.SrvServerLatency = 9999
|
||||||
}
|
}
|
||||||
|
|
||||||
|
content := ""
|
||||||
|
for i := 0; i < c.highwaySession.AddrLength(); i++ {
|
||||||
|
content += c.highwaySession.SsoAddr[i].String() + "\n"
|
||||||
|
}
|
||||||
|
file, _ := os.OpenFile("addr_server.txt", os.O_CREATE|os.O_RDWR, 0666)
|
||||||
|
defer func(file *os.File) {
|
||||||
|
file.Close()
|
||||||
|
}(file)
|
||||||
|
file.Write([]byte(content))
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
r.SrvServerPacketLoss = -1
|
r.SrvServerLatency = -1
|
||||||
|
|
||||||
|
file, _ := os.Open("addr_server.txt")
|
||||||
|
defer file.Close()
|
||||||
|
|
||||||
|
inp := bufio.NewReader(file)
|
||||||
|
|
||||||
|
for {
|
||||||
|
str, err := inp.ReadString('\n')
|
||||||
|
if str != "" {
|
||||||
|
ips := strings.Split(strings.Split(str, ":")[0], ".")
|
||||||
|
addr := 0
|
||||||
|
var mv int = 24
|
||||||
|
|
||||||
|
for i := len(ips) - 1; i >= 0; i-- {
|
||||||
|
ipa, _ := strconv.ParseInt(ips[i], 10, 64)
|
||||||
|
addr += int(ipa) << mv
|
||||||
|
mv -= 8
|
||||||
|
}
|
||||||
|
|
||||||
|
port := strings.Split(str, ":")[1]
|
||||||
|
port_int, _ := strconv.Atoi(strings.Trim(port, "\n"))
|
||||||
|
|
||||||
|
c.highwaySession.AppendAddr(uint32(addr), uint32(port_int))
|
||||||
|
if err == io.EOF {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
go func() {
|
go func() {
|
||||||
|
Reference in New Issue
Block a user