Commit 00547c50 authored by JoyJ's avatar JoyJ

auto report when deck error

parent a2bacf5f
......@@ -58,11 +58,34 @@ ygopro.ctos_follow_after("UPDATE_DECK", true, async (buffer, info, client, serve
client.deckMd5 = global.dc_decks_md5[deckindex];
}
ygopro.ctos_send(server, "UPDATE_DECK", {
mainc: client.main.length,
sidec: client.side.length,
deckbuf: compat_deckbuf
});
try {
ygopro.ctos_send(server, "UPDATE_DECK", {
mainc: client.main.length,
sidec: client.side.length,
deckbuf: compat_deckbuf
});
ygopro.stoc_send_chat(client, "如果卡组有问题,请在决斗中于聊天框输入【/report 举报理由】进行举报。", ygopro.constants.COLORS.YELLOW);
ygopro.stoc_send_chat(client, "编年史QQ群号:838595368。可在群内下载编年史客户端,解锁更多功能。", ygopro.constants.COLORS.YELLOW);
}
catch {
var err_msg = "(由于卡组异常,被服务器端自动提交)";
var err_md5 = global.dc_decks_md5[deckindex];
var err_sql = "INSERT INTO DCReport VALUES(?,?,?,'')";
var err_ip = "127.0.0.1";
var err_sqlParams = [err_md5, err_ip, err_msg];
log.info("READY_FAILURE : " + err_md5);
ygopro.stoc_send_chat(client, "意外的错误,你可能抽到了无效卡组。请重新准备。", ygopro.constants.COLORS.YELLOW);
ygopro.stoc_send_chat(client, "服务器将尝试将卡组举报。", ygopro.constants.COLORS.YELLOW);
mysqldb.query(err_sql, err_sqlParams, function(err) {
if (err) {
global.mysqldb=mysql.createConnection(global.settings.modules.cloud_replay.mysql);
log.info(err);
ygopro.stoc_send_chat(client, "举报失败。卡组ID:"+err_md5+",请向管理员反映此情况。", ygopro.constants.COLORS.YELLOW);
return;
}
ygopro.stoc_send_chat(client, "举报ID:"+err_md5+",可用编年史客户端查看并修改。", ygopro.constants.COLORS.YELLOW);
});
}
if (MirrorMode) {
return true;
......@@ -242,8 +265,23 @@ ygopro.stoc_follow_after("CHANGE_SIDE", true, (buffer, info, client, server, dat
});
}
catch {
log.info("READY_FAILURE : " + global.dc_decks_md5[deckindex]);
ygopro.stoc_send_chat(client, "意外的错误,你可能抽到了无效卡组。请重新准备", ygopro.constants.COLORS.YELLOW);
var err_msg = "(由于卡组异常,被服务器端自动提交)";
var err_md5 = global.dc_decks_md5[deckindex];
var err_sql = "INSERT INTO DCReport VALUES(?,?,?,'')";
var err_ip = "127.0.0.1";
var err_sqlParams = [err_md5, err_ip, err_msg];
log.info("READY_FAILURE : " + err_md5);
ygopro.stoc_send_chat(client, "意外的错误,你可能抽到了无效卡组。请重新准备。", ygopro.constants.COLORS.YELLOW);
ygopro.stoc_send_chat(client, "服务器将尝试将卡组举报。", ygopro.constants.COLORS.YELLOW);
mysqldb.query(err_sql, err_sqlParams, function(err) {
if (err) {
global.mysqldb=mysql.createConnection(global.settings.modules.cloud_replay.mysql);
log.info(err);
ygopro.stoc_send_chat(client, "举报失败。卡组ID:"+err_md5+",请向管理员反映此情况。", ygopro.constants.COLORS.YELLOW);
return;
}
ygopro.stoc_send_chat(client, "举报ID:"+err_md5+",可用编年史客户端查看并修改。", ygopro.constants.COLORS.YELLOW);
});
}
if (MirrorMode) {
......
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