minor cleanup

This commit is contained in:
2ManyProjects 2025-03-18 09:55:17 -05:00
parent 4d48ad2414
commit 3558f4a9c9
3 changed files with 6 additions and 4 deletions

View file

@ -145,7 +145,7 @@ class ChessEngine extends EventEmitter {
} }
async setNewGame() { async setNewGame() {
if (!this.isReady) throw new Error('Engine not ready'); // if (!this.isReady) throw new Error('Engine not ready');
this.sendCommand(`ucinewgame`); this.sendCommand(`ucinewgame`);

View file

@ -68,7 +68,7 @@ const port = 27531;
let engine = null; let engine = null;
let isReady = false; let isReady = false;
let lastResponse = null let lastResponse = null
const SERVER_WAIT_THRESHOLD = 1 * 30 * 1000; const SERVER_WAIT_THRESHOLD = 1 * 60 * 1000;
const CHECK_INTERVAL = 5000; const CHECK_INTERVAL = 5000;
// Initialize ffish and engine // Initialize ffish and engine

View file

@ -96,8 +96,10 @@ func clear_game( ):
}) })
print(server_url + "/new") print(server_url + "/new")
print(body) print(body)
http_request.request(server_url + "/new", headers, HTTPClient.METHOD_POST, body)
await http_request.request_completed var request: HTTPRequest = HTTPRequest.new()
request.request(server_url + "/new", headers, HTTPClient.METHOD_POST, body)
await request.request_completed
func _exit_tree(): func _exit_tree():
ServerManager.stop_server() ServerManager.stop_server()
disconnect_engine(); disconnect_engine();