From 6da7b7a43bc667d62082a28e6a5a61544d0b6a85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=88=AA=E5=AE=87?= <3364451258@qq.com> Date: Sun, 31 May 2026 14:58:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20GameConfig=20=E6=96=B0=E5=A2=9E=20hostP?= =?UTF-8?q?ort=20=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rust GameConfig 添加 host_port: u16(#[serde(default)],默认 0) - TypeScript GameConfig 添加 hostPort?: number(可选,匹配其他带默认值字段的模式) --- core/src/types.rs | 3 +++ src/core/types.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/core/src/types.rs b/core/src/types.rs index b9dca3e..0589565 100644 --- a/core/src/types.rs +++ b/core/src/types.rs @@ -122,6 +122,8 @@ pub struct GameConfig { #[serde(default)] pub remote_address: String, #[serde(default)] + pub host_port: u16, + #[serde(default)] pub use_llm: bool, #[serde(default)] pub llm_endpoint: String, @@ -142,6 +144,7 @@ impl Default for GameConfig { player_color: Color::Black, is_server: false, remote_address: String::new(), + host_port: 0, use_llm: false, llm_endpoint: String::new(), llm_api_key: String::new(), diff --git a/src/core/types.ts b/src/core/types.ts index a8b4d8c..d0bfb3b 100644 --- a/src/core/types.ts +++ b/src/core/types.ts @@ -20,6 +20,7 @@ export interface GameConfig { playerColor: Color; isServer: boolean; remoteAddress: string; + hostPort?: number; useLlm?: boolean; llmEndpoint?: string; llmApiKey?: string;