Commit e3bf3b1a authored by mercury233's avatar mercury233

fix

parent 8b1f8400
...@@ -327,7 +327,7 @@ class Room ...@@ -327,7 +327,7 @@ class Room
return return
return return
if @windbot if @windbot
log.info @windbot #log.info @windbot
@ai_process = spawn 'mono', ['WindBot.exe'], { @ai_process = spawn 'mono', ['WindBot.exe'], {
cwd: 'windbot', env: { cwd: 'windbot', env: {
YGOPRO_VERSION: settings.version YGOPRO_VERSION: settings.version
...@@ -339,7 +339,7 @@ class Room ...@@ -339,7 +339,7 @@ class Room
} }
} }
@ai_process.stdout.on 'data', (data)=> @ai_process.stdout.on 'data', (data)=>
log.info "AI stdout: " + data #log.info "AI stdout: " + data
return return
@ai_process.stderr.on 'data', (data)=> @ai_process.stderr.on 'data', (data)=>
log.info "AI stderr: " + data log.info "AI stderr: " + data
......
...@@ -431,7 +431,6 @@ ...@@ -431,7 +431,6 @@
}); });
}); });
if (_this.windbot) { if (_this.windbot) {
log.info(_this.windbot);
_this.ai_process = spawn('mono', ['WindBot.exe'], { _this.ai_process = spawn('mono', ['WindBot.exe'], {
cwd: 'windbot', cwd: 'windbot',
env: { env: {
...@@ -443,9 +442,7 @@ ...@@ -443,9 +442,7 @@
YGOPRO_DIALOG: _this.windbot.dialog YGOPRO_DIALOG: _this.windbot.dialog
} }
}); });
_this.ai_process.stdout.on('data', function(data) { _this.ai_process.stdout.on('data', function(data) {});
log.info("AI stdout: " + data);
});
_this.ai_process.stderr.on('data', function(data) { _this.ai_process.stderr.on('data', function(data) {
log.info("AI stderr: " + data); log.info("AI stderr: " + data);
}); });
......
...@@ -577,7 +577,7 @@ ygopro.stoc_follow 'JOIN_GAME', false, (buffer, info, client, server)-> ...@@ -577,7 +577,7 @@ ygopro.stoc_follow 'JOIN_GAME', false, (buffer, info, client, server)->
if client.room.welcome if client.room.welcome
ygopro.stoc_send_chat client, client.room.welcome, 14 ygopro.stoc_send_chat client, client.room.welcome, 14
if settings.modules.enable_cloud_replay and !client.room.recorder if !client.room.recorder
client.room.recorder = recorder = net.connect client.room.port, -> client.room.recorder = recorder = net.connect client.room.port, ->
ygopro.ctos_send recorder, 'PLAYER_INFO', { ygopro.ctos_send recorder, 'PLAYER_INFO', {
name: "Marshtomp" name: "Marshtomp"
...@@ -592,7 +592,7 @@ ygopro.stoc_follow 'JOIN_GAME', false, (buffer, info, client, server)-> ...@@ -592,7 +592,7 @@ ygopro.stoc_follow 'JOIN_GAME', false, (buffer, info, client, server)->
return return
recorder.on 'data', (data)-> recorder.on 'data', (data)->
return unless client.room return unless client.room and settings.modules.enable_cloud_replay
client.room.recorder_buffers.push data client.room.recorder_buffers.push data
recorder.on 'error', (error)-> recorder.on 'error', (error)->
......
...@@ -647,7 +647,7 @@ ...@@ -647,7 +647,7 @@
if (client.room.welcome) { if (client.room.welcome) {
ygopro.stoc_send_chat(client, client.room.welcome, 14); ygopro.stoc_send_chat(client, client.room.welcome, 14);
} }
if (settings.modules.enable_cloud_replay && !client.room.recorder) { if (!client.room.recorder) {
client.room.recorder = recorder = net.connect(client.room.port, function() { client.room.recorder = recorder = net.connect(client.room.port, function() {
ygopro.ctos_send(recorder, 'PLAYER_INFO', { ygopro.ctos_send(recorder, 'PLAYER_INFO', {
name: "Marshtomp" name: "Marshtomp"
...@@ -661,7 +661,7 @@ ...@@ -661,7 +661,7 @@
ygopro.ctos_send(recorder, 'HS_TOOBSERVER'); ygopro.ctos_send(recorder, 'HS_TOOBSERVER');
}); });
recorder.on('data', function(data) { recorder.on('data', function(data) {
if (!client.room) { if (!(client.room && settings.modules.enable_cloud_replay)) {
return; return;
} }
return client.room.recorder_buffers.push(data); return client.room.recorder_buffers.push(data);
......
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