# HG changeset patch # User unc0rr # Date 1197199559 0 # Node ID 9050a949db219d52c55e697f567a0617e752964c # Parent 5e09ae25729fe9cb8ae6b07935675bf6bac4f892 Half implement registration in servers list diff -r 5e09ae25729f -r 9050a949db21 QTfrontend/CMakeLists.txt --- a/QTfrontend/CMakeLists.txt Sun Dec 09 10:09:52 2007 +0000 +++ b/QTfrontend/CMakeLists.txt Sun Dec 09 11:25:59 2007 +0000 @@ -62,7 +62,9 @@ newnetclient.cpp netudpserver.cpp netudpwidget.cpp + netwwwserver.cpp netwwwwidget.cpp + netregister.cpp netserverslist.cpp chatwidget.cpp binds.cpp @@ -100,7 +102,9 @@ newnetclient.h netudpserver.h netudpwidget.h + netwwwserver.h netwwwwidget.h + netregister.h netserverslist.h chatwidget.h SDLs.h diff -r 5e09ae25729f -r 9050a949db21 QTfrontend/netregister.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/QTfrontend/netregister.cpp Sun Dec 09 11:25:59 2007 +0000 @@ -0,0 +1,25 @@ +/* + * Hedgewars, a worms-like game + * Copyright (c) 2007 Andrey Korotaev + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#include "netregister.h" + +HWNetRegisterServer::HWNetRegisterServer(QObject *parent, const QString & descr, quint16 port) : + QObject(parent) +{ + +} diff -r 5e09ae25729f -r 9050a949db21 QTfrontend/netregister.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/QTfrontend/netregister.h Sun Dec 09 11:25:59 2007 +0000 @@ -0,0 +1,32 @@ +/* + * Hedgewars, a worms-like game + * Copyright (c) 2007 Andrey Korotaev + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#ifndef _NET_REGISTER_INCLUDED +#define _NET_REGISTER_INCLUDED + +#include + +class HWNetRegisterServer : public QObject +{ + Q_OBJECT + +public: + HWNetRegisterServer(QObject *parent, const QString & descr, quint16 port); +}; + +#endif // _NET_REGISTER_INCLUDED diff -r 5e09ae25729f -r 9050a949db21 QTfrontend/netudpserver.cpp --- a/QTfrontend/netudpserver.cpp Sun Dec 09 10:09:52 2007 +0000 +++ b/QTfrontend/netudpserver.cpp Sun Dec 09 11:25:59 2007 +0000 @@ -20,8 +20,8 @@ #include "netudpserver.h" -HWNetUdpServer::HWNetUdpServer(QObject* parent) : - QObject(parent) +HWNetUdpServer::HWNetUdpServer(QObject *parent, const QString & descr, quint16 port) : + HWNetRegisterServer(parent, descr, port) { pUdpSocket = new QUdpSocket(this); pUdpSocket->bind(46631); diff -r 5e09ae25729f -r 9050a949db21 QTfrontend/netudpserver.h --- a/QTfrontend/netudpserver.h Sun Dec 09 10:09:52 2007 +0000 +++ b/QTfrontend/netudpserver.h Sun Dec 09 11:25:59 2007 +0000 @@ -20,15 +20,16 @@ #define _NET_UDPSERVER_INCLUDED #include +#include "netregister.h" class QUdpSocket; -class HWNetUdpServer : public QObject +class HWNetUdpServer : public HWNetRegisterServer { Q_OBJECT public: - HWNetUdpServer(QObject *parent = 0); + HWNetUdpServer(QObject *parent, const QString & descr, quint16 port); private slots: void onClientRead(); diff -r 5e09ae25729f -r 9050a949db21 QTfrontend/netwwwserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/QTfrontend/netwwwserver.cpp Sun Dec 09 11:25:59 2007 +0000 @@ -0,0 +1,30 @@ +/* + * Hedgewars, a worms-like game + * Copyright (c) 2007 Andrey Korotaev + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#include "netwwwserver.h" + +HWNetWwwServer::HWNetWwwServer(QObject *parent, const QString & descr, quint16 port) : + HWNetRegisterServer(parent, descr, port) +{ + qDebug("www server start"); +} + +void HWNetWwwServer::onClientRead() +{ + +} diff -r 5e09ae25729f -r 9050a949db21 QTfrontend/netwwwserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/QTfrontend/netwwwserver.h Sun Dec 09 11:25:59 2007 +0000 @@ -0,0 +1,38 @@ +/* + * Hedgewars, a worms-like game + * Copyright (c) 2007 Andrey Korotaev + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#ifndef _NET_WWWSERVER_INCLUDED +#define _NET_WWWSERVER_INCLUDED + +#include +#include "netregister.h" + +class HWNetWwwServer : public HWNetRegisterServer +{ + Q_OBJECT + +public: + HWNetWwwServer(QObject *parent, const QString & descr, quint16 port); + +private slots: + void onClientRead(); + +private: +}; + +#endif // _NET_WWWSERVER_INCLUDED