Skip to content

Commit ecac864

Browse files
committed
core: fix printColor option
1 parent 41c88bb commit ecac864

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Server 端分为 `Server Mode` 和 `Fetch Mode` ,在 `Fetch Mode` 下支持获
2424

2525
#### 安装
2626

27-
[Releases](https://github.com/hydro-dev/xcpc-tools/releases/) 下载已经封装好的 WindowsLinux、MacOS 二进制使用,如有未封装好的架构但 Node.js 支持的系统或系统内已有 Node.js 亦可下载 `xcpc-tools-bundle.js`使用。
27+
[Releases](https://github.com/hydro-dev/xcpc-tools/releases/) 下载已经封装好的 Windows, Linux, macOS 二进制使用,如有未封装好的架构但 Node.js 支持的系统或系统内已有 Node.js 亦可下载 `xcpc-tools-bundle.js`使用。
2828

2929
下载后首次运行可见填写配置文件字样,打开 `config.yaml` ,如使用 `Fetch Mode` 请填写相关赛事系统配置,如使用 `Server Mode` 则无须填写配置可直接启动。
3030

@@ -54,6 +54,7 @@ const serverSchema = Schema.intersect([
5454
token: Schema.string(), // 赛事系统 Token 如无可使用用户名密码登录
5555
username: Schema.string(), // 赛事系统用户名
5656
password: Schema.string(), // 赛事系统密码
57+
freezeEncourage: Schema.number().default(0), // 封榜后鼓励气球数(0 为不发放),需赛事系统配置封榜后仍生成气球
5758
}).description('Fetcher Config'), // token 与 username/password 二选一
5859
Schema.object({
5960
type: Schema.const('server').required(),
@@ -105,7 +106,9 @@ const serverSchema = Schema.intersect([
105106

106107
### Client
107108

108-
Client 端分为打印代码和打印小票两个功能,支持 Windows、Linux、MacOS 三大平台,支持打印机自动检测,在 Windows 下需要安装 `SumatraPDF` 用于打印 PDF 文件,如您的系统没有安装 `SumatraPDF` ,请根据提示下载便携版并放置于同一目录中。
109+
Client 端分为打印代码和打印小票两个功能,支持 Windows, Linux, macOS 三大平台,支持打印机自动检测,支持自动分散打印机任务,为了方便使用, Server 与 Client 一同打包为单文件,启动时仅需添加 `--client` 参数即可启动 Client 。
110+
111+
由于 Windows 限制,在 Windows 下打印代码需要安装 `SumatraPDF` 用于打印 PDF 文件,如您的系统没有安装 `SumatraPDF` ,请根据提示下载便携版并放置于同一目录中;打印气球需将气球打印机设置为共享打印机,后续会自动检测。
109112

110113
Client 端的配置文件为 `config.yaml` ,配置文件介绍如下:
111114

@@ -115,6 +118,7 @@ const clientSchema = Schema.object({
115118
balloon: Schema.string(), // 气球小票机路径或名称,请自行根据启动后的提示填写
116119
balloonLang: Schema.union(['zh', 'en']).default('zh').required(), // 气球小票语言
117120
balloonType: Schema.union([58, 80]).default(80), // 气球小票机纸张宽度
121+
printColor: Schema.boolean().default(false), // 是否打印彩色代码
118122
printers: Schema.array(Schema.string()).default([]).description('printer id list, will disable printing if unset'), // 打印机列表,如果为空则不启用打印功能
119123
token: Schema.string().required().description('Token generated on server'), // 服务端 Token
120124
fonts: Schema.array(Schema.string()).default([]), // 额外字体路径

packages/server/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ password:
4242
balloon: '',
4343
balloonLang: 'zh',
4444
balloonType: 80,
45+
printColor: false,
4546
printers,
4647
});
4748
fs.writeFileSync(configPath, isClient ? clientConfigDefault : serverConfigDefault);
@@ -86,6 +87,7 @@ const clientSchema = Schema.object({
8687
balloon: Schema.string(),
8788
balloonLang: Schema.union(['zh', 'en']).default('zh').required(),
8889
balloonType: Schema.union([58, 80]).default(80),
90+
printColor: Schema.boolean().default(false),
8991
printers: Schema.array(Schema.string()).default([]).description('printer id list, will disable printing if unset'),
9092
token: Schema.string().required().description('Token generated on server'),
9193
fonts: Schema.array(Schema.string()).default([]),

0 commit comments

Comments
 (0)