Skip to content

Commit 4f091c4

Browse files
committed
docs: supplement README
1. Adjust description for configuring Steam API key 2. Add outcome for not configuring and placing STEAM_KEY file correctly 3. Add note for validating screeps server is serving
1 parent 7dba285 commit 4f091c4

File tree

1 file changed

+54
-34
lines changed

1 file changed

+54
-34
lines changed

README.md

Lines changed: 54 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -90,33 +90,6 @@ sdw --help
9090

9191

9292

93-
### 配置 Steam API key
94-
95-
screeps 需要使用你的 Steam API key,screeps-launcher 提供两种方法进行配置。
96-
97-
1. `config.yaml` 文件中配置
98-
99-
```yaml
100-
# config.yaml
101-
steamKey: # 你的 Steam API key
102-
steamKeyFile: "STEAM_KEY" # 存放 Steam API key 的文件路径
103-
```
104-
105-
2. 使用独立文件存放,并在 `config.yaml` 中指定文件
106-
107-
```yaml
108-
# config.yaml
109-
steamKeyFile: "STEAM_KEY" # 缺省值。指定存放 Steam API key 的文件路径。
110-
```
111-
112-
然后创建 `STEAM_KEY` 文件
113-
114-
```sh
115-
echo "替换为你的 Steam API key" > STEAM_KEY
116-
```
117-
118-
119-
12093
### 初级预设
12194

12295
初始化生成 `config.yaml`,用于 screeps-launcher 启动。
@@ -177,14 +150,15 @@ sdw logs
177150
验证 screeps 服务器可正常响应。在宿主机上运行命令行:
178151

179152
```sh
180-
curl http://localhost:21025
153+
curl http://localhost:21025/web/
154+
```
181155

182-
# 可能会提示重定向到如下地址
156+
如果返回一份 HTML 文件,包含配置的 Welcome Text,说明 screeps 服务器可正常提供服务。
183157

184-
curl http://localhost:21025/web
185-
```
158+
:bulb: 注意,使用不同方式启动服务器时,该验证方法的网址不同
186159

187-
如果返回一份 HTML 文件,包含配置的 Welcom Text,说明 screeps 服务器可正常提供服务。
160+
* 直接使用官方 `screeps` 包,访问 `http://localhost:21025`
161+
* 使用`screeps-launcher` 启动,访问 `http://localhost:21025/web/`。注意,`web/` 的斜杠一定要带上。
188162

189163

190164

@@ -198,11 +172,17 @@ sdw cli
198172
docker exec -ti screeps-server screeps-launcher cli
199173
```
200174

201-
:warning: 必须加上 `-ti` 选项,否则会显示报错信息 `panic: no such device or address`
175+
:warning: 注意:必须加上 `-ti` 选项,否则会显示报错信息 `panic: no such device or address`
176+
202177

203178

179+
然后在 CLI 中运行如下命令:
204180

205-
然后在 CLI 中运行 `system.resetAllData()`,并使用 `Ctrl-d` 退出 CLI。最后重启容器:
181+
```sh
182+
system.resetAllData()
183+
```
184+
185+
并使用 `Ctrl-d` 退出 CLI。为了保险,最好重启容器:
206186

207187
```sh
208188
sdw restart
@@ -216,6 +196,46 @@ sdw restart
216196
sdw stop
217197
```
218198

199+
:warning:注意:如果执行该命令后,所有容器将会被移除。若重新执行 `sdw start` 启动服务,则容器会重新进行初始化
200+
201+
202+
203+
### 配置 Steam API key
204+
205+
screeps 需要使用你的 Steam API key,screeps-launcher 提供两种方法进行配置。
206+
207+
1. `config.yaml` 文件中配置
208+
209+
```yaml
210+
# config.yaml
211+
steamKey: # 你的 Steam API key
212+
```
213+
214+
2. 使用独立文件存放,并在 `config.yaml` 中指定文件
215+
216+
```yaml
217+
# config.yaml
218+
steamKeyFile: "STEAM_KEY" # 缺省值。指定存放 Steam API key 的文件路径。
219+
```
220+
221+
然后创建 `STEAM_KEY` 文件
222+
223+
```sh
224+
echo "替换为你的 Steam API key" > STEAM_KEY
225+
```
226+
227+
此时你的目录结构应如下:
228+
229+
```sh
230+
.
231+
├── config.yml
232+
├── docker-compose.yml (高级预设)
233+
└── STEAM_KEY
234+
```
235+
236+
237+
:warning: 如果配置了 STEAM_KEY 文件,但是没有放置,则 screeps-launcher 容器会不断重启。
238+
219239

220240

221241
## 配置

0 commit comments

Comments
 (0)