Skip to content

Commit

Permalink
Beta54 (#126)
Browse files Browse the repository at this point in the history
* beta9

* beta11

* beta11

* beta13

* beta12

* beta13

* beta15

* beta16

* beta17

* beta18

* beta19

* beta20

* beta21

* add_playermanager_api

* beta22

* beta23

* beta24

* beta25

* beta26

* beta27

* beta28

* beta28

* beta29

* beta30

* beta31

* beta32

* beta33

* beta34

* beta35

* beta35

* beta36

* beta37

* beta38

* beta39

* beta40

* beta41

* beta41

* beat43

* beta45

* beta45

* beta46

* beta50

* beta51

* beta52

* beta53

* beta54
  • Loading branch information
Hoshinonyaruko authored Apr 5, 2024
1 parent 7aa5548 commit a0c4288
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/cross_compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,24 @@ jobs:
CGO_ENABLED: 0
run: |
if [ "$GOOS" = "windows" ]; then
go build -o output/palworld-go-${{ matrix.os }}-${{ matrix.goarch }}.exe
go build -ldflags="-s -w" -o output/palworld-go-${{ matrix.os }}-${{ matrix.goarch }}.exe
else
go build -o output/palworld-go-${{ matrix.os }}-${{ matrix.goarch }}
go build -ldflags="-s -w" -o output/palworld-go-${{ matrix.os }}-${{ matrix.goarch }}
fi
- name: Compress executable files with UPX (except for palworld-go-android-arm64)
run: |
sudo apt-get update
sudo apt-get install -y upx
if [[ "${{ matrix.os }}" == *"windows"* ]]; then
FILENAME="output/palworld-go-${{ matrix.os }}-${{ matrix.goarch }}.exe"
else
FILENAME="output/palworld-go-${{ matrix.os }}-${{ matrix.goarch }}"
fi
if [[ "${{ matrix.os }}" == "android" && "${{ matrix.goarch }}" == "arm64" ]]; then
echo "Skipping UPX compression for $FILENAME"
else
upx --best --lzma "$FILENAME"
fi
- name: Upload artifacts
Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ func main() {
if runtime.GOOS == "windows" {
//检查程序是否运行在合适目录
if _, err := os.Stat("PalServer.exe"); os.IsNotExist(err) {
// PalServer.exe不存在,查找PalServer-Win64-Test-Cmd.exe的路径
cmd := exec.Command("cmd", "/C", "wmic process where name='PalServer-Win64-Test-Cmd.exe' get ExecutablePath")
// PalServer.exe不存在,查找PalServer-Win64-Shipping-Cmd.exe的路径
cmd := exec.Command("cmd", "/C", "wmic process where name='PalServer-Win64-Shipping-Cmd.exe' get ExecutablePath")
output, err := cmd.Output()
if err != nil {
fmt.Println("Failed to execute command:", err)
Expand All @@ -66,7 +66,7 @@ func main() {

outputStr := string(output)
if !strings.Contains(outputStr, "ExecutablePath") {
fmt.Println("PalServer-Win64-Test-Cmd.exe not found")
fmt.Println("PalServer-Win64-Shipping-Cmd.exe not found")
fmt.Println("Notice:Please restart this program after launching the game server, and the installation will be completed automatically, releasing a launch icon to the desktop.")
fmt.Println("请打开游戏服务端后再次运行本程序,将会自动完成安装,释放启动图标到桌面。")
showMessage("提示", "请打开游戏服务端保持运行后的同时运行本程序,\n将会自动寻找游戏路径,\n自动完成安装,并释放启动图标到桌面。\n请到桌面使用StartPalWorld.bat启动我。\nNotice:Please restart this program after launching the game server, and the installation will be completed automatically, releasing a launch icon to the desktop.")
Expand Down
Binary file modified mod/embeds/palguard.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion sys/restart_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func KillProcess(config config.Config) error {

if runtime.GOOS == "windows" {
// Windows: 直接指定要结束的进程名称
cmd = exec.Command("taskkill", "/IM", "PalServer-Win64-Test-Cmd.exe", "/F")
cmd = exec.Command("taskkill", "/IM", "PalServer-Win64-Shipping-Cmd.exe", "/F")
} else {
// 非Windows: 使用pkill命令和进程名称
cmd = exec.Command("pkill", "-f", "PalServer-Linux-Test")
Expand Down
4 changes: 2 additions & 2 deletions sys/restart_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func RestartService(config config.Config) {
fmt.Sprintf("-players=%d", config.WorldSettings.ServerPlayerMaxNum),
}
} else {
exePath = filepath.Join(config.GamePath, "Pal", "Binaries", "Win64", "PalServer-Win64-Test-Cmd.exe")
exePath = filepath.Join(config.GamePath, "Pal", "Binaries", "Win64", "PalServer-Win64-Shipping-Cmd.exe")
args = []string{
"Pal",
"-RconEnabled=True",
Expand Down Expand Up @@ -310,7 +310,7 @@ func RestartService(config config.Config) {
}
`
// 使用config.GamePath和processName填充PowerShell脚本模板
psScriptFormatted := fmt.Sprintf(psScript, "PalServer-Win64-Test-Cmd.exe", config.GamePath)
psScriptFormatted := fmt.Sprintf(psScript, "PalServer-Win64-Shipping-Cmd.exe", config.GamePath)

// 调用PowerShell执行脚本
cmd := exec.Command("powershell", "-Command", psScriptFormatted)
Expand Down

0 comments on commit a0c4288

Please sign in to comment.