Configuration is transferred. A new game should be started on client side, but signal/slot is not working yet. Oh well.
This commit is contained in:
@@ -538,6 +538,7 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
|
||||
connect(this, SIGNAL(SignalNetClientGameInfo(int)), myWaitingForServerGameDialog, SLOT(refresh(int)));
|
||||
// Errors are handled globally, not within one dialog.
|
||||
connect(this, SIGNAL(SignalNetClientError(int, int)), this, SLOT(networkError(int, int)));
|
||||
connect(this, SIGNAL(SignalNetClientGameStart(GameDataWrapper)), this, SLOT(networkStart(GameDataWrapper)));
|
||||
|
||||
connect(this, SIGNAL(SignalNetServerPlayerJoined(QString)), myStartNetworkGameDialog, SLOT(addConnectedPlayer(QString)));
|
||||
|
||||
@@ -2199,6 +2200,11 @@ void mainWindowImpl::networkError(int errorID, int osErrorID) {
|
||||
myWaitingForServerGameDialog->reject();
|
||||
}
|
||||
|
||||
void mainWindowImpl::networkStart(GameDataWrapper gameData)
|
||||
{
|
||||
mySession->startGame(gameData.GetGameData());
|
||||
}
|
||||
|
||||
void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) {
|
||||
|
||||
// cout << event->key() << endl;
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "handinterface.h"
|
||||
#include "game_defs.h"
|
||||
#include <gamedatawrapper.h>
|
||||
|
||||
class Session;
|
||||
class Game;
|
||||
@@ -93,6 +94,7 @@ signals:
|
||||
void SignalNetClientConnect(int actionID);
|
||||
void SignalNetClientGameInfo(int actionID);
|
||||
void SignalNetClientError(int errorID, int osErrorID);
|
||||
void SignalNetClientGameStart(GameDataWrapper gameData);
|
||||
void SignalNetServerPlayerJoined(QString playerName);
|
||||
|
||||
public slots:
|
||||
@@ -189,6 +191,7 @@ public slots:
|
||||
void paintStartSplash();
|
||||
|
||||
void networkError(int, int);
|
||||
void networkStart(GameDataWrapper);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user