Commit de13c777 authored by mercury233's avatar mercury233

fix

parent d7f0b0d6
...@@ -264,16 +264,16 @@ class Room ...@@ -264,16 +264,16 @@ class Room
ygopro.stoc_send_chat_to_room this, "#{client.name} #{'退出了观战'}#{if error then ": #{error}" else ''}" ygopro.stoc_send_chat_to_room this, "#{client.name} #{'退出了观战'}#{if error then ": #{error}" else ''}"
index = _.indexOf(@watchers, client) index = _.indexOf(@watchers, client)
@watchers.splice(index, 1) unless index == -1 @watchers.splice(index, 1) unless index == -1
client.room = null #client.room = null
else else
index = _.indexOf(@players, client) index = _.indexOf(@players, client)
@players.splice(index, 1) unless index == -1 @players.splice(index, 1) unless index == -1
if @players.length if @players.length
ygopro.stoc_send_chat_to_room this, "#{client.name} #{'离开了游戏'}#{if error then ": #{error}" else ''}" ygopro.stoc_send_chat_to_room this, "#{client.name} #{'离开了游戏'}#{if error then ": #{error}" else ''}"
client.room = null #client.room = null
else else
@process.kill() @process.kill()
client.room = null #client.room = null
this.delete() this.delete()
return return
......
...@@ -337,7 +337,6 @@ ...@@ -337,7 +337,6 @@
if (index !== -1) { if (index !== -1) {
this.watchers.splice(index, 1); this.watchers.splice(index, 1);
} }
client.room = null;
} else { } else {
index = _.indexOf(this.players, client); index = _.indexOf(this.players, client);
if (index !== -1) { if (index !== -1) {
...@@ -345,10 +344,8 @@ ...@@ -345,10 +344,8 @@
} }
if (this.players.length) { if (this.players.length) {
ygopro.stoc_send_chat_to_room(this, client.name + " " + '离开了游戏' + (error ? ": " + error : '')); ygopro.stoc_send_chat_to_room(this, client.name + " " + '离开了游戏' + (error ? ": " + error : ''));
client.room = null;
} else { } else {
this.process.kill(); this.process.kill();
client.room = null;
this["delete"](); this["delete"]();
} }
} }
......
...@@ -512,7 +512,7 @@ if settings.modules.http ...@@ -512,7 +512,7 @@ if settings.modules.http
else if u.query.pass == settings.modules.http.password && u.query.welcome else if u.query.pass == settings.modules.http.password && u.query.welcome
settings.modules.welcome = u.query.welcome settings.modules.welcome = u.query.welcome
response.writeHead(200) response.writeHead(200)
response.end("welcome " + u.query.stop + " ok") response.end("welcome " + u.query.welcome + " ok")
else else
response.writeHead(404); response.writeHead(404);
......
...@@ -636,7 +636,7 @@ ...@@ -636,7 +636,7 @@
} else if (u.query.pass === settings.modules.http.password && u.query.welcome) { } else if (u.query.pass === settings.modules.http.password && u.query.welcome) {
settings.modules.welcome = u.query.welcome; settings.modules.welcome = u.query.welcome;
response.writeHead(200); response.writeHead(200);
response.end("welcome " + u.query.stop + " ok"); response.end("welcome " + u.query.welcome + " ok");
} else { } else {
response.writeHead(404); response.writeHead(404);
response.end(); response.end();
......
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