Commit 37994644 authored by mercury233's avatar mercury233

fix tip for rank 0

parent 5385b1a0
......@@ -1328,7 +1328,8 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server)->
log.warn 'LOAD SCORE ERROR', client.name, error, response.statusCode, response.statusMessage, body
else
log.info 'LOAD SCORE', client.name, body
ygopro.stoc_send_chat_to_room(room, "#{client.name} #{body.exp}点经验 #{Math.round(body.pt)}点战斗力 排名第#{body.arena_rank} (正式上线前这些积分可能被重置)", ygopro.constants.COLORS.BABYBLUE)
rank_txt = if body.arena_rank>0 then "排名第" + body.arena_rank else "暂无排名"
ygopro.stoc_send_chat_to_room(room, "#{client.name} #{body.exp}点经验 #{Math.round(body.pt)}点战斗力 #{rank_txt} (正式上线前这些积分可能被重置)", ygopro.constants.COLORS.BABYBLUE)
client.score_shown = true
return
if (settings.modules.enable_deck_log or settings.modules.post_deck) and client.main and client.main.length and not client.deck_saved and client.ip != '::ffff:127.0.0.1'
......
......@@ -1626,11 +1626,13 @@
url: settings.modules.arena_mode.get_score + encodeURIComponent(client.name),
json: true
}, function(error, response, body) {
var rank_txt;
if (error || !body || _.isString(body)) {
log.warn('LOAD SCORE ERROR', client.name, error, response.statusCode, response.statusMessage, body);
} else {
log.info('LOAD SCORE', client.name, body);
ygopro.stoc_send_chat_to_room(room, client.name + " " + body.exp + "点经验 " + (Math.round(body.pt)) + "点战斗力 排名第" + body.arena_rank + " (正式上线前这些积分可能被重置)", ygopro.constants.COLORS.BABYBLUE);
rank_txt = body.arena_rank > 0 ? "排名第" + body.arena_rank : "暂无排名";
ygopro.stoc_send_chat_to_room(room, client.name + " " + body.exp + "点经验 " + (Math.round(body.pt)) + "点战斗力 " + rank_txt + " (正式上线前这些积分可能被重置)", ygopro.constants.COLORS.BABYBLUE);
client.score_shown = true;
}
});
......
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