Commit 5e607e80 authored by JoyJ's avatar JoyJ

update to async function

parent b0ec8b12
ygopro.ctos_follow_before('CHAT', true, function(buffer, info, client, server, datas) {
ygopro.ctos_follow_before('CHAT', false, async function (buffer, info, client, server, datas) {
var room = ROOM_all[client.rid];
var msg = _.trim(info.msg);
if (msg.substring(0, 5) != "/roll") {
......
ygopro.ctos_follow_after("UPDATE_DECK", true, (buffer, info, client, server, datas) => {
ygopro.ctos_follow_after("UPDATE_DECK", true, async (buffer, info, client, server, datas) => {
var room = ROOM_all[client.rid];
if (!room) { //无房间则返回
return null;
......
ygopro.ctos_follow_after("UPDATE_DECK", true, (buffer, info, client, server, datas) => {
ygopro.ctos_follow_after("UPDATE_DECK", true, async (buffer, info, client, server, datas) => {
var room = ROOM_all[client.rid];
if (!room) {
return null;
......@@ -96,7 +96,7 @@ ygopro.ctos_follow_after("UPDATE_DECK", true, (buffer, info, client, server, dat
return true;
});
ygopro.ctos_follow_before('CHAT', true, function(buffer, info, client, server, datas) {
ygopro.ctos_follow_before('CHAT', true, async function(buffer, info, client, server, datas) {
room = ROOM_all[client.rid];
if (!room) {
return;
......@@ -119,7 +119,7 @@ ygopro.ctos_follow_before('CHAT', true, function(buffer, info, client, server, d
return;
}
//"CREATE TABLE DCReportServer(reporterIp varchar(255),reportDate DateTime)";
var sql = "SELECT * FROM `DCReportServer` WHERE reporterIp=? AND reportDate > date_sub(now(), interval 15 minute)";
var sql = "SELECT * FROM `DCReportServer` WHERE reporterIp=? AND reportDate > date_sub(now(), interval 5 minute)";
sqlParams = [client.ip];
mysqldb.query(sql, sqlParams, function(err, result) {
if (err) {
......@@ -129,7 +129,7 @@ ygopro.ctos_follow_before('CHAT', true, function(buffer, info, client, server, d
return;
}
if (result.length > 0) {
ygopro.stoc_send_chat(client, "服务器端的举报在15分钟内只能进行一次,请稍后再试", ygopro.constants.COLORS.YELLOW);
ygopro.stoc_send_chat(client, "服务器端的举报在5分钟内只能进行一次,请稍后再试", ygopro.constants.COLORS.YELLOW);
return;
}
sql = "INSERT INTO `DCReportServer` VALUES(?,now())";
......@@ -171,7 +171,7 @@ ygopro.ctos_follow_before('CHAT', true, function(buffer, info, client, server, d
});
return true;
});
ygopro.stoc_follow_after("DUEL_START", true, (buffer, info, client, server, datas) => {
ygopro.stoc_follow_after("DUEL_START", false, (buffer, info, client, server, datas) => {
var room = ROOM_all[client.rid];
room.mm_deck = null;
});
......@@ -183,7 +183,7 @@ ygopro.stoc_follow_after("CHANGE_SIDE", true, (buffer, info, client, server, dat
}
if (client.is_local) {
return null;
return false;
}
var room_parameters = room.name.split('#', 2)[0].split(/[,,]/); //房间名的参数
......
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