Commit 55f93dc3 authored by nanahira's avatar nanahira

Merge branch 'mc'

parents 7e12df95 4bc11ec0
Pipeline #5395 passed with stages
in 79 minutes and 3 seconds
......@@ -2201,18 +2201,6 @@ ygopro.ctos_follow 'PLAYER_INFO', true, (buffer, info, client, server, datas)->
return false
, name))
client.rag = true
if settings.modules.mycard.enabled and settings.modules.mycard.ban_get and !client.is_local
try
banMCRequest = await axios.get settings.modules.mycard.ban_get,
paramsSerializer: qs.stringify
params:
user: name
if typeof(banMCRequest.data) == "object"
client.ban_mc = banMCRequest.data
else
log.warn "ban get bad json", banMCRequest.data
catch e
log.warn 'ban get error', e.toString()
struct = ygopro.structs.get("CTOS_PlayerInfo")
struct._setBuff(buffer)
struct.set("name", name)
......@@ -2322,6 +2310,19 @@ ygopro.ctos_follow 'JOIN_GAME', true, (buffer, info, client, server, datas)->
if buffer.length != 6
ygopro.stoc_die(client, '${invalid_password_payload}')
return
if settings.modules.mycard.enabled and settings.modules.mycard.ban_get and !client.is_local
try
banMCRequest = await axios.get settings.modules.mycard.ban_get,
paramsSerializer: qs.stringify
params:
user: name
if typeof(banMCRequest.data) == "object"
client.ban_mc = banMCRequest.data
else
log.warn "ban get bad json", banMCRequest.data
catch e
log.warn 'ban get error', e.toString()
check_buffer_indentity = (buf)->
checksum = 0
......
......@@ -2918,7 +2918,7 @@
// 功能模块
// return true to cancel a synchronous message
ygopro.ctos_follow('PLAYER_INFO', true, async function(buffer, info, client, server, datas) {
var banMCRequest, e, geo, lang, name, name_full, struct, vpass;
var geo, lang, name, name_full, struct, vpass;
// checkmate use username$password, but here don't
// so remove the password
name_full = info.name.replace(/\\/g, "").split("$");
......@@ -2939,24 +2939,6 @@
}, name)) {
client.rag = true;
}
if (settings.modules.mycard.enabled && settings.modules.mycard.ban_get && !client.is_local) {
try {
banMCRequest = (await axios.get(settings.modules.mycard.ban_get, {
paramsSerializer: qs.stringify,
params: {
user: name
}
}));
if (typeof banMCRequest.data === "object") {
client.ban_mc = banMCRequest.data;
} else {
log.warn("ban get bad json", banMCRequest.data);
}
} catch (error1) {
e = error1;
log.warn('ban get error', e.toString());
}
}
struct = ygopro.structs.get("CTOS_PlayerInfo");
struct._setBuff(buffer);
struct.set("name", name);
......@@ -2985,7 +2967,7 @@
});
ygopro.ctos_follow('JOIN_GAME', true, async function(buffer, info, client, server, datas) {
var available_logs, check_buffer_indentity, create_room_with_action, duelLog, exactBan, index, j, l, len, len1, pre_room, recover_match, replay, replay_id, replays, room, struct;
var available_logs, banMCRequest, check_buffer_indentity, create_room_with_action, duelLog, e, exactBan, index, j, l, len, len1, pre_room, recover_match, replay, replay_id, replays, room, struct;
//log.info info
info.pass = info.pass.trim();
client.pass = info.pass;
......@@ -3065,6 +3047,24 @@
ygopro.stoc_die(client, '${invalid_password_payload}');
return;
}
if (settings.modules.mycard.enabled && settings.modules.mycard.ban_get && !client.is_local) {
try {
banMCRequest = (await axios.get(settings.modules.mycard.ban_get, {
paramsSerializer: qs.stringify,
params: {
user: name
}
}));
if (typeof banMCRequest.data === "object") {
client.ban_mc = banMCRequest.data;
} else {
log.warn("ban get bad json", banMCRequest.data);
}
} catch (error1) {
e = error1;
log.warn('ban get error', e.toString());
}
}
check_buffer_indentity = function(buf) {
var checksum, i, m, ref;
checksum = 0;
......
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