Commit c5bce474 authored by mercury233's avatar mercury233

fix

parent 227962ff
...@@ -451,9 +451,9 @@ class Room ...@@ -451,9 +451,9 @@ class Room
arena: if @hostinfo.mode ==1 then 'athletic' else 'entertain' #settings.modules.arena_mode.mode arena: if @hostinfo.mode ==1 then 'athletic' else 'entertain' #settings.modules.arena_mode.mode
}}, (error, response, body)=> }}, (error, response, body)=>
if error if error
log.warn 'SCORE POST ERROR', error, response.statusCode, response.statusMessage, body log.warn 'SCORE POST ERROR', error
else else
if response.statusCode != 204 if response.statusCode != 204 or response.statusCode != 200
log.warn 'SCORE POST FAIL', response.statusCode, response.statusMessage, @name, body log.warn 'SCORE POST FAIL', response.statusCode, response.statusMessage, @name, body
else else
log.info 'SCORE POST OK', response.statusCode, response.statusMessage, @name, body log.info 'SCORE POST OK', response.statusCode, response.statusMessage, @name, body
...@@ -1086,8 +1086,10 @@ ygopro.stoc_follow 'JOIN_GAME', false, (buffer, info, client, server)-> ...@@ -1086,8 +1086,10 @@ ygopro.stoc_follow 'JOIN_GAME', false, (buffer, info, client, server)->
url: settings.modules.arena_mode.get_score + encodeURIComponent(client.name), url: settings.modules.arena_mode.get_score + encodeURIComponent(client.name),
json: true json: true
, (error, response, body)-> , (error, response, body)->
if error or !body or _.isString body if error
log.warn 'LOAD SCORE ERROR', client.name, error, response.statusCode, response.statusMessage, body log.warn 'LOAD SCORE ERROR', client.name, error
else if !body or _.isString body
log.warn 'LOAD SCORE FAIL', client.name, response.statusCode, response.statusMessage, body
else else
log.info 'LOAD SCORE', client.name, body log.info 'LOAD SCORE', client.name, body
rank_txt = if body.arena_rank>0 then "排名第" + body.arena_rank else "暂无排名" rank_txt = if body.arena_rank>0 then "排名第" + body.arena_rank else "暂无排名"
...@@ -1347,7 +1349,7 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server)-> ...@@ -1347,7 +1349,7 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server)->
arena: if room.hostinfo.mode ==1 then 'athletic' else 'entertain' arena: if room.hostinfo.mode ==1 then 'athletic' else 'entertain'
}}, (error, response, body)-> }}, (error, response, body)->
if error if error
log.warn 'DECK POST ERROR', error, response log.warn 'DECK POST ERROR', error
else else
if response.statusCode != 200 if response.statusCode != 200
log.warn 'DECK POST FAIL', response.statusCode, client.name, body log.warn 'DECK POST FAIL', response.statusCode, client.name, body
......
...@@ -609,9 +609,9 @@ ...@@ -609,9 +609,9 @@
}, (function(_this) { }, (function(_this) {
return function(error, response, body) { return function(error, response, body) {
if (error) { if (error) {
log.warn('SCORE POST ERROR', error, response.statusCode, response.statusMessage, body); log.warn('SCORE POST ERROR', error);
} else { } else {
if (response.statusCode !== 204) { if (response.statusCode !== 204 || response.statusCode !== 200) {
log.warn('SCORE POST FAIL', response.statusCode, response.statusMessage, _this.name, body); log.warn('SCORE POST FAIL', response.statusCode, response.statusMessage, _this.name, body);
} else { } else {
log.info('SCORE POST OK', response.statusCode, response.statusMessage, _this.name, body); log.info('SCORE POST OK', response.statusCode, response.statusMessage, _this.name, body);
...@@ -1316,8 +1316,10 @@ ...@@ -1316,8 +1316,10 @@
json: true json: true
}, function(error, response, body) { }, function(error, response, body) {
var rank_txt; var rank_txt;
if (error || !body || _.isString(body)) { if (error) {
log.warn('LOAD SCORE ERROR', client.name, error, response.statusCode, response.statusMessage, body); log.warn('LOAD SCORE ERROR', client.name, error);
} else if (!body || _.isString(body)) {
log.warn('LOAD SCORE FAIL', client.name, response.statusCode, response.statusMessage, body);
} else { } else {
log.info('LOAD SCORE', client.name, body); log.info('LOAD SCORE', client.name, body);
rank_txt = body.arena_rank > 0 ? "排名第" + body.arena_rank : "暂无排名"; rank_txt = body.arena_rank > 0 ? "排名第" + body.arena_rank : "暂无排名";
...@@ -1657,7 +1659,7 @@ ...@@ -1657,7 +1659,7 @@
} }
}, function(error, response, body) { }, function(error, response, body) {
if (error) { if (error) {
log.warn('DECK POST ERROR', error, response); log.warn('DECK POST ERROR', error);
} else { } else {
if (response.statusCode !== 200) { if (response.statusCode !== 200) {
log.warn('DECK POST FAIL', response.statusCode, client.name, body); log.warn('DECK POST FAIL', response.statusCode, client.name, body);
......
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