undid engine restart code

This commit is contained in:
2ManyProjects 2025-03-17 18:06:28 -05:00
parent 7a964d18d9
commit 860c3d31a7
2 changed files with 18 additions and 18 deletions

View file

@ -29,22 +29,22 @@ class ChessEngine extends EventEmitter {
this.engine.on('close', (code) => { this.engine.on('close', (code) => {
console.log('Engine process closed with code:', code); console.log('Engine process closed with code:', code);
this.isReady = false; this.isReady = false;
console.log('Attempting to restart engine...'); // console.log('Attempting to restart engine...');
// Add a small delay before restarting to avoid rapid restart loops // // Add a small delay before restarting to avoid rapid restart loops
setTimeout(() => { // setTimeout(() => {
this.start() // this.start()
.then(() => { // .then(() => {
// Restore previous state if needed // // Restore previous state if needed
if (this.currentFen) { // if (this.currentFen) {
this.setPosition(this.currentFen); // this.setPosition(this.currentFen);
} // }
this.emit('restarted', { code }); // this.emit('restarted', { code });
}) // })
.catch(err => { // .catch(err => {
console.error('Failed to restart engine:', err); // console.error('Failed to restart engine:', err);
this.emit('restart-failed', { error: err }); // this.emit('restart-failed', { error: err });
}); // });
}, 1000); // }, 1000);
}); });
// Initialize engine // Initialize engine

View file

@ -552,8 +552,8 @@ func generate_chess_data(node, player):
var unit_string = level_unit_distribution[index] var unit_string = level_unit_distribution[index]
var pawn_string = "" var pawn_string = ""
var height = 6; var height = 6;
unit_string = level_unit_distribution[level_unit_distribution.size() - 1] # unit_string = level_unit_distribution[level_unit_distribution.size() - 1]
height = 8 # height = 8
for x in unit_string.length(): for x in unit_string.length():
pawn_string += "p" pawn_string += "p"