Commit ff9b1069 authored by nanahira's avatar nanahira

Merge branch 'mc'

parents 02496814 e770e9de
...@@ -9,7 +9,7 @@ room_data = (room)-> ...@@ -9,7 +9,7 @@ room_data = (room)->
title: room.title, title: room.title,
user: {username: room.username} user: {username: room.username}
users: ({username: client.name, position: client.pos} for client in room.players), users: ({username: client.name, position: client.pos} for client in room.players),
options: room.hostinfo, options: room.get_old_hostinfo(), # Should be updated when MyCard client updates
arena: settings.modules.arena_mode.enabled && room.arena && settings.modules.arena_mode.mode arena: settings.modules.arena_mode.enabled && room.arena && settings.modules.arena_mode.mode
init = (http_server, ROOM_all)-> init = (http_server, ROOM_all)->
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
} }
return results; return results;
})(), })(),
options: room.hostinfo, options: room.get_old_hostinfo(),
arena: settings.modules.arena_mode.enabled && room.arena && settings.modules.arena_mode.mode arena: settings.modules.arena_mode.enabled && room.arena && settings.modules.arena_mode.mode
}; };
}; };
......
...@@ -1453,6 +1453,11 @@ class Room ...@@ -1453,6 +1453,11 @@ class Room
challonge_duel_log.scoresCsv = "0-0" challonge_duel_log.scoresCsv = "0-0"
return challonge_duel_log return challonge_duel_log
get_old_hostinfo: () -> # Just for supporting websocket roomlist in old MyCard client....
ret = _.clone(@hostinfo)
ret.enable_priority = (@hostinfo.duel_rule == 4)
return ret
send_replays: () -> send_replays: () ->
return false unless settings.modules.replay_delay and @replays.length and @hostinfo.mode == 1 return false unless settings.modules.replay_delay and @replays.length and @hostinfo.mode == 1
for player in @players for player in @players
......
...@@ -1896,6 +1896,13 @@ ...@@ -1896,6 +1896,13 @@
return challonge_duel_log; return challonge_duel_log;
}; };
Room.prototype.get_old_hostinfo = function() {
var ret;
ret = _.clone(this.hostinfo);
ret.enable_priority = this.hostinfo.duel_rule === 4;
return ret;
};
Room.prototype.send_replays = function() { Room.prototype.send_replays = function() {
var len2, len3, m, n, player, ref3, ref4; var len2, len3, m, n, player, ref3, ref4;
if (!(settings.modules.replay_delay && this.replays.length && this.hostinfo.mode === 1)) { if (!(settings.modules.replay_delay && this.replays.length && this.hostinfo.mode === 1)) {
......
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