Commit d9f425f4 authored by JoyJ's avatar JoyJ

add more info

parent 4310c71a
......@@ -137,23 +137,27 @@ ygopro.ctos_follow_after("UPDATE_DECK", true, async (buffer, info, client, serve
ygopro.ctos_follow_before('CHAT', true, async function(buffer, info, client, server, datas) {
room = ROOM_all[client.rid];
if (!room) {
ygopro.stoc_send_chat(client, "失败:请在决斗中使用指令。", ygopro.constants.COLORS.YELLOW);
return;
}
if (!client.deckMd5) {
ygopro.stoc_send_chat(client, "失败:卡组检索异常", ygopro.constants.COLORS.YELLOW);
return;
}
var md5 = client.deckMd5;
if (room.duel_stage != ygopro.constants.DUEL_STAGE.DUELING) {
ygopro.stoc_send_chat(client, "失败:未在有效的决斗期间", ygopro.constants.COLORS.YELLOW);
return;
}
var msg = _.trim(info.msg);
if (msg.substring(0, 7) != "/report") {
ygopro.stoc_send_chat(client, "失败:未知命令"+info.msg, ygopro.constants.COLORS.YELLOW);
return;
}
msg = msg.substring(7);
msg = _.trim(msg);
if (msg.length < 2) {
ygopro.stoc_send_chat(client, "请以【/report 举报原因】的格式写明举报原因", ygopro.constants.COLORS.YELLOW);
ygopro.stoc_send_chat(client, "请以 /report 举报原因 的格式写明举报原因", ygopro.constants.COLORS.YELLOW);
return;
}
//"CREATE TABLE DCReportServer(reporterIp varchar(255),reportDate DateTime)";
......@@ -174,7 +178,7 @@ ygopro.ctos_follow_before('CHAT', true, async function(buffer, info, client, ser
sqlParams = [client.ip];
mysqldb.query(sql, sqlParams, function(err, result) {
if (err) {
global.mysqldb=mysql.createConnection(global.settings.modules.cloud_replay.mysql);
global.mysqldb=mysql.createConnection(global.settings.modules.cloud_replay.mysql);
log.info(err);
ygopro.stoc_send_chat(client, "出现异常,请重试", ygopro.constants.COLORS.RED);
return;
......@@ -183,7 +187,7 @@ ygopro.ctos_follow_before('CHAT', true, async function(buffer, info, client, ser
sqlParams = [md5];
mysqldb.query(sql, sqlParams, function(err, result) {
if (err) {
global.mysqldb=mysql.createConnection(global.settings.modules.cloud_replay.mysql);
global.mysqldb=mysql.createConnection(global.settings.modules.cloud_replay.mysql);
log.info(err);
ygopro.stoc_send_chat(client, "例外库无法检索卡组,提交失败", ygopro.constants.COLORS.RED);
return;
......@@ -198,7 +202,7 @@ ygopro.ctos_follow_before('CHAT', true, async function(buffer, info, client, ser
sqlParams = [md5, client.ip, msg];
mysqldb.query(sql, sqlParams, function(err, result) {
if (err) {
global.mysqldb=mysql.createConnection(global.settings.modules.cloud_replay.mysql);
global.mysqldb=mysql.createConnection(global.settings.modules.cloud_replay.mysql);
log.info(err);
ygopro.stoc_send_chat(client, "提交失败", ygopro.constants.COLORS.RED);
return;
......
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