Commit 5b95cd02 authored by mercury233's avatar mercury233

dont show AI in roomlist

parent c452e487
...@@ -415,7 +415,7 @@ class Room ...@@ -415,7 +415,7 @@ class Room
@process.stdout.setEncoding('utf8') @process.stdout.setEncoding('utf8')
@process.stdout.once 'data', (data)=> @process.stdout.once 'data', (data)=>
@established = true @established = true
roomlist.create(this) if settings.modules.http.websocket_roomlist roomlist.create(this) if !@windbot and settings.modules.http.websocket_roomlist
@port = parseInt data @port = parseInt data
_.each @players, (player)=> _.each @players, (player)=>
player.server.connect @port, '127.0.0.1', -> player.server.connect @port, '127.0.0.1', ->
...@@ -509,7 +509,7 @@ class Room ...@@ -509,7 +509,7 @@ class Room
index = _.indexOf(ROOM_all, this) index = _.indexOf(ROOM_all, this)
ROOM_all[index] = null unless index == -1 ROOM_all[index] = null unless index == -1
#ROOM_all.splice(index, 1) unless index == -1 #ROOM_all.splice(index, 1) unless index == -1
roomlist.delete this if @established and settings.modules.http.websocket_roomlist roomlist.delete this if !@windbot and @established and settings.modules.http.websocket_roomlist
return return
get_playing_player: -> get_playing_player: ->
...@@ -553,7 +553,7 @@ class Room ...@@ -553,7 +553,7 @@ class Room
ROOM_players_oppentlist[client.ip] = null ROOM_players_oppentlist[client.ip] = null
if @established if @established
roomlist.update(this) if !@started and settings.modules.http.websocket_roomlist roomlist.update(this) if !@windbot and !@started and settings.modules.http.websocket_roomlist
client.server.connect @port, '127.0.0.1', -> client.server.connect @port, '127.0.0.1', ->
client.server.write buffer for buffer in client.pre_establish_buffers client.server.write buffer for buffer in client.pre_establish_buffers
client.established = true client.established = true
...@@ -578,7 +578,7 @@ class Room ...@@ -578,7 +578,7 @@ class Room
ROOM_ban_player(client.name, client.ip, "${random_ban_reason_flee}") ROOM_ban_player(client.name, client.ip, "${random_ban_reason_flee}")
if @players.length and !(@windbot and client.is_host) if @players.length and !(@windbot and client.is_host)
ygopro.stoc_send_chat_to_room this, "#{client.name} ${left_game}" + if error then ": #{error}" else '' ygopro.stoc_send_chat_to_room this, "#{client.name} ${left_game}" + if error then ": #{error}" else ''
roomlist.update(this) if !@started and settings.modules.http.websocket_roomlist roomlist.update(this) if !@windbot and !@started and settings.modules.http.websocket_roomlist
#client.room = null #client.room = null
else else
@process.kill() @process.kill()
...@@ -1370,7 +1370,7 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server)-> ...@@ -1370,7 +1370,7 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server)->
unless room.started #first start unless room.started #first start
room.started = true room.started = true
room.start_time = moment().format() room.start_time = moment().format()
roomlist.start room if settings.modules.http.websocket_roomlist roomlist.start room if !room.windbot and settings.modules.http.websocket_roomlist
#room.duels = [] #room.duels = []
room.dueling_players = [] room.dueling_players = []
for player in room.players when player.pos != 7 for player in room.players when player.pos != 7
......
...@@ -555,7 +555,7 @@ ...@@ -555,7 +555,7 @@
this.process.stdout.once('data', (function(_this) { this.process.stdout.once('data', (function(_this) {
return function(data) { return function(data) {
_this.established = true; _this.established = true;
if (settings.modules.http.websocket_roomlist) { if (!_this.windbot && settings.modules.http.websocket_roomlist) {
roomlist.create(_this); roomlist.create(_this);
} }
_this.port = parseInt(data); _this.port = parseInt(data);
...@@ -682,7 +682,7 @@ ...@@ -682,7 +682,7 @@
if (index !== -1) { if (index !== -1) {
ROOM_all[index] = null; ROOM_all[index] = null;
} }
if (this.established && settings.modules.http.websocket_roomlist) { if (!this.windbot && this.established && settings.modules.http.websocket_roomlist) {
roomlist["delete"](this); roomlist["delete"](this);
} }
}; };
...@@ -737,7 +737,7 @@ ...@@ -737,7 +737,7 @@
} }
} }
if (this.established) { if (this.established) {
if (!this.started && settings.modules.http.websocket_roomlist) { if (!this.windbot && !this.started && settings.modules.http.websocket_roomlist) {
roomlist.update(this); roomlist.update(this);
} }
client.server.connect(this.port, '127.0.0.1', function() { client.server.connect(this.port, '127.0.0.1', function() {
...@@ -775,7 +775,7 @@ ...@@ -775,7 +775,7 @@
} }
if (this.players.length && !(this.windbot && client.is_host)) { if (this.players.length && !(this.windbot && client.is_host)) {
ygopro.stoc_send_chat_to_room(this, (client.name + " ${left_game}") + (error ? ": " + error : '')); ygopro.stoc_send_chat_to_room(this, (client.name + " ${left_game}") + (error ? ": " + error : ''));
if (!this.started && settings.modules.http.websocket_roomlist) { if (!this.windbot && !this.started && settings.modules.http.websocket_roomlist) {
roomlist.update(this); roomlist.update(this);
} }
} else { } else {
...@@ -1674,7 +1674,7 @@ ...@@ -1674,7 +1674,7 @@
if (!room.started) { if (!room.started) {
room.started = true; room.started = true;
room.start_time = moment().format(); room.start_time = moment().format();
if (settings.modules.http.websocket_roomlist) { if (!room.windbot && settings.modules.http.websocket_roomlist) {
roomlist.start(room); roomlist.start(room);
} }
room.dueling_players = []; room.dueling_players = [];
......
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