Page 39 of 216

Re: Banksia GUI released

Posted: Thu Jan 23, 2020 9:06 pm
by mephisto
Many thanks but unfortunately it did not work. Nevermind I will continue with Arena.
I was just interested to see if it worked with my Certabo board.

Re: Banksia GUI released

Posted: Thu Jan 23, 2020 9:43 pm
by F.Huber
mephisto wrote: Thu Jan 23, 2020 4:52 pm When I tried to install the software, I got the two following system error messages.

VCRUNTIME140.dll was not found
MSVCP140.dll was not found

Any help would be really appreciated.
Both files are included in the ZIP package of BanksiaGUI (Windows version).

Re: Banksia GUI released

Posted: Fri Jan 24, 2020 3:59 pm
by AdminX
Live URLs do not appear to be working in Banksia. When I open a Live URL nothing happens. I tested it using PGN Mentor (Android App) using this URL from 'TheWeekInChess' : https://theweekinchess.com/assets/files ... agpa20.pgn

It works there, what it does is give me a PGN database of games from the event. I select the game I want to watch, and it updates the board with the current move as they are played.

However in Banksia when I input the URL nothing happens. It does not even appear to download the PGN file. I was wondering if I am doing something wrong.

Here is an example of live urls working in PGN Mentor. Click image for larger view.

Image

Here is another example using Hiarcs Chess Explorer:

Image

Re: Banksia GUI released

Posted: Fri Jan 24, 2020 4:31 pm
by AdminX
AdminX wrote: Fri Jan 24, 2020 3:59 pm Live URLs do not appear to be working in Banksia. When I open a Live URL nothing happens. I tested it using PGN Mentor (Android App) using this URL from 'TheWeekInChess' : https://theweekinchess.com/assets/files ... agpa20.pgn

It works there, what it does is give me a PGN database of games from the event. I select the game I want to watch, and it updates the board with the current move as they are played.

However in Banksia when I input the URL nothing happens. It does not even appear to download the PGN file. I was wondering if I am doing something wrong.

Here is an example of live urls working in PGN Mentor. Click image for larger view.



Here is another example using Hiarcs Chess Explorer:

I am sorry, I mean Chess PGN Master not Mentor :oops:

Re: Banksia GUI released

Posted: Sun Jan 26, 2020 2:55 pm
by phhnguyen
AdminX wrote: Fri Jan 24, 2020 3:59 pm Live URLs do not appear to be working in Banksia. When I open a Live URL nothing happens. I tested it using PGN Mentor (Android App) using this URL from 'TheWeekInChess' : https://theweekinchess.com/assets/files ... agpa20.pgn
Thanks a lot for the report. I have been working on this bug.

==============================
OT:
This PGN file is strange/hard to download for me even I have tried many ways. I use QT QNetworkAccessManager to download. Usually, it works well with URLs, including SSL URLs. However, I can't download the above link. Program prints error: QNetworkReply::UnknownContentError and then "Not Acceptable".

Does anyone have experience/solution? I have tried to download it manually via web browsers, wget, curl... all work well but not my code :(

Thanks in advance.

The simplified code as below:

Code: Select all

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);

public slots:
    void downloadPgnUrlFinished(QNetworkReply *);
    void downloadError(QNetworkReply::NetworkError);
    void downloadPgnUrl(const QString&);

private:
    QNetworkAccessManager manager;
};

////////////
MainWindow::MainWindow(QWidget *parent) :
    ConnectWindow(parent)
{
    connect(&manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(downloadPgnUrlFinished(QNetworkReply*)));
}

void MainWindow::downloadPgnUrl(const QString& urlString)
{
    auto url = QUrl(urlString);
    QNetworkRequest request(url);

    if (urlString.startsWith("https")) {
        auto sslConfig = QSslConfiguration::defaultConfiguration();
        sslConfig.setProtocol(QSsl::AnyProtocol);
        sslConfig.setPeerVerifyMode (QSslSocket::VerifyNone);
        request.setSslConfiguration(sslConfig);
    }

    auto networkReply = manager.get(request);
    connect(networkReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(downloadError(QNetworkReply::NetworkError)));
}

void MainWindow::downloadError(QNetworkReply::NetworkError error)
{
    qDebug() << "Error: " << error; // <- QNetworkReply::UnknownContentError
}

void MainWindow::downloadPgnUrlFinished(QNetworkReply *reply)
{
    if (reply->error()) {
        qDebug() << "Error: " << reply->errorString(); // <- "Not Acceptable"
    } else  {
        auto text = QString::fromLocal8Bit(reply->readAll());
        qDebug() << "Downloaded text: " << text;
    }

    delete reply;
}


Re: Banksia GUI released

Posted: Sun Jan 26, 2020 3:13 pm
by noobpwnftw
The link gives the following in response: "content-type: application/x-chess-pgn".
How does your library handle such uncommon MIME type? From the error message, it seems paranoid about it and you may want to find a way to handle it as "text/plain".

Re: Banksia GUI released

Posted: Sun Jan 26, 2020 3:37 pm
by phhnguyen
noobpwnftw wrote: Sun Jan 26, 2020 3:13 pm The link gives the following in response: "content-type: application/x-chess-pgn".
How does your library handle such uncommon MIME type? From the error message, it seems paranoid about it and you may want to find a way to handle it as "text/plain".
Thanks for the prompt help.
I have tried several ways but all didn't work with the same error (I commented out all code I have tried as below).

I think I use almost a low-level library thus I can control /read any data. If I use the wrong content type, I should not get the error.

Code: Select all

...
//    request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("text/plain"));
//    request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/x-chess-pgn"));
//    request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/x-www-form-urlencoded"));
    request.setRawHeader("content-type", "text/plain");
//    request.setRawHeader("Accept", "*/*");

auto networkReply = manager.get(request);
...

Re: Banksia GUI released

Posted: Sun Jan 26, 2020 3:44 pm
by noobpwnftw
If this is HTTP code 406 from the server, then you might want to add more "Accept-???" headers as per curl or wget sends in your request.

Re: Banksia GUI released

Posted: Sun Jan 26, 2020 4:18 pm
by phhnguyen
noobpwnftw wrote: Sun Jan 26, 2020 3:44 pm If this is HTTP code 406 from the server, then you might want to add more "Accept-???" headers as per curl or wget sends in your request.
It didn't work, same error.

It is strange that when I copied the PGN file to my website, using SSL too, my download code works very well with any header.

Re: Banksia GUI released

Posted: Sun Jan 26, 2020 7:20 pm
by AdminX
I am sure you probably have seen this documentation already, if not it might help.

https://doc.qt.io/qt-5/qnetworkaccessmanager.html