Skip to content

Commit

Permalink
支持固定端口
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Jun 20, 2024
1 parent adc8f3b commit a44ee9b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,14 @@
"type": "boolean",
"default": true
},
"Y3-Helper.ServerPort": {
"title": "客户端连接端口",
"description": "使用0表示随机端口",
"type": "number",
"default": 0,
"minimum": 0,
"maximum": 65535
},
"Y3-Helper.editorTablceDataExcelFolder": {
"title": "存放物编数据的Excel表格所在的文件夹的相对路径",
"description": "注意:Execl表中的物编数据会按此相对路径下的importRules.mjs代码所实现的导入规则来导入,生成Excel物编数据模板时也会生成到此文件夹下",
Expand Down
5 changes: 4 additions & 1 deletion src/console/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ function registerAllMethods() {
export function init() {
registerAllMethods();

let port = randomInt(10000, 65535);
let port: number | undefined = vscode.workspace.getConfiguration('Y3-Helper').get('ServerPort');
if (port === 0 || typeof port !== 'number') {
port = randomInt(10000, 65535);
}

server = new ConsoleServer(port);

Expand Down

0 comments on commit a44ee9b

Please sign in to comment.