[FEAT] Add geodata loader mode switch

This commit is contained in:
Clash-Mini
2022-02-05 00:51:06 +08:00
parent 2bf34c766e
commit c28f42d823
5 changed files with 31 additions and 17 deletions

View File

@ -2,6 +2,7 @@ package executor
import (
"fmt"
"net"
"os"
"runtime"
@ -15,6 +16,7 @@ import (
"github.com/Dreamacro/clash/adapter/outboundgroup"
"github.com/Dreamacro/clash/component/auth"
"github.com/Dreamacro/clash/component/dialer"
G "github.com/Dreamacro/clash/component/geodata"
"github.com/Dreamacro/clash/component/iface"
"github.com/Dreamacro/clash/component/profile"
"github.com/Dreamacro/clash/component/profile/cachefile"
@ -106,9 +108,10 @@ func GetGeneral() *config.General {
AllowLan: P.AllowLan(),
BindAddress: P.BindAddress(),
},
Mode: tunnel.Mode(),
LogLevel: log.Level(),
IPv6: !resolver.DisableIPv6,
Mode: tunnel.Mode(),
LogLevel: log.Level(),
IPv6: !resolver.DisableIPv6,
GeodataLoader: G.LoaderName(),
}
return general
@ -239,6 +242,9 @@ func updateGeneral(general *config.General, Tun *config.Tun, force bool) {
return
}
geodataLoader := general.GeodataLoader
G.SetLoader(geodataLoader)
allowLan := general.AllowLan
P.SetAllowLan(allowLan)