feat: 添加IP竞速拨号器与IP偏好设置,连接状态显示域名与实际IP
- 新增竞速拨号器(racedial.go):域名连接时并行解析所有A/AAAA记录, 同时对所有IP发起TCP连接,第一个成功的胜出,确保选择延迟最低的地址 - ServerProfile新增IPPreference字段(auto/v4/v6),支持用户指定IP版本偏好 - 填写服务器IP时跳过域名解析直接使用IP,顺序failover - 连接成功后状态栏显示「已连接 (域名 -> 实际IP)」 - DB迁移v6:server_profiles表添加ip_preference列 - WebSocket拨号与HTTP登录均使用竞速拨号器 - 补充中英文i18n翻译
This commit is contained in:
@@ -46,12 +46,12 @@ func main() {
|
||||
for x := sx - sw/2; x < sx+sw/2; x++ {
|
||||
// Shield shape: rounded top, pointed bottom.
|
||||
progress := float64(y-sy) / float64(sh)
|
||||
halfW := float64(sw)/2 * (1.0 - 0.3*progress*progress)
|
||||
halfW := float64(sw) / 2 * (1.0 - 0.3*progress*progress)
|
||||
if math.Abs(float64(x-sx)) < halfW && progress < 0.7 {
|
||||
img.SetRGBA(x, y, shieldColor)
|
||||
} else if progress >= 0.7 {
|
||||
tp := (progress - 0.7) / 0.3
|
||||
halfW2 := float64(sw)/2 * (1.0 - 0.3*0.49) * (1.0 - tp)
|
||||
halfW2 := float64(sw) / 2 * (1.0 - 0.3*0.49) * (1.0 - tp)
|
||||
if math.Abs(float64(x-sx)) < halfW2 {
|
||||
img.SetRGBA(x, y, shieldColor)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user