Commit a481f165 authored by mercury233's avatar mercury233

test2

parent 894a1a31
......@@ -4,6 +4,7 @@
"version": 4918,
"modules": {
"welcome": "YGOPRO Server",
"stop": "停服",
"tips": "http://mercury233.me/ygosrv233/tips.json",
"dialogues": "http://mercury233.me/ygosrv233/dialogues.json",
"post_start_watching": true,
......
......@@ -99,6 +99,7 @@ class Room
#积分
return if @deleted
#log.info 'room-delete', this.name, Room.all.length
@watcher_buffers = []
index = _.indexOf(Room.all, this)
#Room.all[index] = null unless index == -1
Room.all.splice(index, 1) unless index == -1
......@@ -111,7 +112,7 @@ class Room
client.server.connect @port, '127.0.0.1', ->
client.server.write buffer for buffer in client.pre_establish_buffers
client.established = true
client.pre_establish_buffers = null
client.pre_establish_buffers = []
disconnect: (client, error)->
if client.is_post_watcher
......
......@@ -131,6 +131,7 @@
if (this.deleted) {
return;
}
this.watcher_buffers = [];
index = _.indexOf(Room.all, this);
if (index !== -1) {
Room.all.splice(index, 1);
......@@ -149,7 +150,7 @@
client.server.write(buffer);
}
client.established = true;
return client.pre_establish_buffers = null;
return client.pre_establish_buffers = [];
});
}
};
......
......@@ -197,6 +197,14 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
}
client.end()
else if settings.modules.stop
ygopro.stoc_send_chat(client,settings.modules.stop)
ygopro.stoc_send client, 'ERROR_MSG',{
msg: 1
code: 2
}
client.end()
else if !info.pass.length
ygopro.stoc_send_chat(client,"房间为空,请修改房间名")
ygopro.stoc_send client, 'ERROR_MSG',{
......
......@@ -222,6 +222,13 @@
code: settings.version
});
return client.end();
} else if (settings.modules.stop) {
ygopro.stoc_send_chat(client, settings.modules.stop);
ygopro.stoc_send(client, 'ERROR_MSG', {
msg: 1,
code: 2
});
return client.end();
} else if (!info.pass.length) {
ygopro.stoc_send_chat(client, "房间为空,请修改房间名");
ygopro.stoc_send(client, 'ERROR_MSG', {
......
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