Skip to content

Commit 7323731

Browse files
committed
Merge branch 'feat/v0.6.0'
2 parents abbd676 + 2b1935c commit 7323731

File tree

13 files changed

+2721
-498
lines changed

13 files changed

+2721
-498
lines changed

Makefile

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
11
default: all
22

3-
ALL=go-mud-linux-amd64 go-mud-linux-arm64 go-mud-macOS-amd64 go-mud-windows-amd64.exe
4-
all: $(ALL)
3+
ALL=go-mud-macOS-amd64 \
4+
go-mud-linux-amd64 \
5+
go-mud-linux-arm8 \
6+
go-mud-linux-arm7 \
7+
go-mud-windows-x86.exe \
8+
go-mud-windows-amd64.exe
9+
10+
all: $(patsubst %,dist/%,$(ALL))
11+
12+
GOOPTS=-trimpath
513

614
SRCS=main.go
715

8-
go-mud-linux-amd64: $(SRC)
9-
GOOS=linux GOARCH=amd64 go build -o $@ main.go
16+
dist/go-mud-linux-amd64: $(SRC)
17+
GOOS=linux GOARCH=amd64 go build $(GOOPTS) -o $@ main.go
18+
19+
dist/go-mud-linux-arm7: $(SRC)
20+
GOOS=linux GOARM=7 GOARCH=arm go build $(GOOPTS) -o $@ main.go
1021

11-
go-mud-linux-arm64: $(SRC)
12-
GOOS=linux GOARCH=arm64 go build -o $@ main.go
22+
dist/go-mud-linux-arm8: $(SRC)
23+
GOOS=linux GOARCH=arm64 go build $(GOOPTS) -o $@ main.go
1324

14-
go-mud-macOS-amd64: $(SRC)
15-
GOOS=darwin GOARCH=amd64 go build -o $@ main.go
25+
dist/go-mud-macOS-amd64: $(SRC)
26+
GOOS=darwin GOARCH=amd64 go build $(GOOPTS) -o $@ main.go
1627

17-
go-mud-windows-amd64.exe: $(SRC)
18-
GOOS=windows GOARCH=amd64 go build -o $@ main.go
28+
dist/go-mud-windows-amd64.exe: $(SRC)
29+
GOOS=windows GOARCH=amd64 go build $(GOOPTS) -o $@ main.go
1930

20-
zip: all
21-
zip go-mud.zip go-mud-{linux,macOS,windows}-* *.lua
31+
dist/go-mud-windows-x86.exe: $(SRC)
32+
GOOS=windows GOARCH=386 go build $(GOOPTS) -o $@ main.go
2233

2334
clean:
24-
rm -f $(ALL)
35+
rm -rf dist/

README.md

Lines changed: 98 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,47 +20,135 @@ MUD 一般认为是最早的网络游戏,历史悠久,内涵丰富。在古
2020

2121
基于 MUD 特有的文化,挂机在北侠也是被允许的,而在 MUD 下开发挂机程序也是一种别有风味的玩法。
2222

23-
## 本程序有什么用
23+
## GoMud 有什么用
2424

25-
本程序是一个 MUD 客户端,可以用来连接 MUD 服务器,提供纯文本的用户界面,以供玩家与 MUD 服务器交互。
25+
GoMud 是一个 MUD 客户端,可以用来连接 MUD 服务器,提供纯文本的用户界面,以供玩家与 MUD 服务器交互。
2626

27-
**本程序目前仍在开发当中,并不完善。** 但已经能够提供必要的功能来连接 MUD 服务器。且有许多亮点:
27+
**GoMud 目前仍在开发当中,并不完善。** 但已经能够提供必要的功能来连接 MUD 服务器。且有许多亮点:
2828

