-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
draft ratchet/ws server #261 #266
Conversation
About no.4
I have updated upd. can't find this file chesslablab/php-chess@c3fd216 is the |
Thanks for sending this PR! Let me have a look and get back to you with an update. These are some answers to the questions:
No problem, the allowed hosts filter should be set up in the prod environment.
Shall we stick with
I'm of the opinion to use the
Chess\UciEngine\Stockfish has been deprecated in version 1.4.16 in favor of Chess\UciEngine\UciEngine as described in the docs. use Chess\UciEngine\UciEngine;
use Chess\UciEngine\Details\Limit;
use Chess\Variant\Classical\Board;
$board = new Board();
$board->play('w', 'e4');
$limit = (new Limit())->setDepth(3);
$stockfish = (new UciEngine('/usr/games/stockfish'))->setOption('Skill Level', 9);
$analysis = $stockfish->analysis($board, $limit);
$board->playLan('b', $analysis['bestmove']);
echo $board->getMovetext();
Keep it up, and happy learning! |
maybe it's better, I have just created separated options for intuitive understanding, because not all of WSS options available for WS, do at your choice!
I have tested on my fork before merge it to origin - there is latest version Of course, composer dependencies was updated, but no success Stockfish installed, and I can interact up to few moves, then server think and alerts with socket error. I have no ideas what can I do, it looks like version on https://ui.chesslablab.org/ is different than repository. |
I'm stupid: just forgot to install but how does it work for about first ~5 steps, the server not always request stockfish for AI moves? sorry for disturb, seems that everything works well now. |
p.s. finally, I think that's better to keep
|
Just found strange moment on attempt to play this morning with PC: I'm starting chess-server with systemd service, in logs only this:
restarted service manually, and it work again. it's a second time where I see this connection problem (after update from dev.php), maybe local issue with the server environment, not the script.. |
my implementation of ws server #261
few notes before merge:
I didn't found how to make allowed hosts filter, so this option not implemented (because my server open for third-party connections) - people can just extend this implementation for their personal needs.
Added few separated config options to the
.env.example
- even it could be common for WS/WSSCreated
ws.php
instead ofdev.php
like in previous version - I think it's more clear for beginners.it works, but I still getting Error occurred when playing against a computer #256
maybe forgot to upgrade something..