Commit dc6a46d7 authored by mercury233's avatar mercury233

fix

parent 764f7055
......@@ -260,6 +260,7 @@ ROOM_find_or_create_ai = (name)->
return { "error": "AI房间名过长,请在建立房间后输入 /ai 来添加AI" }
result = new Room(name)
result.windbot = windbot
result.private = true
return result
ROOM_find_by_name = (name)->
......@@ -524,7 +525,7 @@ class Room
url: "http://127.0.0.1:#{settings.modules.windbot_port}/?name=#{encodeURIComponent(botdata.name)}&deck=#{encodeURIComponent(botdata.deck)}&host=127.0.0.1&port=#{settings.port}&dialog=#{encodeURIComponent(botdata.dialog)}&version=#{settings.version}&password=#{encodeURIComponent(@name)}"
, (error, response, body)=>
if error
log.warn 'windbot add error', error, this.name, response
log.warn 'windbot add error', error, this.name
ygopro.stoc_send_chat_to_room(this, "添加AI失败,可尝试输入 /ai 重新添加", ygopro.constants.COLORS.RED)
#else
#log.info "windbot added"
......@@ -888,7 +889,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
else if !info.pass.length and !settings.modules.enable_random_duel and !settings.modules.enable_windbot
ygopro.stoc_die(client, "房间名不能为空,请在主机密码处填写房间名")
else if info.pass.length and settings.modules.mycard_auth and info.pass[0...2] != 'AI'
else if info.pass.length and settings.modules.mycard_auth and info.pass[0...3] != 'AI_' and info.pass[0...3] != 'AI#'
ygopro.stoc_send_chat(client, '正在读取用户信息...', ygopro.constants.COLORS.BABYBLUE)
if info.pass.length <= 8
ygopro.stoc_die(client, '主机密码不正确 (Invalid Length)')
......@@ -1370,7 +1371,7 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server)->
when '/help'
ygopro.stoc_send_chat(client, "YGOSrv233 指令帮助")
ygopro.stoc_send_chat(client, "/help 显示这个帮助信息")
ygopro.stoc_send_chat(client, "/roomname 显示当前房间的名字")
ygopro.stoc_send_chat(client, "/roomname 显示当前房间的名字") if !settings.modules.mycard_auth
ygopro.stoc_send_chat(client, "/ai 添加一个AI,/ai 角色名 可指定添加的角色") if settings.modules.enable_windbot
ygopro.stoc_send_chat(client, "/tip 显示一条提示") if settings.modules.tips
......
......@@ -359,6 +359,7 @@
}
result = new Room(name);
result.windbot = windbot;
result["private"] = true;
return result;
};
......@@ -701,7 +702,7 @@
}, (function(_this) {
return function(error, response, body) {
if (error) {
log.warn('windbot add error', error, _this.name, response);
log.warn('windbot add error', error, _this.name);
ygopro.stoc_send_chat_to_room(_this, "添加AI失败,可尝试输入 /ai 重新添加", ygopro.constants.COLORS.RED);
}
};
......@@ -1102,7 +1103,7 @@
client.destroy();
} else if (!info.pass.length && !settings.modules.enable_random_duel && !settings.modules.enable_windbot) {
ygopro.stoc_die(client, "房间名不能为空,请在主机密码处填写房间名");
} else if (info.pass.length && settings.modules.mycard_auth && info.pass.slice(0, 2) !== 'AI') {
} else if (info.pass.length && settings.modules.mycard_auth && info.pass.slice(0, 3) !== 'AI_' && info.pass.slice(0, 3) !== 'AI#') {
ygopro.stoc_send_chat(client, '正在读取用户信息...', ygopro.constants.COLORS.BABYBLUE);
if (info.pass.length <= 8) {
ygopro.stoc_die(client, '主机密码不正确 (Invalid Length)');
......@@ -1689,7 +1690,9 @@
case '/help':
ygopro.stoc_send_chat(client, "YGOSrv233 指令帮助");
ygopro.stoc_send_chat(client, "/help 显示这个帮助信息");
if (!settings.modules.mycard_auth) {
ygopro.stoc_send_chat(client, "/roomname 显示当前房间的名字");
}
if (settings.modules.enable_windbot) {
ygopro.stoc_send_chat(client, "/ai 添加一个AI,/ai 角色名 可指定添加的角色");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment