minor cleanup
This commit is contained in:
parent
4d48ad2414
commit
3558f4a9c9
3 changed files with 6 additions and 4 deletions
|
|
@ -145,7 +145,7 @@ class ChessEngine extends EventEmitter {
|
|||
}
|
||||
|
||||
async setNewGame() {
|
||||
if (!this.isReady) throw new Error('Engine not ready');
|
||||
// if (!this.isReady) throw new Error('Engine not ready');
|
||||
|
||||
this.sendCommand(`ucinewgame`);
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ const port = 27531;
|
|||
let engine = null;
|
||||
let isReady = false;
|
||||
let lastResponse = null
|
||||
const SERVER_WAIT_THRESHOLD = 1 * 30 * 1000;
|
||||
const SERVER_WAIT_THRESHOLD = 1 * 60 * 1000;
|
||||
const CHECK_INTERVAL = 5000;
|
||||
|
||||
// Initialize ffish and engine
|
||||
|
|
|
|||
|
|
@ -96,8 +96,10 @@ func clear_game( ):
|
|||
})
|
||||
print(server_url + "/new")
|
||||
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():
|
||||
ServerManager.stop_server()
|
||||
disconnect_engine();
|
||||
|
|
|
|||
Loading…
Reference in a new issue