Files
cultivation-world-simulator/static/config.yml
Zihao Xu bd6f7e67d5 feat(server): make server host and port configurable (#127)
* feat(server): make server host and port configurable

Support configuring server binding address via environment variables
and config files. Priority: ENV > local_config.yml > config.yml > default.

- Add host and port options to system section in config.yml
- Read SERVER_HOST and SERVER_PORT from environment variables
- Default to 127.0.0.1:8002 for security

Set host to "0.0.0.0" to allow LAN access.

* test(server): add comprehensive tests for server binding config

Add 28 test cases covering:
- Environment variable priority (SERVER_HOST, SERVER_PORT)
- Config file reading (system.host, system.port)
- Default value fallback
- OmegaConf integration
- Edge cases (IPv6, empty values, invalid ports)

* docs: add mobile/LAN access instructions

- Add mobile access section to README and EN_README
- Configure Vite to listen on 0.0.0.0 for LAN access in dev mode
- Link to Issue #130 for mobile UI compatibility tracking
2026-02-04 21:47:17 +08:00

68 lines
1.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
meta:
version: "1.4.1"
llm:
default_modes:
action_decision: "normal"
long_term_objective: "normal"
nickname: "normal"
single_choice: "normal"
relation_resolver: "fast"
story_teller: "fast"
interaction_feedback: "fast"
history_influence: "normal"
paths:
locales: static/locales/
shared_game_configs: static/game_configs/
# templates: static/templates/ <-- Managed by code now
# game_configs: static/game_configs/ <-- Managed by code now
saves: assets/saves/
ai:
max_concurrent_requests: 10
max_parse_retries: 3
game:
init_npc_num: 9
sect_num: 3 # init_npc_num大于sect_num时会随机选择sect_num个宗门
start_year: 100 # 世界开始年份
npc_awakening_rate_per_month: 0.01
fortune_probability: 0.005
misfortune_probability: 0.005
gathering:
auction_trigger_count: 5
df:
ids_separator: ";"
avatar:
persona_num: 3
# all 引入所有主角不引入随机角色
# random正常随机角色但是有一定概率出主角
# none, 不引入主角(默认选项)
protagonist: "random"
social:
major_event_context_num: 10 # 大事(长期记忆)展示数量
minor_event_context_num: 10 # 小事(短期记忆)展示数量
relation_check_threshold: 5 # 关系检查需要的交互次数
nickname:
major_event_threshold: 3 # 获得绰号需要的长期事件数量
minor_event_threshold: 25 # 获得绰号需要的短期事件数量
save:
max_events_to_save: 1000
frontend:
water_speed: low
cloud_freq: low
system:
language: zh-CN
host: "127.0.0.1" # 服务器绑定地址,设为 "0.0.0.0" 允许局域网访问。
port: 8002 # 服务器端口。
play:
base_benefit_probability: 0.05