fix(all): show client startup progress and stabilize SDK cache

This commit is contained in:
2026-10-03 23:35:18 +08:00
parent 992fa47fd5
commit c4f77881ed
7 changed files with 21 additions and 143 deletions
+10 -2
View File
@@ -3,6 +3,7 @@
package main
import (
"bytes"
"encoding/json"
"errors"
"fmt"
@@ -177,6 +178,7 @@ func buildDevelopmentPlugins(root, gameDir string) error {
filepath.Join(root, "plugins", "LoginUI", "LoginUI.csproj"),
}
for _, project := range projects {
fmt.Fprintf(os.Stderr, "bd2client: preparing development plugin %s; first-time game source generation may take several minutes\n", filepath.Base(project))
command := exec.Command(
"dotnet", "build", project, "-c", "Release",
"-p:GameDir="+filepath.Clean(gameDir),
@@ -185,9 +187,15 @@ func buildDevelopmentPlugins(root, gameDir string) error {
"--nologo",
)
command.Dir = root
output, err := command.CombinedOutput()
// SDK preparation can decompile the entire game before the window opens.
// Stream progress immediately, while retaining diagnostics for failures.
var output bytes.Buffer
writer := io.MultiWriter(os.Stderr, &output)
command.Stdout = writer
command.Stderr = writer
err := command.Run()
if err != nil {
message := strings.TrimSpace(string(output))
message := strings.TrimSpace(output.String())
if message == "" {
message = err.Error()
}
+3
View File
@@ -0,0 +1,3 @@
# Dot-source in an external PowerShell terminal: . .\env.ps1
# Applies only to this terminal and child processes; no user-level Go settings.
$env:GOCACHE = Join-Path $PSScriptRoot '.cache\go-build'