mirror of
https://github.com/LHY0125/Gobang-Game.git
synced 2026-06-28 16:35:55 +08:00
feat: GameConfig 新增 hostPort 字段
- Rust GameConfig 添加 host_port: u16(#[serde(default)],默认 0) - TypeScript GameConfig 添加 hostPort?: number(可选,匹配其他带默认值字段的模式)
This commit is contained in:
@@ -122,6 +122,8 @@ pub struct GameConfig {
|
|||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub remote_address: String,
|
pub remote_address: String,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
|
pub host_port: u16,
|
||||||
|
#[serde(default)]
|
||||||
pub use_llm: bool,
|
pub use_llm: bool,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub llm_endpoint: String,
|
pub llm_endpoint: String,
|
||||||
@@ -142,6 +144,7 @@ impl Default for GameConfig {
|
|||||||
player_color: Color::Black,
|
player_color: Color::Black,
|
||||||
is_server: false,
|
is_server: false,
|
||||||
remote_address: String::new(),
|
remote_address: String::new(),
|
||||||
|
host_port: 0,
|
||||||
use_llm: false,
|
use_llm: false,
|
||||||
llm_endpoint: String::new(),
|
llm_endpoint: String::new(),
|
||||||
llm_api_key: String::new(),
|
llm_api_key: String::new(),
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export interface GameConfig {
|
|||||||
playerColor: Color;
|
playerColor: Color;
|
||||||
isServer: boolean;
|
isServer: boolean;
|
||||||
remoteAddress: string;
|
remoteAddress: string;
|
||||||
|
hostPort?: number;
|
||||||
useLlm?: boolean;
|
useLlm?: boolean;
|
||||||
llmEndpoint?: string;
|
llmEndpoint?: string;
|
||||||
llmApiKey?: string;
|
llmApiKey?: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user