2929
* [X] 原生支持 UTF-8
3030
* [X] 纯文本界面,通过命令行和快捷键来操作
3131
* [X] 支持 macOS、Linux、Windows、安卓四大平台
3232
* [X] 支持 32 位和 64 位操作系统
3333
* [X] 支持 [Lua 机器人](https://github.com/dzpao/lua-mud-robots)
3434

35-
## 本程序不能做什么
35+
## GoMud 不能做什么
3636

3737
* 不支持图形界面,没有丰富的代码编辑框或诸如此类的其它 UI 元素来帮助你写触发和机器人
3838
* 没有庞大的用户群,没有大量开箱即用的机器人,对伸手党不友好
3939
* 不能帮助没有丰富的计算机操作经验,特别是 *nix 命令行操作经验的人熟悉 *nix
4040
* 不能帮助没有编程经验或者没有学习过 Go 语言的人学会编程、学会 Go 语言
4141

42-
## 如何使用本程序
42+
## 如何使用 GoMud
4343

4444
### 运行环境
4545

46-
本程序可在 Linux 及 macOS 上运行。运行时不依赖其它软件。
46+
* GoMud 可在 Linux 及 macOS 上运行。运行时不依赖其它软件。
47+
* GoMud 也可以在 Windows 下运行,但需要依赖 [Windows 下的运行环境](https://github.com/dzpao/go-mud/releases/tag/fake-tag-for-windows-runtime)
48+
* 通过 [Termux](https://termux.com/) 的帮助,GoMud 也可以在安卓下运行。
49+
50+
### 通过源码安装
51+
52+
GoMud 采用 Go 语言实现,如果你要通过源码安装,则需要自行准备 Golang 开发环境。
53+
Golang 安装完毕后,通过如下 `go get` 命令即可安装:
54+
55+
```
56+
go get -u github.com/dzpao/go-mud
57+
```
58+
59+
### 下载预编译的可执行文件
60+
61+
本项目的 [Release](https://github.com/dzpao/go-mud/releases) 中包含了所有支持平台的预编译可执行文件。
62+
各平台的可执行文件名称略有不同,统一格式为 `go-mud-<系统名称>-<硬件架构>`
63+
你可以下载和你的运行环境相对应的版本,直接开始使用。
4764

4865
### 启动并进入北侠
4966

67+
下述示例中的程序文件名假定为 `go-mud`,如果你采用的是预编译的可执行文件,
68+
你可能需要下载后改名或者将下述命令中的程序文件名替换为真实的程序文件名称。
69+
5070
```
51-
待完善
71+
$ go-mud
72+
初始化 Lua 环境...
73+
Lua 环境初始化完成。
74+
连接到服务器 mud.pkuxkx.net:8080...连接成功。
75+
...
76+
```
77+
78+
### 配置 GoMud
79+
80+
GoMud 支持通过配置文件或者命令行选项的方式来指定程序运行参数,
81+
目前已有的命令行选项如下:
82+
83+
```
84+
$ go-mud --help # 可以获得使用帮助
85+
go-mud(version 0.6)
86+
87+
Usage:
88+
go-mud [flags]
89+
90+
Flags:
91+
-c, --config FILENAME config FILENAME, default to `config.yaml` or `config.json`
92+
--version just print version number only
93+
--help show this message
94+
--gen-yaml generate config.yaml
95+
--gen-json generate config.json
96+
--ui.ambiguouswidth string 二义性字符宽度 (default "auto")
97+
-H, --mud.host IP/Domain 服务器 IP/Domain (default "mud.pkuxkx.net")
98+
-P, --mud.port Port 服务器 Port (default 8080)
99+
--lua.enable 是否加载 Lua 机器人 (default true)
100+
-p, --lua.path path Lua 插件路径 path (default "lua")
101+
```
102+
103+
配置文件同时支持 [YAML](https://yaml.org/)[JSON](https://json.org/) 两种格式,
104+
两种配置文件效果是一样的,用户可根据个人偏好选择使用,下面分别给出示例。
105+
配置项的说明参见 [Wiki](https://github.com/dzpao/go-mud/wiki/configuration)
106+
107+
#### config.yaml 示例
108+
109+
默认的 YAML 配置文件名为 `config.yaml`,如果省略配置文件,等同默认内容如下:
110+
111+
```yaml
112+
UI:
113+
AmbiguousWidth: auto
114+
MUD:
115+
Host: mud.pkuxkx.net
116+
Port: 8080
117+
Lua:
118+
Enable: true
119+
Path: lua
120+
```
121+
122+
#### config.json 示例
123+
124+
默认的 JSON 配置文件名为 `config.json`,如果省略配置文件,等同默认内容如下:
125+
126+
```json
127+
{
128+
"UI": {
129+
"AmbiguousWidth": "auto"
130+
},
131+
"Mud": {
132+
"Host": "mud.pkuxkx.net",
133+
"Port": 8080
134+
},
135+
"Lua": {
136+
"Enable": true,
137+
"Path": "lua"
138+
}
139+
}
52140
```
53141

54142
### 通过 Docker 来启动
55143

56-
本项目支持通过 Docker 来运行,推荐使用 Docker 来挂机。
144+
GoMud 也可支持通过 Docker 来运行,推荐使用 Docker 来挂机。
57145

58146
```
59147
待完善
60148
```
61149
62150
## 如何贡献
63151
64-
* 体验
152+
* 体验并向周围的人分享你的体验结果
65153
* 通过[提交 issue](https://github.com/dzpao/go-mud/issues/new) 来反馈意见
66-
* 通过 PR 来贡献代码
154+
* 通过 PR 来贡献代码,贡献代码时请先阅读[贡献指南](CONTRIBUTING.md)

config-example.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"UI": {
3+
"AmbiguousWidth": "auto"
4+
},
5+
"Mud": {
6+
"Host": "mud.pkuxkx.net",
7+
"Port": 8080
8+
},
9+
"Lua": {
10+
"Enable": true,
11+
"Path": "lua"
12+
}
13+
}

config-example.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
UI:
2+
AmbiguousWidth: auto
3+
MUD:
4+
Host: mud.pkuxkx.net
5+
Port: 8080
6+
Lua:
7+
Enable: true
8+
Path: lua

lua

Submodule lua updated from af4ede0 to 04aed5a

0 commit comments

Comments
 (0)