diff options
| author | manuel <manuel@mausz.at> | 2011-04-12 20:23:33 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2011-04-12 20:23:33 +0200 |
| commit | 6af8e7795da1e86745364af1538fa76d4e0fc07e (patch) | |
| tree | 815ea747b9249a3a7ee10040c31da45c9af48fb1 /pacman-c++/mainwidget.cpp | |
| parent | ea20d11fdaf383eab6269d5aae2558fd15c5c29e (diff) | |
| download | foop-6af8e7795da1e86745364af1538fa76d4e0fc07e.tar.gz foop-6af8e7795da1e86745364af1538fa76d4e0fc07e.tar.bz2 foop-6af8e7795da1e86745364af1538fa76d4e0fc07e.zip | |
minor improvments: better debug messages + no tabs :D
Diffstat (limited to 'pacman-c++/mainwidget.cpp')
| -rw-r--r-- | pacman-c++/mainwidget.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pacman-c++/mainwidget.cpp b/pacman-c++/mainwidget.cpp index ba09f7d..89cbd58 100644 --- a/pacman-c++/mainwidget.cpp +++ b/pacman-c++/mainwidget.cpp | |||
| @@ -31,7 +31,7 @@ MainWidget::MainWidget(QWidget *parent) | |||
| 31 | connect(sendTimer, SIGNAL(timeout()), this, SLOT(sendKeyUpdate())); | 31 | connect(sendTimer, SIGNAL(timeout()), this, SLOT(sendKeyUpdate())); |
| 32 | sendTimer->start(Constants::tick); | 32 | sendTimer->start(Constants::tick); |
| 33 | 33 | ||
| 34 | qDebug() << "mycolor=" << m_scene->color(); | 34 | qDebug() << "[Connect] mycolor=" << m_scene->color(); |
| 35 | 35 | ||
| 36 | //TODO: play intro as soon as there are enough players | 36 | //TODO: play intro as soon as there are enough players |
| 37 | //connect(AudioPlayer::self(), SIGNAL(finished()), this, SLOT(startGame())); | 37 | //connect(AudioPlayer::self(), SIGNAL(finished()), this, SLOT(startGame())); |
| @@ -134,7 +134,6 @@ void MainWidget::tick() | |||
| 134 | std::string dataStr; | 134 | std::string dataStr; |
| 135 | Util::QByteArrayToStdString(m_socket->readAll(), dataStr); | 135 | Util::QByteArrayToStdString(m_socket->readAll(), dataStr); |
| 136 | 136 | ||
| 137 | //qDebug() << "read str " << dataStr.length(); | ||
| 138 | ProtoBuf::MapUpdate packet; | 137 | ProtoBuf::MapUpdate packet; |
| 139 | bool worked = packet.ParseFromString(dataStr); | 138 | bool worked = packet.ParseFromString(dataStr); |
| 140 | Q_ASSERT(worked); | 139 | Q_ASSERT(worked); |
| @@ -174,7 +173,7 @@ void MainWidget::sendKeyUpdate() | |||
| 174 | return; | 173 | return; |
| 175 | if (m_currentKey == Transmission::direction_none) | 174 | if (m_currentKey == Transmission::direction_none) |
| 176 | return; | 175 | return; |
| 177 | qDebug() << "send key: " << m_currentKey; | 176 | qDebug() << "[SendKey] key=" << m_currentKey; |
| 178 | ProtoBuf::KeyPressUpdate packet; | 177 | ProtoBuf::KeyPressUpdate packet; |
| 179 | packet.set_newkey(m_currentKey); | 178 | packet.set_newkey(m_currentKey); |
| 180 | Util::sendPacket(packet, m_socket); | 179 | Util::sendPacket(packet, m_socket); |
| @@ -207,7 +206,7 @@ Color::Color MainWidget::connectToServer() | |||
| 207 | // check command line arguments for server port | 206 | // check command line arguments for server port |
| 208 | const QStringList &args = QCoreApplication::arguments(); | 207 | const QStringList &args = QCoreApplication::arguments(); |
| 209 | QString srv = args.value(1, "127.0.0.1"); | 208 | QString srv = args.value(1, "127.0.0.1"); |
| 210 | qDebug() << "srv: " << srv; | 209 | qDebug() << "[Connect] server=" << srv; |
| 211 | 210 | ||
| 212 | // connect to server | 211 | // connect to server |
| 213 | m_socket = new QTcpSocket(this); | 212 | m_socket = new QTcpSocket(this); |
