QTfrontend/netwwwwidget.cpp
changeset 635 0fb6d55ecd66
parent 634 b9db5ff5cfdb
child 638 e1cc516488f2
equal deleted inserted replaced
634:b9db5ff5cfdb 635:0fb6d55ecd66
    28 {
    28 {
    29 	http = new QHttp(this);
    29 	http = new QHttp(this);
    30 	http->setHost("www.hedgewars.org", 80);
    30 	http->setHost("www.hedgewars.org", 80);
    31 	connect(http, SIGNAL(requestFinished(int, bool)), this, SLOT(onClientRead(int, bool)));
    31 	connect(http, SIGNAL(requestFinished(int, bool)), this, SLOT(onClientRead(int, bool)));
    32 }
    32 }
    33 // http://hedgewars.org/games/create
    33 
    34 // http://www.hedgewars.org/games/update_game?id=1&key=pufidzuk
       
    35 // http://www.hedgewars.org/games/destroy_game?id=5&key=wrdeough
       
    36 void HWNetWwwWidget::updateList()
    34 void HWNetWwwWidget::updateList()
    37 {
    35 {
    38 	http->abort();
    36 	http->abort();
    39 // example for adding game to server list
    37 
    40 /*	QString request = QString("game[title]=%1&game[port]=%2&game[password]=%3&game[protocol_version]=%4")
       
    41 			.arg("hedgewarsserver")
       
    42 			.arg(46631)
       
    43 			.arg(false ? "true" : "false")
       
    44 			.arg(*cProtoVer);
       
    45 	http->post("/games/create", request.toUtf8());
       
    46 */
       
    47 // query game list
       
    48 	QString request = QString("protocol_version=%1")
    38 	QString request = QString("protocol_version=%1")
    49 			.arg(*cProtoVer);
    39 			.arg(*cProtoVer);
    50 	http->post("/games/list_games", request.toUtf8());
    40 	http->post("/games/list_games", request.toUtf8());
    51 
    41 
    52 	serversList->clear();
    42 	serversList->clear();