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) => {
console.log('Engine process closed with code:', code);
this.isReady = false;
console.log('Attempting to restart engine...');
// Add a small delay before restarting to avoid rapid restart loops
setTimeout(() => {
this.start()
.then(() => {
// Restore previous state if needed
if (this.currentFen) {
this.setPosition(this.currentFen);
}
this.emit('restarted', { code });
})
.catch(err => {
console.error('Failed to restart engine:', err);
this.emit('restart-failed', { error: err });
});
}, 1000);
// console.log('Attempting to restart engine...');
// // Add a small delay before restarting to avoid rapid restart loops
// setTimeout(() => {
// this.start()
// .then(() => {
// // Restore previous state if needed
// if (this.currentFen) {
// this.setPosition(this.currentFen);
// }
// this.emit('restarted', { code });
// })
// .catch(err => {
// console.error('Failed to restart engine:', err);
// this.emit('restart-failed', { error: err });
// });
// }, 1000);
});
// Initialize engine

View file

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