From 3c502dcacff8385061e9c0678c746c6a27f6fad2 Mon Sep 17 00:00:00 2001 From: Angel_iii <36348070+smallXueTu@users.noreply.github.com> Date: Sat, 27 Jun 2020 20:22:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0docker=E5=AF=B9udp=E7=9A=84?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/Process/BaseMcserver.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/Process/BaseMcserver.js b/core/Process/BaseMcserver.js index 800191e..44c4ae4 100644 --- a/core/Process/BaseMcserver.js +++ b/core/Process/BaseMcserver.js @@ -101,9 +101,13 @@ class ServerProcess extends EventEmitter { else startCommande = this.templateStart(true); const startCommandeArray = startCommande.split(" "); - // 端口解析 - const protocol = "tcp"; let portmap = this.dataModel.dockerConfig.dockerPorts; + // 端口解析 + var agreement = portmap.split("/"); + var protocol = "tcp" + if(agreement.length>=2 && (agreement[1]==="udp" || agreement[1]==="tcp")){ + protocol = agreement[1]; + } portmap = portmap.split(":"); if (portmap.length > 2) { throw new Error("不支持的多端口操作方法,参数配置端口数量错误。");