Commit c88caba1 authored by nanahira's avatar nanahira

Merge branch 'master' of ../srvpro

parents e6eef485 75b91036
Pipeline #32771 passed with stages
in 22 minutes and 32 seconds
...@@ -1578,8 +1578,9 @@ class Room ...@@ -1578,8 +1578,9 @@ class Room
return if @deleted return if @deleted
#log.info 'room-delete', this.name, ROOM_all.length #log.info 'room-delete', this.name, ROOM_all.length
score_array=[] score_array=[]
for name, score of @scores for name_vpass, score of @scores
score_form = { name: name.split('$')[0], score: score, deck: null, name_vpass: name } name = name_vpass.split('$')[0]
score_form = { name: name, score: score, deck: null, name_vpass: name_vpass }
if @decks[name] if @decks[name]
score_form.deck = @decks[name] score_form.deck = @decks[name]
score_array.push score_form score_array.push score_form
...@@ -2005,7 +2006,7 @@ class Room ...@@ -2005,7 +2006,7 @@ class Room
# 网络连接 # 网络连接
netRequestHandler = (client) -> netRequestHandler = (client) ->
if !client.isWs if !client.isWs
client.ip = client.remoteAddress client.ip = client.remoteAddress or ''
client.is_local = client.ip and (client.ip.includes('127.0.0.1') or client.ip.includes(real_windbot_server_ip)) client.is_local = client.ip and (client.ip.includes('127.0.0.1') or client.ip.includes(real_windbot_server_ip))
connect_count = ROOM_connected_ip[client.ip] or 0 connect_count = ROOM_connected_ip[client.ip] or 0
...@@ -2623,7 +2624,7 @@ ygopro.stoc_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)-> ...@@ -2623,7 +2624,7 @@ ygopro.stoc_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
ygopro.stoc_send_chat(client, room.welcome, ygopro.constants.COLORS.BABYBLUE) ygopro.stoc_send_chat(client, room.welcome, ygopro.constants.COLORS.BABYBLUE)
if room.welcome2 if room.welcome2
ygopro.stoc_send_chat(client, room.welcome2, ygopro.constants.COLORS.PINK) ygopro.stoc_send_chat(client, room.welcome2, ygopro.constants.COLORS.PINK)
if settings.modules.arena_mode.enabled and !client.is_local #and not client.score_shown if settings.modules.arena_mode.enabled and !client.is_local and settings.modules.arena_mode.get_score #and not client.score_shown
request request
url: settings.modules.arena_mode.get_score + encodeURIComponent(client.name), url: settings.modules.arena_mode.get_score + encodeURIComponent(client.name),
json: true json: true
......
...@@ -2043,20 +2043,21 @@ ...@@ -2043,20 +2043,21 @@
} }
delete() { delete() {
var end_time, formatted_replays, index, j, len, log_rep_id, name, player_datas, recorder_buffer, ref, ref1, repbuf, replay_id, room_name, score, score_array, score_form; var end_time, formatted_replays, index, j, len, log_rep_id, name, name_vpass, player_datas, recorder_buffer, ref, ref1, repbuf, replay_id, room_name, score, score_array, score_form;
if (this.deleted) { if (this.deleted) {
return; return;
} }
//log.info 'room-delete', this.name, ROOM_all.length //log.info 'room-delete', this.name, ROOM_all.length
score_array = []; score_array = [];
ref = this.scores; ref = this.scores;
for (name in ref) { for (name_vpass in ref) {
score = ref[name]; score = ref[name_vpass];
name = name_vpass.split('$')[0];
score_form = { score_form = {
name: name.split('$')[0], name: name,
score: score, score: score,
deck: null, deck: null,
name_vpass: name name_vpass: name_vpass
}; };
if (this.decks[name]) { if (this.decks[name]) {
score_form.deck = this.decks[name]; score_form.deck = this.decks[name];
...@@ -2698,7 +2699,7 @@ ...@@ -2698,7 +2699,7 @@
netRequestHandler = function(client) { netRequestHandler = function(client) {
var closeHandler, connect_count, dataHandler, server; var closeHandler, connect_count, dataHandler, server;
if (!client.isWs) { if (!client.isWs) {
client.ip = client.remoteAddress; client.ip = client.remoteAddress || '';
} }
client.is_local = client.ip && (client.ip.includes('127.0.0.1') || client.ip.includes(real_windbot_server_ip)); client.is_local = client.ip && (client.ip.includes('127.0.0.1') || client.ip.includes(real_windbot_server_ip));
connect_count = ROOM_connected_ip[client.ip] || 0; connect_count = ROOM_connected_ip[client.ip] || 0;
...@@ -3440,7 +3441,7 @@ ...@@ -3440,7 +3441,7 @@
if (room.welcome2) { if (room.welcome2) {
ygopro.stoc_send_chat(client, room.welcome2, ygopro.constants.COLORS.PINK); ygopro.stoc_send_chat(client, room.welcome2, ygopro.constants.COLORS.PINK);
} }
if (settings.modules.arena_mode.enabled && !client.is_local) { //and not client.score_shown if (settings.modules.arena_mode.enabled && !client.is_local && settings.modules.arena_mode.get_score) { //and not client.score_shown
request({ request({
url: settings.modules.arena_mode.get_score + encodeURIComponent(client.name), url: settings.modules.arena_mode.get_score + encodeURIComponent(client.name),
json: true json: 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