Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b7ebfb4e6 | |||
| 70b719489b | |||
| 5f1708129a |
Binary file not shown.
@@ -19,24 +19,25 @@ export function useGlobalEvents() {
|
|||||||
const onProxyExit = () => setProxyRunning(false);
|
const onProxyExit = () => setProxyRunning(false);
|
||||||
|
|
||||||
const onDownload = (event: any) => {
|
const onDownload = (event: any) => {
|
||||||
const { percent, speed } = event.data[0];
|
const { percent, speed } = event.data;
|
||||||
setProgressDownload(Number(percent));
|
setProgressDownload(Number(percent));
|
||||||
setDownloadSpeed(speed);
|
setDownloadSpeed(speed);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onUpdateProgress = (event: any) => {
|
const onUpdateProgress = (event: any) => {
|
||||||
const { progress, maxProgress } = event.data[0];
|
console.log(event)
|
||||||
|
const { progress, maxProgress } = event.data;
|
||||||
setProgressUpdate(Number(progress));
|
setProgressUpdate(Number(progress));
|
||||||
setMaxProgressUpdate(Number(maxProgress));
|
setMaxProgressUpdate(Number(maxProgress));
|
||||||
};
|
};
|
||||||
|
|
||||||
const onMessageUpdate = (event: any) => {
|
const onMessageUpdate = (event: any) => {
|
||||||
const { message } = event.data[0];
|
const { message } = event.data;
|
||||||
setMessageUpdate(message);
|
setMessageUpdate(message);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onStageUpdate = (event: any) => {
|
const onStageUpdate = (event: any) => {
|
||||||
const { stage } = event.data[0];
|
const { stage } = event.data;
|
||||||
setStageType(stage);
|
setStageType(stage);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -49,7 +50,7 @@ export function useGlobalEvents() {
|
|||||||
Events.On("diff:message", onMessageUpdate);
|
Events.On("diff:message", onMessageUpdate);
|
||||||
Events.On("diff:stage", onStageUpdate);
|
Events.On("diff:stage", onStageUpdate);
|
||||||
Events.On("diff:error", (event: any) => {
|
Events.On("diff:error", (event: any) => {
|
||||||
const { message } = event.data[0];
|
const { message } = event.data;
|
||||||
toast.error(message);
|
toast.error(message);
|
||||||
});
|
});
|
||||||
Events.On("window:close", async () => {
|
Events.On("window:close", async () => {
|
||||||
|
|||||||
@@ -75,13 +75,7 @@ export default function LauncherPage() {
|
|||||||
btnClass: "btn-secondary"
|
btnClass: "btn-secondary"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tooltip: "Amazing's SRTools (Original UI)",
|
tooltip: "Amazing's SRTools",
|
||||||
href: "https://srtools.pages.dev/",
|
|
||||||
img: "https://icons.duckduckgo.com/ip3/srtools.pages.dev.ico",
|
|
||||||
btnClass: "btn-primary"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
tooltip: "Amazing's SRTools (Modern UI)",
|
|
||||||
href: "https://srtools.neonteam.dev/",
|
href: "https://srtools.neonteam.dev/",
|
||||||
img: "https://icons.duckduckgo.com/ip3/srtools.neonteam.dev.ico",
|
img: "https://icons.duckduckgo.com/ip3/srtools.neonteam.dev.ico",
|
||||||
btnClass: "btn-secondary"
|
btnClass: "btn-secondary"
|
||||||
@@ -196,6 +190,7 @@ export default function LauncherPage() {
|
|||||||
setProxyRunning(true)
|
setProxyRunning(true)
|
||||||
}
|
}
|
||||||
await sleep(500)
|
await sleep(500)
|
||||||
|
|
||||||
if (!serverRunning) {
|
if (!serverRunning) {
|
||||||
const [resultServer, error] = await FSService.StartWithConsole(serverPath)
|
const [resultServer, error] = await FSService.StartWithConsole(serverPath)
|
||||||
if (!resultServer) {
|
if (!resultServer) {
|
||||||
@@ -205,12 +200,7 @@ export default function LauncherPage() {
|
|||||||
setServerRunning(true)
|
setServerRunning(true)
|
||||||
}
|
}
|
||||||
await sleep(1000)
|
await sleep(1000)
|
||||||
const gameFolder = await FSService.GetDir(gamePath)
|
|
||||||
const fileNeedRemove = await FSService.Join(gameFolder, "StarRail_Data", "Plugins", "x86_64", "AccountPlatNative.dll")
|
|
||||||
const fileExists = await FSService.FileExists(fileNeedRemove)
|
|
||||||
if (fileExists) {
|
|
||||||
await FSService.RemoveFile(fileNeedRemove)
|
|
||||||
}
|
|
||||||
if (gamePath.endsWith("launcher.exe")) {
|
if (gamePath.endsWith("launcher.exe")) {
|
||||||
const [resultGame, error] = await FSService.StartWithConsole(gamePath)
|
const [resultGame, error] = await FSService.StartWithConsole(gamePath)
|
||||||
if (!resultGame) {
|
if (!resultGame) {
|
||||||
@@ -415,7 +405,7 @@ export default function LauncherPage() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="w-full bg-white/20 rounded-full h-2 overflow-hidden">
|
<div className="w-full bg-white/20 rounded-full h-2 overflow-hidden">
|
||||||
<motion.div
|
<motion.div
|
||||||
className="h-full bg-gradient-to-r from-cyan-400 to-blue-500 rounded-full"
|
className="h-full bg-linear-to-r from-cyan-400 to-blue-500 rounded-full"
|
||||||
initial={{ width: 0 }}
|
initial={{ width: 0 }}
|
||||||
animate={{ width: `${progressDownload}%` }}
|
animate={{ width: `${progressDownload}%` }}
|
||||||
transition={{ type: "tween", ease: "linear", duration: 0.03 }}
|
transition={{ type: "tween", ease: "linear", duration: 0.03 }}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
@import "tailwindcss";
|
@import "tailwindcss";
|
||||||
@plugin "daisyui"{
|
@plugin "daisyui"{
|
||||||
|
exclude: properties;
|
||||||
themes: dracula --default;
|
themes: dracula --default;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,9 +68,11 @@ func (h *DiffService) VersionValidate(gamePath, patchPath string) (bool, string)
|
|||||||
if err := sevenzip.ExtractAFileFromZip(patchPath, "StarRail_Data\\StreamingAssets\\BinaryVersion.bytes.hdiff", constant.TempUrl); err != nil {
|
if err := sevenzip.ExtractAFileFromZip(patchPath, "StarRail_Data\\StreamingAssets\\BinaryVersion.bytes.hdiff", constant.TempUrl); err != nil {
|
||||||
return false, err.Error()
|
return false, err.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
patchBinFile := filepath.Join(constant.TempUrl, "BinaryVersion.bytes.hdiff")
|
patchBinFile := filepath.Join(constant.TempUrl, "BinaryVersion.bytes.hdiff")
|
||||||
sourceBinFile := oldBinPath
|
sourceBinFile := oldBinPath
|
||||||
tempBinFile = filepath.Join(constant.TempUrl, "BinaryVersion.bytes")
|
tempBinFile = filepath.Join(constant.TempUrl, "BinaryVersion.bytes")
|
||||||
|
|
||||||
if err := hpatchz.ApplyPatch(sourceBinFile, patchBinFile, tempBinFile); err != nil {
|
if err := hpatchz.ApplyPatch(sourceBinFile, patchBinFile, tempBinFile); err != nil {
|
||||||
os.Remove(patchBinFile)
|
os.Remove(patchBinFile)
|
||||||
return false, err.Error()
|
return false, err.Error()
|
||||||
@@ -172,9 +174,11 @@ func (h *DiffService) HDiffPatchData(gamePath string) (bool, string) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err.Error()
|
return false, err.Error()
|
||||||
}
|
}
|
||||||
if err := json.Unmarshal(data, &jsonData); err != nil {
|
var hdiffJson []*models.HDiffData
|
||||||
|
if err := json.Unmarshal(data, &hdiffJson); err != nil {
|
||||||
return false, err.Error()
|
return false, err.Error()
|
||||||
}
|
}
|
||||||
|
jsonData.DiffMap = append(jsonData.DiffMap, hdiffJson...)
|
||||||
} else if _, err := os.Stat(hdiffFilesPath); err == nil {
|
} else if _, err := os.Stat(hdiffFilesPath); err == nil {
|
||||||
files, err := models.LoadHDiffFiles(hdiffFilesPath)
|
files, err := models.LoadHDiffFiles(hdiffFilesPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -188,6 +192,7 @@ func (h *DiffService) HDiffPatchData(gamePath string) (bool, string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
application.Get().Event.Emit("diff:stage", map[string]string{"stage": "Patching HDiff"})
|
application.Get().Event.Emit("diff:stage", map[string]string{"stage": "Patching HDiff"})
|
||||||
|
|
||||||
for i, entry := range jsonData.DiffMap {
|
for i, entry := range jsonData.DiffMap {
|
||||||
application.Get().Event.Emit(
|
application.Get().Event.Emit(
|
||||||
"diff:progress", map[string]int{
|
"diff:progress", map[string]int{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ 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.4"
|
const CurrentLauncherVersion = "2.4.0"
|
||||||
|
|
||||||
type ToolFile string
|
type ToolFile string
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user