Skip to content

Commit

Permalink
Bump version to v1.6.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nobody committed Mar 19, 2023
1 parent 04ebc93 commit 733289c
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
verStr: '1.6.x'
boxAppend: box
v2rayCorePkgName: 'v2ray-windows-64.zip'
scriptPkgName: 'scripts-v1.0.4'
scriptPkgName: 'scripts-v1.0.5'
v2rayCoreVer: 'v4.45.2'
# https://github.com/v2ray/v2ray-core/releases/download/v4.20.0/v2ray-windows-32.zip
# https://github.com/XTLS/Xray-core/releases/download/v1.4.0/Xray-windows-64.zip
Expand Down
3 changes: 2 additions & 1 deletion V2RayGCon/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.6.7.10")]
[assembly: AssemblyVersion("1.6.8.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

/*
* -------------------------------------------------------------
* v1.6.7.10 Show custom tags in ServerUI.
* v1.6.7.9 Add Server:Delete() in Luna plug-in.
* v1.6.7.8 Try to fix index not update bug.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ script.zip里面有四个长驻脚本分别是:

更新记录

v1.0.5
修改`查询服务器所在国家.lua`

v1.0.4
添加`故障转移.lua`
修改`托管(简单版).lua`的默认参数
Expand Down
69 changes: 32 additions & 37 deletions V2RayGCon/Resources/Files/Scripts/查询服务器所在国家.lua
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
--[[
查询服务器所在国家然后保存到tag1中
2021-09-22
2023-03-19
--]]

local geoAPI = "http://ip-api.com/json/"

local utils = require('lua.libs.utils')
local json = require('lua.libs.json')

local proxyPort = Web:GetProxyPort()
local servs = Server:GetAllServers()

function IsDupSummary(summary, index)
for i = 0, index - 1 do
local coreServ = servs[i]
local coreState = coreServ:GetCoreStates()
local s = coreState:GetSummary()
if s == summary then
return true
end
end
return false
end
local cache = {}

function GetHost(summary)
local t = {}
Expand All @@ -38,48 +27,54 @@ function GetGeoInfo(host)
local resp = Web:Fetch(url, proxyPort, 5000)
Misc:Sleep(300)
local o = json.decode(resp)
return o["country"]
return o["countryCode"]
end

function TryGetGeoInfo(host)
for i = 0, 10 do
local c = cache[host]
if c ~= nil then
print("using cache for ", host)
return c
end
for i = 0, 5 do
if Signal:Stop() then
return nil
end
local ok, country = pcall(GetGeoInfo, host)
if ok then
cache[host] = country
return country
end
Misc:Sleep(5000)
print("Error: ", country)
print("error: ", country)
end
return nil
end

function Proc(coreServ, index)
function Proc(coreServ)
local coreState = coreServ:GetCoreStates()
local tag1 = coreState:GetTag1()
if not string.isempty(tag1) then
return
end
local summary = coreState:GetSummary()
if not IsDupSummary(summary, index) then
local host = GetHost(summary)
if host ~= nil then
local title = coreState:GetTitle()
local country = TryGetGeoInfo(host)
if country ~= nil then
coreState:SetTag1(country)
print(title, " -> ", country)
else
print("Get GEO info failed: ", title)
end
local host = GetHost(summary)
if host ~= nil then
local title = coreState:GetTitle()
local country = TryGetGeoInfo(host)
if country ~= nil then
coreState:SetTag1(country)
print(title, " -> ", country)
else
print("fail to get GEO info: ", title)
end
end
end

function Main()
local max = servs.Count
for i = 0, max - 1 do
local coreServ = servs[i]
local coreState = coreServ:GetCoreStates()
local tag1 = coreState:GetTag1()
if string.isempty(tag1) then
Proc(coreServ, i)
end
local servs = Server:GetAllServers()
for coreServ in Each(servs) do
Proc(coreServ, i)
if Signal:Stop() then
return
end
Expand Down
6 changes: 5 additions & 1 deletion V2RayGCon/V2RayGCon.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,12 @@
<None Include="Resources\Files\lua\modules\reader.lua" />
<None Include="Resources\Files\lua\modules\set.lua" />
<None Include="Resources\Files\lua\modules\writer.lua" />
<None Include="Resources\Files\Scripts\SSH端口转发.lua" />
<None Include="Resources\Files\Scripts\启动时更新订阅.lua" />
<None Include="Resources\Files\Scripts\托管(简单版).lua" />
<None Include="Resources\Files\Scripts\故障转移.lua" />
<None Include="Resources\Files\Scripts\服务器小工具.lua" />
<None Include="Resources\Files\Scripts\查询服务器所在国家.lua" />
<None Include="Resources\Files\Scripts\每月清空流量统计数据.lua" />
<None Include="Resources\Files\Scripts\热键切换服务器.lua" />
<None Include="Resources\Files\Scripts\监听服务器事件.lua" />
Expand All @@ -550,7 +554,7 @@
<ItemGroup>
<Content Include="icon_dark.ico" />
<Content Include="Resources\Files\CSharp\ConfigJsonKeywords.txt" />
<Content Include="Resources\Files\Scripts\使用说明.txt" />
<Content Include="Resources\Files\Scripts\使用说明-v1.0.5.txt" />
<None Include="Resources\Icon\FormMainToolStrip\CloudSearch_16x.png" />
<None Include="Resources\Icon\FormMainToolStrip\AddField_16x.png" />
<None Include="Resources\Icon\TaskTray\SFTPConnection_16x.png" />
Expand Down

0 comments on commit 733289c

Please sign in to comment.