Commit 37c6359e authored by nanahira's avatar nanahira

no encode before pushing to challonge

parent 9bba5e39
...@@ -938,7 +938,7 @@ class Room ...@@ -938,7 +938,7 @@ class Room
if settings.modules.challonge.enabled and @started and !@kicked if settings.modules.challonge.enabled and @started and !@kicked
challonge.matches.update({ challonge.matches.update({
id: encodeURIComponent(settings.modules.challonge.tournament_id), id: settings.modules.challonge.tournament_id,
matchId: @challonge_info.id, matchId: @challonge_info.id,
match: @challonge_duel_log, match: @challonge_duel_log,
callback: (err, data) -> callback: (err, data) ->
...@@ -1624,7 +1624,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)-> ...@@ -1624,7 +1624,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
else else
ygopro.stoc_send_chat(client, '${loading_user_info}', ygopro.constants.COLORS.BABYBLUE) ygopro.stoc_send_chat(client, '${loading_user_info}', ygopro.constants.COLORS.BABYBLUE)
challonge.participants.index({ challonge.participants.index({
id: encodeURIComponent(settings.modules.challonge.tournament_id), id: settings.modules.challonge.tournament_id,
callback: (err, data) -> callback: (err, data) ->
if err or !data if err or !data
if err if err
...@@ -1641,7 +1641,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)-> ...@@ -1641,7 +1641,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
return return
client.challonge_info = found client.challonge_info = found
challonge.matches.index({ challonge.matches.index({
id: encodeURIComponent(settings.modules.challonge.tournament_id), id: settings.modules.challonge.tournament_id,
callback: (err, data) -> callback: (err, data) ->
if client.closed if client.closed
return return
...@@ -2802,7 +2802,7 @@ ygopro.stoc_follow 'CHANGE_SIDE', false, (buffer, info, client, server)-> ...@@ -2802,7 +2802,7 @@ ygopro.stoc_follow 'CHANGE_SIDE', false, (buffer, info, client, server)->
temp_log = JSON.parse(JSON.stringify(room.challonge_duel_log)) temp_log = JSON.parse(JSON.stringify(room.challonge_duel_log))
delete temp_log.winnerId delete temp_log.winnerId
challonge.matches.update({ challonge.matches.update({
id: encodeURIComponent(settings.modules.challonge.tournament_id), id: settings.modules.challonge.tournament_id,
matchId: room.challonge_info.id, matchId: room.challonge_info.id,
match: temp_log, match: temp_log,
callback: (err, data) -> callback: (err, data) ->
......
...@@ -1215,7 +1215,7 @@ ...@@ -1215,7 +1215,7 @@
} }
if (settings.modules.challonge.enabled && this.started && !this.kicked) { if (settings.modules.challonge.enabled && this.started && !this.kicked) {
challonge.matches.update({ challonge.matches.update({
id: encodeURIComponent(settings.modules.challonge.tournament_id), id: settings.modules.challonge.tournament_id,
matchId: this.challonge_info.id, matchId: this.challonge_info.id,
match: this.challonge_duel_log, match: this.challonge_duel_log,
callback: function(err, data) { callback: function(err, data) {
...@@ -2001,7 +2001,7 @@ ...@@ -2001,7 +2001,7 @@
} else { } else {
ygopro.stoc_send_chat(client, '${loading_user_info}', ygopro.constants.COLORS.BABYBLUE); ygopro.stoc_send_chat(client, '${loading_user_info}', ygopro.constants.COLORS.BABYBLUE);
challonge.participants.index({ challonge.participants.index({
id: encodeURIComponent(settings.modules.challonge.tournament_id), id: settings.modules.challonge.tournament_id,
callback: function(err, data) { callback: function(err, data) {
var found, k, user; var found, k, user;
if (err || !data) { if (err || !data) {
...@@ -2025,7 +2025,7 @@ ...@@ -2025,7 +2025,7 @@
} }
client.challonge_info = found; client.challonge_info = found;
challonge.matches.index({ challonge.matches.index({
id: encodeURIComponent(settings.modules.challonge.tournament_id), id: settings.modules.challonge.tournament_id,
callback: function(err, data) { callback: function(err, data) {
var len4, len5, match, o, p, player, ref4, ref5; var len4, len5, match, o, p, player, ref4, ref5;
if (client.closed) { if (client.closed) {
...@@ -3538,7 +3538,7 @@ ...@@ -3538,7 +3538,7 @@
temp_log = JSON.parse(JSON.stringify(room.challonge_duel_log)); temp_log = JSON.parse(JSON.stringify(room.challonge_duel_log));
delete temp_log.winnerId; delete temp_log.winnerId;
challonge.matches.update({ challonge.matches.update({
id: encodeURIComponent(settings.modules.challonge.tournament_id), id: settings.modules.challonge.tournament_id,
matchId: room.challonge_info.id, matchId: room.challonge_info.id,
match: temp_log, match: temp_log,
callback: function(err, data) { callback: function(err, data) {
......
...@@ -155,9 +155,9 @@ var UploadToChallonge = function() { ...@@ -155,9 +155,9 @@ var UploadToChallonge = function() {
var player_name = player_list[k]; var player_name = player_list[k];
sendResponse("正在上传玩家 "+player_name+" 至Challonge。"); sendResponse("正在上传玩家 "+player_name+" 至Challonge。");
challonge.participants.create({ challonge.participants.create({
id: encodeURIComponent(challonge_config.tournament_id), id: challonge_config.tournament_id,
participant: { participant: {
name: encodeURIComponent(player_name) name: player_name
}, },
callback: (function(player_name, success_count) { callback: (function(player_name, success_count) {
return function(err, data) { return function(err, data) {
......
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