UPDATE: Change proxy

This commit is contained in:
2025-12-12 18:49:30 +07:00
parent e08b265ae8
commit acdd761652
9 changed files with 17 additions and 23 deletions

View File

@@ -43,13 +43,6 @@ export function GetLatestServerVersion() {
return $Call.ByID(2918980975); return $Call.ByID(2918980975);
} }
/**
* @returns {$CancellablePromise<void>}
*/
export function UnzipProxy() {
return $Call.ByID(2563246729);
}
/** /**
* @returns {$CancellablePromise<void>} * @returns {$CancellablePromise<void>}
*/ */

View File

@@ -0,0 +1,9 @@
//@ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import { Create as $Create } from "@wailsio/runtime";
Object.freeze($Create.Events);

View File

@@ -0,0 +1,2 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT

View File

@@ -23,11 +23,9 @@ export async function UpdateProxy(proxyVersion: string) : Promise<void> {
setDownloadType("Downloading proxy...") setDownloadType("Downloading proxy...")
const [ok, error] = await GitService.DownloadProxyProgress(proxyVersion) const [ok, error] = await GitService.DownloadProxyProgress(proxyVersion)
if (ok) { if (ok) {
setDownloadType("Unzipping proxy...")
GitService.UnzipProxy()
setDownloadType("Download proxy successfully") setDownloadType("Download proxy successfully")
setProxyVersion(proxyVersion) setProxyVersion(proxyVersion)
setProxyPath("./proxy/FireflyProxy.exe") setProxyPath("./proxy/firefly-go-proxy.exe")
} else { } else {
toast.error(error) toast.error(error)
setDownloadType("Download proxy failed") setDownloadType("Download proxy failed")

View File

@@ -178,8 +178,6 @@ export default function LauncherPage() {
} }
} }
const handleStartGame = async () => { const handleStartGame = async () => {
if (!gamePath) { if (!gamePath) {
return return

2
go.mod
View File

@@ -1,6 +1,6 @@
module firefly-launcher module firefly-launcher
go 1.25 go 1.25.5
require ( require (
github.com/klauspost/compress v1.18.0 github.com/klauspost/compress v1.18.0

View File

@@ -37,7 +37,7 @@ func (g *GitService) GetLatestProxyVersion() (bool, string, string) {
} }
func (g *GitService) DownloadProxyProgress(version string) (bool, string) { func (g *GitService) DownloadProxyProgress(version string) (bool, string) {
asset, ok := g.getReleaseAsset(version, constant.ProxyGitUrl, constant.ProxyZipFile) asset, ok := g.getReleaseAsset(version, constant.ProxyGitUrl, constant.ProxyFile)
if !ok { if !ok {
return false, "no release found" return false, "no release found"
} }
@@ -65,7 +65,3 @@ func (g *GitService) DownloadProxyProgress(version string) (bool, string) {
return false, "failed to rename tmp file after retries" return false, "failed to rename tmp file after retries"
} }
func (g *GitService) UnzipProxy() {
g.unzipParallel(filepath.Join(constant.ProxyStorageUrl, constant.ProxyZipFile), constant.ProxyStorageUrl)
os.Remove(filepath.Join(constant.ProxyStorageUrl, constant.ProxyZipFile))
}

View File

@@ -117,8 +117,6 @@ func main() {
systemTray.SetMenu(menu) systemTray.SetMenu(menu)
window.RegisterHook(events.Common.WindowClosing, func(e *application.WindowEvent) { window.RegisterHook(events.Common.WindowClosing, func(e *application.WindowEvent) {
app.Event.Emit("window:close") app.Event.Emit("window:close")
e.Cancel() e.Cancel()

View File

@@ -1,16 +1,16 @@
package constant package constant
const ProxyGitUrl = "https://git.kain.io.vn/api/v1/repos/Firefly-Shelter/Firefly_Proxy/releases" const ProxyGitUrl = "https://git.kain.io.vn/api/v1/repos/Firefly-Shelter/FireflyGo_Proxy/releases"
const ServerGitUrl = "https://git.kain.io.vn/api/v1/repos/Firefly-Shelter/FireflyGo_Local_Archive/releases" const ServerGitUrl = "https://git.kain.io.vn/api/v1/repos/Firefly-Shelter/FireflyGo_Local_Archive/releases"
const LauncherGitUrl = "https://git.kain.io.vn/api/v1/repos/Firefly-Shelter/Firefly_Launcher/releases" const LauncherGitUrl = "https://git.kain.io.vn/api/v1/repos/Firefly-Shelter/Firefly_Launcher/releases"
const ServerStorageUrl = "./server" const ServerStorageUrl = "./server"
const ProxyStorageUrl = "./proxy" const ProxyStorageUrl = "./proxy"
const ServerZipFile = "prebuild_win_x86.zip" const ServerZipFile = "prebuild_win_x86.zip"
const ProxyZipFile = "64bit.zip" const ProxyFile = "firefly-go-proxy.exe"
const LauncherFile = "firefly-launcher.exe" const LauncherFile = "firefly-launcher.exe"
const TempUrl = "./temp" const TempUrl = "./temp"
const CurrentLauncherVersion = "2.3.1" const CurrentLauncherVersion = "2.3.2"
type ToolFile string type ToolFile string