Commit 85f19dfe authored by JoyJ's avatar JoyJ

Merge branch 'master' of https://code.mycard.moe/JoyJ/dc-plugins

parents 65f90ae1 40041aeb
......@@ -26,7 +26,7 @@ ygopro.ctos_follow_after("UPDATE_DECK", true, async (buffer, info, client, serve
break;
}
}
if (AllowSelfDeck && client.name.substr(0,4)=="[MM]") {
if (AllowSelfDeck && client.name.substr(0,4)=="[MD]") {
return;
}
......@@ -56,6 +56,8 @@ ygopro.ctos_follow_after("UPDATE_DECK", true, async (buffer, info, client, serve
client.side = global.dc_decks_side[deckindex];
var compat_deckbuf = client.main.concat(client.side);
client.deckMd5 = global.dc_decks_md5[deckindex];
// ygopro.stoc_send_chat(client, "md5:"+global.dc_decks_md5[deckindex], ygopro.constants.COLORS.YELLOW);
}
try {
......@@ -68,7 +70,7 @@ ygopro.ctos_follow_after("UPDATE_DECK", true, async (buffer, info, client, serve
ygopro.stoc_send_chat(client, "注意:【卡组太弱】【有未知卡】并不是有效的举报理由,【额外不全】【构筑错误】才是。", ygopro.constants.COLORS.YELLOW);
ygopro.stoc_send_chat(client, "编年史QQ群号:838595368。可在群内下载编年史客户端,解锁更多功能。", ygopro.constants.COLORS.YELLOW);
ygopro.stoc_send_chat(client, "举报理由请尽量详细写明构筑的哪里有问题,不要只写个【构筑错误】。", ygopro.constants.COLORS.BABYBLUE);
ygopro.stoc_send_chat(client, "有未知卡是因为你没有下载编年史独有卡。请加群下载,举报没用。", ygopro.constants.COLORS.BABYBLUE);
ygopro.stoc_send_chat(client, "有未知白板卡是因为你没有下载编年史独有卡。请加群下载,举报没用。", ygopro.constants.COLORS.BABYBLUE);
}
catch {
var err_msg = "(由于卡组异常,被服务器端自动提交)";
......@@ -137,23 +139,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 +180,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 +189,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;
......@@ -191,16 +197,17 @@ ygopro.ctos_follow_before('CHAT', true, async function(buffer, info, client, ser
if (result.length > 0) {
ygopro.stoc_send_chat(client, "此卡组已被人工判定为无需修改,提交失败。", ygopro.constants.COLORS.RED);
ygopro.stoc_send_chat(client, "由于进行了恶意提交,你会被封禁24小时。", ygopro.constants.COLORS.RED);
ygopro.stoc_send_chat(client, "卡组ID为"+md5+",如认为此卡组确实应被举报,请加群838595368向管理员反应。", ygopro.constants.COLORS.RED);
ygopro.stoc_send_chat(client, "卡组ID:"+md5, ygopro.constants.COLORS.RED);
ygopro.stoc_send_chat(client, "如有疑问,请记录上述字符串,并向编年史群的管理者反馈:"+md5, ygopro.constants.COLORS.RED);
sql = "INSERT INTO `DCReportServer` VALUES(?,now())";
return;
}
msg = (new Date().toString()) + " - 由服务器端提交(提交者:" + client.name + "\r\n\r\n" + msg;
msg = (new Date().toString()) + " - 由服务器端提交(提交者:" + client.name + ",云录像:R#"+room.cloud_replay_id+"\r\n\r\n" + msg;
sql = "INSERT INTO DCReport VALUES(?,?,?,'')";
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