package main import ( "fmt" "os" "gac-hkrpg-go" "gac-hkrpg-go/internal/common" "gac-hkrpg-go/internal/gameserver" ) func main() { if err := runtimeassets.Bootstrap(); err != nil { fmt.Fprintln(os.Stderr, "shipping files:", err) os.Exit(1) } cfg, err := common.LoadRuntimeConfig() if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } if _, err := common.LoadTechniqueRules(); err != nil { fmt.Fprintln(os.Stderr, "technique resources:", err) os.Exit(1) } if _, err := common.LoadTeamPresetRules(); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } fmt.Println("============================================================") fmt.Printf(" [GaC hkrpg GO] Gameserver (Client %s)\n", cfg.ClientVersion) fmt.Printf(" Listening on UDP %s:%d (KCP Gateway)\n", cfg.GameHost, cfg.GamePort) fmt.Println(" Ready for StarRail client connection...") fmt.Println("============================================================") gw, err := gameserver.NewGateway(cfg.GameHost, cfg.GamePort) if err != nil { fmt.Fprintln(os.Stderr, "failed to bind gateway:", err) os.Exit(1) } if err := gw.Listen(); err != nil { fmt.Fprintln(os.Stderr, "gateway error:", err) os.Exit(1) } }