next steps startwindow-integration. network- and internet-game --> BROKEN
This commit is contained in:
1 parent
e537951e4d
commit
fdd7956217
5 files changed
+228
-90
No files matched your search
@@ -208,6 +208,7 @@ void gameLobbyDialogImpl::refresh(int actionID) {
|
|||||||
{
|
{
|
||||||
treeWidget_GameList->clear();
|
treeWidget_GameList->clear();
|
||||||
this->accept();
|
this->accept();
|
||||||
|
// TODO doitux: hier gametable holen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+88
-84
@@ -34,11 +34,11 @@ GuiWrapper::GuiWrapper(ConfigFile *c) : myLog(NULL), myW(NULL), myConfig(c)
|
|||||||
|
|
||||||
|
|
||||||
myW = new gameTableImpl(myConfig);
|
myW = new gameTableImpl(myConfig);
|
||||||
myW->show();
|
// myW->show();
|
||||||
myLog = new Log(myW, myConfig);
|
myLog = new Log(myW, myConfig);
|
||||||
|
|
||||||
myStartWindow = boost::shared_ptr<startWindowImpl>(new startWindowImpl(myW, myConfig));
|
myStartWindow = boost::shared_ptr<startWindowImpl>(new startWindowImpl(myW, myConfig));
|
||||||
// myStartWindow->show();
|
myStartWindow->show();
|
||||||
|
|
||||||
myW->setStartWindow(myStartWindow);
|
myW->setStartWindow(myStartWindow);
|
||||||
}
|
}
|
||||||
@@ -123,110 +123,114 @@ void GuiWrapper::logPlayerWinGame(std::string playerName, int gameID) { myLog->s
|
|||||||
void GuiWrapper::flushLogAtGame(int gameID) { myLog->signalFlushLogAtGame(gameID); }
|
void GuiWrapper::flushLogAtGame(int gameID) { myLog->signalFlushLogAtGame(gameID); }
|
||||||
void GuiWrapper::flushLogAtHand() { myLog->signalFlushLogAtHand(); }
|
void GuiWrapper::flushLogAtHand() { myLog->signalFlushLogAtHand(); }
|
||||||
|
|
||||||
|
////////// this is for startwindow ////////////////////
|
||||||
// void GuiWrapper::SignalNetClientConnect(int actionID) { myStartWindow->signalNetClientConnect(actionID); }
|
|
||||||
// void GuiWrapper::SignalNetClientGameInfo(int actionID) { myStartWindow->signalNetClientGameInfo(actionID); }
|
|
||||||
// void GuiWrapper::SignalNetClientError(int errorID, int osErrorID) { myStartWindow->signalNetClientError(errorID, osErrorID); }
|
|
||||||
// void GuiWrapper::SignalNetClientNotification(int notificationId) { myStartWindow->signalNetClientNotification(notificationId); }
|
|
||||||
// void GuiWrapper::SignalNetClientStatsUpdate(const ServerStats &stats) { myStartWindow->signalNetClientStatsUpdate(stats); }
|
|
||||||
// void GuiWrapper::SignalNetClientShowTimeoutDialog(NetTimeoutReason reason, unsigned remainingSec) { myStartWindow->signalNetClientShowTimeoutDialog(reason, remainingSec); }
|
|
||||||
// void GuiWrapper::SignalNetClientRemovedFromGame(int notificationId) { myStartWindow->signalNetClientRemovedFromGame(notificationId); }
|
|
||||||
// void GuiWrapper::SignalNetClientSelfJoined(unsigned playerId, const string &playerName, PlayerRights rights) { myStartWindow->signalNetClientSelfJoined(playerId, QString::fromUtf8(playerName.c_str()), rights); }
|
|
||||||
// void GuiWrapper::SignalNetClientPlayerJoined(unsigned playerId, const string &playerName, PlayerRights rights) { myStartWindow->signalNetClientPlayerJoined(playerId, QString::fromUtf8(playerName.c_str()), rights); }
|
|
||||||
// void GuiWrapper::SignalNetClientPlayerChanged(unsigned playerId, const string &newPlayerName)
|
|
||||||
// {
|
|
||||||
// myStartWindow->signalNetClientPlayerChanged(playerId, QString::fromUtf8(newPlayerName.c_str()));
|
|
||||||
// }
|
|
||||||
// void GuiWrapper::SignalNetClientPlayerLeft(unsigned playerId, const string &playerName)
|
|
||||||
// {
|
|
||||||
// QString tmpName(QString::fromUtf8(playerName.c_str()));
|
|
||||||
// myStartWindow->signalNetClientPlayerLeft(playerId, tmpName);
|
|
||||||
// if (!playerName.empty() && playerName[0] != '#')
|
|
||||||
// myLog->signalLogPlayerLeftMsg(tmpName);
|
|
||||||
// }
|
|
||||||
// void GuiWrapper::SignalNetClientNewGameAdmin(unsigned playerId, const string &playerName) {
|
|
||||||
//
|
|
||||||
// myStartWindow->signalNetClientNewGameAdmin(playerId, QString::fromUtf8(playerName.c_str()));
|
|
||||||
// if (!playerName.empty() && playerName[0] != '#')
|
|
||||||
// myLog->signalLogNewGameAdminMsg(QString::fromUtf8(playerName.c_str()));
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// void GuiWrapper::SignalNetClientGameListNew(unsigned gameId) { myStartWindow->signalNetClientGameListNew(gameId); }
|
|
||||||
// void GuiWrapper::SignalNetClientGameListRemove(unsigned gameId) { myStartWindow->signalNetClientGameListRemove(gameId); }
|
|
||||||
// void GuiWrapper::SignalNetClientGameListUpdateMode(unsigned gameId, GameMode mode) { myStartWindow->signalNetClientGameListUpdateMode(gameId, mode); }
|
|
||||||
// void GuiWrapper::SignalNetClientGameListUpdateAdmin(unsigned gameId, unsigned adminPlayerId) {myStartWindow->signalNetClientGameListUpdateAdmin(gameId, adminPlayerId); }
|
|
||||||
// void GuiWrapper::SignalNetClientGameListPlayerJoined(unsigned gameId, unsigned playerId) { myStartWindow->signalNetClientGameListPlayerJoined(gameId, playerId); }
|
|
||||||
// void GuiWrapper::SignalNetClientGameListPlayerLeft(unsigned gameId, unsigned playerId) { myStartWindow->signalNetClientGameListPlayerLeft(gameId, playerId); }
|
|
||||||
//
|
|
||||||
// void GuiWrapper::SignalNetClientGameStart(boost::shared_ptr<Game> game) { myStartWindow->signalNetClientGameStart(game); }
|
|
||||||
// void GuiWrapper::SignalNetClientWaitDialog() { myStartWindow->signalShowClientDialog(); }
|
|
||||||
// void GuiWrapper::SignalNetClientChatMsg(const string &playerName, const string &msg) { myW->signalNetClientChatMsg(QString::fromUtf8(playerName.c_str()), QString::fromUtf8(msg.c_str())); }
|
|
||||||
// void GuiWrapper::SignalNetServerSuccess(int /*actionID*/) { }
|
|
||||||
// void GuiWrapper::SignalNetServerError(int errorID, int osErrorID) { myW->signalNetServerError(errorID, osErrorID); }
|
|
||||||
//
|
|
||||||
// void GuiWrapper::SignalIrcConnect(const string &server) { myStartWindow->signalIrcConnect(QString::fromUtf8(server.c_str())); }
|
|
||||||
// void GuiWrapper::SignalIrcSelfJoined(const string &nickName, const string &channel) { myStartWindow->signalIrcSelfJoined(QString::fromUtf8(nickName.c_str()), QString::fromUtf8(channel.c_str())); }
|
|
||||||
// void GuiWrapper::SignalIrcPlayerJoined(const string &nickName) { myStartWindow->signalIrcPlayerJoined(QString::fromUtf8(nickName.c_str())); }
|
|
||||||
// void GuiWrapper::SignalIrcPlayerChanged(const string &oldNick, const string &newNick) { myStartWindow->signalIrcPlayerChanged(QString::fromUtf8(oldNick.c_str()), QString::fromUtf8(newNick.c_str())); }
|
|
||||||
// void GuiWrapper::SignalIrcPlayerKicked(const std::string &nickName, const std::string &byWhom, const std::string &reason) { myStartWindow->signalIrcPlayerKicked(QString::fromUtf8(nickName.c_str()), QString::fromUtf8(byWhom.c_str()), QString::fromUtf8(reason.c_str())); }
|
|
||||||
// void GuiWrapper::SignalIrcPlayerLeft(const std::string &nickName) { myStartWindow->signalIrcPlayerLeft(QString::fromUtf8(nickName.c_str())); }
|
|
||||||
// void GuiWrapper::SignalIrcChatMsg(const std::string &nickName, const std::string &msg) { myStartWindow->signalIrcChatMessage(QString::fromUtf8(nickName.c_str()), QString::fromUtf8(msg.c_str())); }
|
|
||||||
// void GuiWrapper::SignalIrcError(int errorCode) { myStartWindow->signalIrcError(errorCode); }
|
|
||||||
// void GuiWrapper::SignalIrcServerError(int errorCode) {myStartWindow->signalIrcServerError(errorCode); }
|
|
||||||
|
|
||||||
|
|
||||||
//TEMPORARELY UNTIL STARTWINDOW REFACTORING IS OVER TODO
|
void GuiWrapper::SignalNetClientConnect(int actionID) { myStartWindow->signalNetClientConnect(actionID); }
|
||||||
|
void GuiWrapper::SignalNetClientGameInfo(int actionID) { myStartWindow->signalNetClientGameInfo(actionID); }
|
||||||
void GuiWrapper::SignalNetClientConnect(int actionID) { myW->signalNetClientConnect(actionID); }
|
void GuiWrapper::SignalNetClientError(int errorID, int osErrorID) { myStartWindow->signalNetClientError(errorID, osErrorID); }
|
||||||
void GuiWrapper::SignalNetClientGameInfo(int actionID) { myW->signalNetClientGameInfo(actionID); }
|
void GuiWrapper::SignalNetClientNotification(int notificationId) { myStartWindow->signalNetClientNotification(notificationId); }
|
||||||
void GuiWrapper::SignalNetClientError(int errorID, int osErrorID) { myW->signalNetClientError(errorID, osErrorID); }
|
void GuiWrapper::SignalNetClientStatsUpdate(const ServerStats &stats) { myStartWindow->signalNetClientStatsUpdate(stats); }
|
||||||
void GuiWrapper::SignalNetClientNotification(int notificationId) { myW->signalNetClientNotification(notificationId); }
|
void GuiWrapper::SignalNetClientShowTimeoutDialog(NetTimeoutReason reason, unsigned remainingSec) { myStartWindow->signalNetClientShowTimeoutDialog(reason, remainingSec); }
|
||||||
void GuiWrapper::SignalNetClientStatsUpdate(const ServerStats &stats) { myW->signalNetClientStatsUpdate(stats); }
|
void GuiWrapper::SignalNetClientRemovedFromGame(int notificationId) { myStartWindow->signalNetClientRemovedFromGame(notificationId); }
|
||||||
void GuiWrapper::SignalNetClientShowTimeoutDialog(NetTimeoutReason reason, unsigned remainingSec) { myW->signalNetClientShowTimeoutDialog(reason, remainingSec); }
|
void GuiWrapper::SignalNetClientSelfJoined(unsigned playerId, const string &playerName, PlayerRights rights) { myStartWindow->signalNetClientSelfJoined(playerId, QString::fromUtf8(playerName.c_str()), rights); }
|
||||||
void GuiWrapper::SignalNetClientRemovedFromGame(int notificationId) { myW->signalNetClientRemovedFromGame(notificationId); }
|
void GuiWrapper::SignalNetClientPlayerJoined(unsigned playerId, const string &playerName, PlayerRights rights) { myStartWindow->signalNetClientPlayerJoined(playerId, QString::fromUtf8(playerName.c_str()), rights); }
|
||||||
void GuiWrapper::SignalNetClientSelfJoined(unsigned playerId, const string &playerName, PlayerRights rights) { myW->signalNetClientSelfJoined(playerId, QString::fromUtf8(playerName.c_str()), rights); }
|
|
||||||
void GuiWrapper::SignalNetClientPlayerJoined(unsigned playerId, const string &playerName, PlayerRights rights) { myW->signalNetClientPlayerJoined(playerId, QString::fromUtf8(playerName.c_str()), rights); }
|
|
||||||
void GuiWrapper::SignalNetClientPlayerChanged(unsigned playerId, const string &newPlayerName)
|
void GuiWrapper::SignalNetClientPlayerChanged(unsigned playerId, const string &newPlayerName)
|
||||||
{
|
{
|
||||||
myW->signalNetClientPlayerChanged(playerId, QString::fromUtf8(newPlayerName.c_str()));
|
myStartWindow->signalNetClientPlayerChanged(playerId, QString::fromUtf8(newPlayerName.c_str()));
|
||||||
}
|
}
|
||||||
void GuiWrapper::SignalNetClientPlayerLeft(unsigned playerId, const string &playerName)
|
void GuiWrapper::SignalNetClientPlayerLeft(unsigned playerId, const string &playerName)
|
||||||
{
|
{
|
||||||
QString tmpName(QString::fromUtf8(playerName.c_str()));
|
QString tmpName(QString::fromUtf8(playerName.c_str()));
|
||||||
myW->signalNetClientPlayerLeft(playerId, tmpName);
|
myStartWindow->signalNetClientPlayerLeft(playerId, tmpName);
|
||||||
if (!playerName.empty() && playerName[0] != '#')
|
if (!playerName.empty() && playerName[0] != '#')
|
||||||
myLog->signalLogPlayerLeftMsg(tmpName);
|
myLog->signalLogPlayerLeftMsg(tmpName);
|
||||||
}
|
}
|
||||||
void GuiWrapper::SignalNetClientNewGameAdmin(unsigned playerId, const string &playerName) {
|
void GuiWrapper::SignalNetClientNewGameAdmin(unsigned playerId, const string &playerName) {
|
||||||
|
|
||||||
myW->signalNetClientNewGameAdmin(playerId, QString::fromUtf8(playerName.c_str()));
|
myStartWindow->signalNetClientNewGameAdmin(playerId, QString::fromUtf8(playerName.c_str()));
|
||||||
if (!playerName.empty() && playerName[0] != '#')
|
if (!playerName.empty() && playerName[0] != '#')
|
||||||
myLog->signalLogNewGameAdminMsg(QString::fromUtf8(playerName.c_str()));
|
myLog->signalLogNewGameAdminMsg(QString::fromUtf8(playerName.c_str()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiWrapper::SignalNetClientGameListNew(unsigned gameId) { myW->signalNetClientGameListNew(gameId); }
|
void GuiWrapper::SignalNetClientGameListNew(unsigned gameId) { myStartWindow->signalNetClientGameListNew(gameId); }
|
||||||
void GuiWrapper::SignalNetClientGameListRemove(unsigned gameId) { myW->signalNetClientGameListRemove(gameId); }
|
void GuiWrapper::SignalNetClientGameListRemove(unsigned gameId) { myStartWindow->signalNetClientGameListRemove(gameId); }
|
||||||
void GuiWrapper::SignalNetClientGameListUpdateMode(unsigned gameId, GameMode mode) { myW->signalNetClientGameListUpdateMode(gameId, mode); }
|
void GuiWrapper::SignalNetClientGameListUpdateMode(unsigned gameId, GameMode mode) { myStartWindow->signalNetClientGameListUpdateMode(gameId, mode); }
|
||||||
void GuiWrapper::SignalNetClientGameListUpdateAdmin(unsigned gameId, unsigned adminPlayerId) {myW->signalNetClientGameListUpdateAdmin(gameId, adminPlayerId); }
|
void GuiWrapper::SignalNetClientGameListUpdateAdmin(unsigned gameId, unsigned adminPlayerId) {myStartWindow->signalNetClientGameListUpdateAdmin(gameId, adminPlayerId); }
|
||||||
void GuiWrapper::SignalNetClientGameListPlayerJoined(unsigned gameId, unsigned playerId) { myW->signalNetClientGameListPlayerJoined(gameId, playerId); }
|
void GuiWrapper::SignalNetClientGameListPlayerJoined(unsigned gameId, unsigned playerId) { myStartWindow->signalNetClientGameListPlayerJoined(gameId, playerId); }
|
||||||
void GuiWrapper::SignalNetClientGameListPlayerLeft(unsigned gameId, unsigned playerId) { myW->signalNetClientGameListPlayerLeft(gameId, playerId); }
|
void GuiWrapper::SignalNetClientGameListPlayerLeft(unsigned gameId, unsigned playerId) { myStartWindow->signalNetClientGameListPlayerLeft(gameId, playerId); }
|
||||||
|
|
||||||
void GuiWrapper::SignalNetClientGameStart(boost::shared_ptr<Game> game) { myW->signalNetClientGameStart(game); }
|
void GuiWrapper::SignalNetClientGameStart(boost::shared_ptr<Game> game) { myStartWindow->signalNetClientGameStart(game); }
|
||||||
void GuiWrapper::SignalNetClientWaitDialog() { myW->signalShowClientDialog(); }
|
void GuiWrapper::SignalNetClientWaitDialog() { myStartWindow->signalShowClientDialog(); }
|
||||||
void GuiWrapper::SignalNetClientChatMsg(const string &playerName, const string &msg) { myW->signalNetClientChatMsg(QString::fromUtf8(playerName.c_str()), QString::fromUtf8(msg.c_str())); }
|
void GuiWrapper::SignalNetClientChatMsg(const string &playerName, const string &msg) { myW->signalNetClientChatMsg(QString::fromUtf8(playerName.c_str()), QString::fromUtf8(msg.c_str())); }
|
||||||
void GuiWrapper::SignalNetServerSuccess(int /*actionID*/) { }
|
void GuiWrapper::SignalNetServerSuccess(int /*actionID*/) { }
|
||||||
void GuiWrapper::SignalNetServerError(int errorID, int osErrorID) { myW->signalNetServerError(errorID, osErrorID); }
|
void GuiWrapper::SignalNetServerError(int errorID, int osErrorID) { myW->signalNetServerError(errorID, osErrorID); }
|
||||||
|
|
||||||
void GuiWrapper::SignalIrcConnect(const string &server) { myW->signalIrcConnect(QString::fromUtf8(server.c_str())); }
|
void GuiWrapper::SignalIrcConnect(const string &server) { myStartWindow->signalIrcConnect(QString::fromUtf8(server.c_str())); }
|
||||||
void GuiWrapper::SignalIrcSelfJoined(const string &nickName, const string &channel) { myW->signalIrcSelfJoined(QString::fromUtf8(nickName.c_str()), QString::fromUtf8(channel.c_str())); }
|
void GuiWrapper::SignalIrcSelfJoined(const string &nickName, const string &channel) { myStartWindow->signalIrcSelfJoined(QString::fromUtf8(nickName.c_str()), QString::fromUtf8(channel.c_str())); }
|
||||||
void GuiWrapper::SignalIrcPlayerJoined(const string &nickName) { myW->signalIrcPlayerJoined(QString::fromUtf8(nickName.c_str())); }
|
void GuiWrapper::SignalIrcPlayerJoined(const string &nickName) { myStartWindow->signalIrcPlayerJoined(QString::fromUtf8(nickName.c_str())); }
|
||||||
void GuiWrapper::SignalIrcPlayerChanged(const string &oldNick, const string &newNick) { myW->signalIrcPlayerChanged(QString::fromUtf8(oldNick.c_str()), QString::fromUtf8(newNick.c_str())); }
|
void GuiWrapper::SignalIrcPlayerChanged(const string &oldNick, const string &newNick) { myStartWindow->signalIrcPlayerChanged(QString::fromUtf8(oldNick.c_str()), QString::fromUtf8(newNick.c_str())); }
|
||||||
void GuiWrapper::SignalIrcPlayerKicked(const std::string &nickName, const std::string &byWhom, const std::string &reason) { myW->signalIrcPlayerKicked(QString::fromUtf8(nickName.c_str()), QString::fromUtf8(byWhom.c_str()), QString::fromUtf8(reason.c_str())); }
|
void GuiWrapper::SignalIrcPlayerKicked(const std::string &nickName, const std::string &byWhom, const std::string &reason) { myStartWindow->signalIrcPlayerKicked(QString::fromUtf8(nickName.c_str()), QString::fromUtf8(byWhom.c_str()), QString::fromUtf8(reason.c_str())); }
|
||||||
void GuiWrapper::SignalIrcPlayerLeft(const std::string &nickName) { myW->signalIrcPlayerLeft(QString::fromUtf8(nickName.c_str())); }
|
void GuiWrapper::SignalIrcPlayerLeft(const std::string &nickName) { myStartWindow->signalIrcPlayerLeft(QString::fromUtf8(nickName.c_str())); }
|
||||||
void GuiWrapper::SignalIrcChatMsg(const std::string &nickName, const std::string &msg) { myW->signalIrcChatMessage(QString::fromUtf8(nickName.c_str()), QString::fromUtf8(msg.c_str())); }
|
void GuiWrapper::SignalIrcChatMsg(const std::string &nickName, const std::string &msg) { myStartWindow->signalIrcChatMessage(QString::fromUtf8(nickName.c_str()), QString::fromUtf8(msg.c_str())); }
|
||||||
void GuiWrapper::SignalIrcError(int errorCode) { myW->signalIrcError(errorCode); }
|
void GuiWrapper::SignalIrcError(int errorCode) { myStartWindow->signalIrcError(errorCode); }
|
||||||
void GuiWrapper::SignalIrcServerError(int errorCode) {myW->signalIrcServerError(errorCode); }
|
void GuiWrapper::SignalIrcServerError(int errorCode) {myStartWindow->signalIrcServerError(errorCode); }
|
||||||
|
|
||||||
|
////////// this is for startwindow ////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
//TEMPORARELY UNTIL STARTWINDOW REFACTORING IS OVER TODO
|
||||||
|
|
||||||
|
// void GuiWrapper::SignalNetClientConnect(int actionID) { myW->signalNetClientConnect(actionID); }
|
||||||
|
// void GuiWrapper::SignalNetClientGameInfo(int actionID) { myW->signalNetClientGameInfo(actionID); }
|
||||||
|
// void GuiWrapper::SignalNetClientError(int errorID, int osErrorID) { myW->signalNetClientError(errorID, osErrorID); }
|
||||||
|
// void GuiWrapper::SignalNetClientNotification(int notificationId) { myW->signalNetClientNotification(notificationId); }
|
||||||
|
// void GuiWrapper::SignalNetClientStatsUpdate(const ServerStats &stats) { myW->signalNetClientStatsUpdate(stats); }
|
||||||
|
// void GuiWrapper::SignalNetClientShowTimeoutDialog(NetTimeoutReason reason, unsigned remainingSec) { myW->signalNetClientShowTimeoutDialog(reason, remainingSec); }
|
||||||
|
// void GuiWrapper::SignalNetClientRemovedFromGame(int notificationId) { myW->signalNetClientRemovedFromGame(notificationId); }
|
||||||
|
// void GuiWrapper::SignalNetClientSelfJoined(unsigned playerId, const string &playerName, PlayerRights rights) { myW->signalNetClientSelfJoined(playerId, QString::fromUtf8(playerName.c_str()), rights); }
|
||||||
|
// void GuiWrapper::SignalNetClientPlayerJoined(unsigned playerId, const string &playerName, PlayerRights rights) { myW->signalNetClientPlayerJoined(playerId, QString::fromUtf8(playerName.c_str()), rights); }
|
||||||
|
// void GuiWrapper::SignalNetClientPlayerChanged(unsigned playerId, const string &newPlayerName)
|
||||||
|
// {
|
||||||
|
// myW->signalNetClientPlayerChanged(playerId, QString::fromUtf8(newPlayerName.c_str()));
|
||||||
|
// }
|
||||||
|
// void GuiWrapper::SignalNetClientPlayerLeft(unsigned playerId, const string &playerName)
|
||||||
|
// {
|
||||||
|
// QString tmpName(QString::fromUtf8(playerName.c_str()));
|
||||||
|
// myW->signalNetClientPlayerLeft(playerId, tmpName);
|
||||||
|
// if (!playerName.empty() && playerName[0] != '#')
|
||||||
|
// myLog->signalLogPlayerLeftMsg(tmpName);
|
||||||
|
// }
|
||||||
|
// void GuiWrapper::SignalNetClientNewGameAdmin(unsigned playerId, const string &playerName) {
|
||||||
|
//
|
||||||
|
// myW->signalNetClientNewGameAdmin(playerId, QString::fromUtf8(playerName.c_str()));
|
||||||
|
// if (!playerName.empty() && playerName[0] != '#')
|
||||||
|
// myLog->signalLogNewGameAdminMsg(QString::fromUtf8(playerName.c_str()));
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// void GuiWrapper::SignalNetClientGameListNew(unsigned gameId) { myW->signalNetClientGameListNew(gameId); }
|
||||||
|
// void GuiWrapper::SignalNetClientGameListRemove(unsigned gameId) { myW->signalNetClientGameListRemove(gameId); }
|
||||||
|
// void GuiWrapper::SignalNetClientGameListUpdateMode(unsigned gameId, GameMode mode) { myW->signalNetClientGameListUpdateMode(gameId, mode); }
|
||||||
|
// void GuiWrapper::SignalNetClientGameListUpdateAdmin(unsigned gameId, unsigned adminPlayerId) {myW->signalNetClientGameListUpdateAdmin(gameId, adminPlayerId); }
|
||||||
|
// void GuiWrapper::SignalNetClientGameListPlayerJoined(unsigned gameId, unsigned playerId) { myW->signalNetClientGameListPlayerJoined(gameId, playerId); }
|
||||||
|
// void GuiWrapper::SignalNetClientGameListPlayerLeft(unsigned gameId, unsigned playerId) { myW->signalNetClientGameListPlayerLeft(gameId, playerId); }
|
||||||
|
//
|
||||||
|
// void GuiWrapper::SignalNetClientGameStart(boost::shared_ptr<Game> game) { myW->signalNetClientGameStart(game); }
|
||||||
|
// void GuiWrapper::SignalNetClientWaitDialog() { myW->signalShowClientDialog(); }
|
||||||
|
// void GuiWrapper::SignalNetClientChatMsg(const string &playerName, const string &msg) { myW->signalNetClientChatMsg(QString::fromUtf8(playerName.c_str()), QString::fromUtf8(msg.c_str())); }
|
||||||
|
// void GuiWrapper::SignalNetServerSuccess(int /*actionID*/) { }
|
||||||
|
// void GuiWrapper::SignalNetServerError(int errorID, int osErrorID) { myW->signalNetServerError(errorID, osErrorID); }
|
||||||
|
//
|
||||||
|
// void GuiWrapper::SignalIrcConnect(const string &server) { myW->signalIrcConnect(QString::fromUtf8(server.c_str())); }
|
||||||
|
// void GuiWrapper::SignalIrcSelfJoined(const string &nickName, const string &channel) { myW->signalIrcSelfJoined(QString::fromUtf8(nickName.c_str()), QString::fromUtf8(channel.c_str())); }
|
||||||
|
// void GuiWrapper::SignalIrcPlayerJoined(const string &nickName) { myW->signalIrcPlayerJoined(QString::fromUtf8(nickName.c_str())); }
|
||||||
|
// void GuiWrapper::SignalIrcPlayerChanged(const string &oldNick, const string &newNick) { myW->signalIrcPlayerChanged(QString::fromUtf8(oldNick.c_str()), QString::fromUtf8(newNick.c_str())); }
|
||||||
|
// void GuiWrapper::SignalIrcPlayerKicked(const std::string &nickName, const std::string &byWhom, const std::string &reason) { myW->signalIrcPlayerKicked(QString::fromUtf8(nickName.c_str()), QString::fromUtf8(byWhom.c_str()), QString::fromUtf8(reason.c_str())); }
|
||||||
|
// void GuiWrapper::SignalIrcPlayerLeft(const std::string &nickName) { myW->signalIrcPlayerLeft(QString::fromUtf8(nickName.c_str())); }
|
||||||
|
// void GuiWrapper::SignalIrcChatMsg(const std::string &nickName, const std::string &msg) { myW->signalIrcChatMessage(QString::fromUtf8(nickName.c_str()), QString::fromUtf8(msg.c_str())); }
|
||||||
|
// void GuiWrapper::SignalIrcError(int errorCode) { myW->signalIrcError(errorCode); }
|
||||||
|
// void GuiWrapper::SignalIrcServerError(int errorCode) {myW->signalIrcServerError(errorCode); }
|
||||||
|
|
||||||
//TEMPORARELY UNTIL STARTWINDOW REFACTORING IS OVER TODO
|
//TEMPORARELY UNTIL STARTWINDOW REFACTORING IS OVER TODO
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
<property name="orientation" >
|
<property name="orientation" >
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="sizeHint" stdset="0" >
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>20</width>
|
||||||
<height>95</height>
|
<height>95</height>
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<property name="orientation" >
|
<property name="orientation" >
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="sizeHint" stdset="0" >
|
||||||
<size>
|
<size>
|
||||||
<width>63</width>
|
<width>63</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
@@ -50,14 +50,14 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" >
|
<item row="1" column="0" >
|
||||||
<widget class="QPushButton" name="pushButton_3" >
|
<widget class="QPushButton" name="pushButton_Create_Network_Game" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>&3 Create Network Game</string>
|
<string>&3 Create Network Game</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1" >
|
<item row="1" column="1" >
|
||||||
<widget class="QPushButton" name="pushButton_4" >
|
<widget class="QPushButton" name="pushButton_Join_Network_Game" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>&4 Join Network Game</string>
|
<string>&4 Join Network Game</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
<property name="orientation" >
|
<property name="orientation" >
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="sizeHint" stdset="0" >
|
||||||
<size>
|
<size>
|
||||||
<width>63</width>
|
<width>63</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
<property name="orientation" >
|
<property name="orientation" >
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="sizeHint" stdset="0" >
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>20</width>
|
||||||
<height>95</height>
|
<height>95</height>
|
||||||
|
|||||||
@@ -76,6 +76,12 @@ startWindowImpl::startWindowImpl(gameTableImpl *w, ConfigFile *c)
|
|||||||
connect( actionStart_Local_Game, SIGNAL( triggered() ), this, SLOT( callNewGameDialog() ) );
|
connect( actionStart_Local_Game, SIGNAL( triggered() ), this, SLOT( callNewGameDialog() ) );
|
||||||
connect( pushButtonStart_Local_Game, SIGNAL( clicked() ), this, SLOT( callNewGameDialog() ) );
|
connect( pushButtonStart_Local_Game, SIGNAL( clicked() ), this, SLOT( callNewGameDialog() ) );
|
||||||
connect( actionInternet_Game, SIGNAL( triggered() ), this, SLOT( callGameLobbyDialog() ) );
|
connect( actionInternet_Game, SIGNAL( triggered() ), this, SLOT( callGameLobbyDialog() ) );
|
||||||
|
connect( pushButtonInternet_Game, SIGNAL( clicked() ), this, SLOT( callGameLobbyDialog() ) );
|
||||||
|
connect( actionCreate_Network_Game, SIGNAL( triggered() ), this, SLOT( callCreateNetworkGameDialog() ) );
|
||||||
|
connect( pushButton_Create_Network_Game, SIGNAL( clicked() ), this, SLOT( callCreateNetworkGameDialog() ) );
|
||||||
|
connect( actionJoin_Network_Game, SIGNAL( triggered() ), this, SLOT( callJoinNetworkGameDialog() ) );
|
||||||
|
connect( pushButton_Join_Network_Game, SIGNAL( clicked() ), this, SLOT( callJoinNetworkGameDialog() ) );
|
||||||
|
|
||||||
|
|
||||||
connect(this, SIGNAL(signalShowClientDialog()), this, SLOT(showClientDialog()));
|
connect(this, SIGNAL(signalShowClientDialog()), this, SLOT(showClientDialog()));
|
||||||
|
|
||||||
@@ -207,6 +213,131 @@ void startWindowImpl::joinGameLobby() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void startWindowImpl::callCreateNetworkGameDialog() {
|
||||||
|
|
||||||
|
myCreateNetworkGameDialog->exec();
|
||||||
|
//
|
||||||
|
if (myCreateNetworkGameDialog->result() == QDialog::Accepted ) {
|
||||||
|
|
||||||
|
// Stop local game.
|
||||||
|
myW->stopTimer();
|
||||||
|
|
||||||
|
if (!myServerGuiInterface.get())
|
||||||
|
{
|
||||||
|
// Create pseudo Gui Wrapper for the server.
|
||||||
|
myServerGuiInterface.reset(new ServerGuiWrapper(myConfig, mySession->getGui(), mySession->getGui(), mySession->getGui()));
|
||||||
|
{
|
||||||
|
boost::shared_ptr<Session> session(new Session(myServerGuiInterface.get(), myConfig));
|
||||||
|
session->init(mySession->getAvatarManager());
|
||||||
|
myServerGuiInterface->setSession(session);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Terminate existing network games.
|
||||||
|
mySession->terminateNetworkClient();
|
||||||
|
myServerGuiInterface->getSession().terminateNetworkServer();
|
||||||
|
|
||||||
|
GameData gameData;
|
||||||
|
gameData.maxNumberOfPlayers = myCreateNetworkGameDialog->spinBox_quantityPlayers->value();
|
||||||
|
gameData.startMoney = myCreateNetworkGameDialog->spinBox_startCash->value();
|
||||||
|
gameData.firstSmallBlind = myCreateNetworkGameDialog->getChangeCompleteBlindsDialog()->spinBox_firstSmallBlind->value();
|
||||||
|
|
||||||
|
if(myCreateNetworkGameDialog->getChangeCompleteBlindsDialog()->radioButton_raiseBlindsAtHands->isChecked()) {
|
||||||
|
gameData.raiseIntervalMode = RAISE_ON_HANDNUMBER;
|
||||||
|
gameData.raiseSmallBlindEveryHandsValue = myCreateNetworkGameDialog->getChangeCompleteBlindsDialog()->spinBox_raiseSmallBlindEveryHands->value();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gameData.raiseIntervalMode = RAISE_ON_MINUTES;
|
||||||
|
gameData.raiseSmallBlindEveryMinutesValue = myCreateNetworkGameDialog->getChangeCompleteBlindsDialog()->spinBox_raiseSmallBlindEveryMinutes->value();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(myCreateNetworkGameDialog->getChangeCompleteBlindsDialog()->radioButton_alwaysDoubleBlinds->isChecked()) {
|
||||||
|
gameData.raiseMode = DOUBLE_BLINDS;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gameData.raiseMode = MANUAL_BLINDS_ORDER;
|
||||||
|
std::list<int> tempBlindList;
|
||||||
|
int i;
|
||||||
|
bool ok = TRUE;
|
||||||
|
for(i=0; i<myCreateNetworkGameDialog->getChangeCompleteBlindsDialog()->listWidget_blinds->count(); i++) {
|
||||||
|
tempBlindList.push_back(myCreateNetworkGameDialog->getChangeCompleteBlindsDialog()->listWidget_blinds->item(i)->text().toInt(&ok,10));
|
||||||
|
}
|
||||||
|
gameData.manualBlindsList = tempBlindList;
|
||||||
|
|
||||||
|
if(myCreateNetworkGameDialog->getChangeCompleteBlindsDialog()->radioButton_afterThisAlwaysDoubleBlinds->isChecked()) { gameData.afterManualBlindsMode = AFTERMB_DOUBLE_BLINDS; }
|
||||||
|
else {
|
||||||
|
if(myCreateNetworkGameDialog->getChangeCompleteBlindsDialog()->radioButton_afterThisAlwaysRaiseAbout->isChecked()) {
|
||||||
|
gameData.afterManualBlindsMode = AFTERMB_RAISE_ABOUT;
|
||||||
|
gameData.afterMBAlwaysRaiseValue = myCreateNetworkGameDialog->getChangeCompleteBlindsDialog()->spinBox_afterThisAlwaysRaiseValue->value();
|
||||||
|
}
|
||||||
|
else { gameData.afterManualBlindsMode = AFTERMB_STAY_AT_LAST_BLIND; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gameData.guiSpeed = myCreateNetworkGameDialog->spinBox_gameSpeed->value();
|
||||||
|
gameData.playerActionTimeoutSec = myCreateNetworkGameDialog->spinBox_netTimeOutPlayerAction->value();
|
||||||
|
|
||||||
|
myGameLobbyDialog->setSession(&getSession());
|
||||||
|
myStartNetworkGameDialog->setSession(&getSession());
|
||||||
|
|
||||||
|
// Clear network game dialog.
|
||||||
|
myStartNetworkGameDialog->clearDialog();
|
||||||
|
|
||||||
|
myServerGuiInterface->getSession().startNetworkServer();
|
||||||
|
mySession->startNetworkClientForLocalServer(gameData);
|
||||||
|
|
||||||
|
myStartNetworkGameDialog->setMaxPlayerNumber(gameData.maxNumberOfPlayers);
|
||||||
|
|
||||||
|
myStartNetworkGameDialog->setWindowTitle("Start Network Game");
|
||||||
|
|
||||||
|
showNetworkStartDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void startWindowImpl::callJoinNetworkGameDialog() {
|
||||||
|
|
||||||
|
myJoinNetworkGameDialog->exec();
|
||||||
|
|
||||||
|
if (myJoinNetworkGameDialog->result() == QDialog::Accepted ) {
|
||||||
|
|
||||||
|
// Stop local game.
|
||||||
|
myW->stopTimer();
|
||||||
|
|
||||||
|
mySession->terminateNetworkClient();
|
||||||
|
if (myServerGuiInterface.get())
|
||||||
|
myServerGuiInterface->getSession().terminateNetworkServer();
|
||||||
|
|
||||||
|
myGameLobbyDialog->setSession(&getSession());
|
||||||
|
myStartNetworkGameDialog->setSession(&getSession());
|
||||||
|
// Clear network game dialog
|
||||||
|
myStartNetworkGameDialog->clearDialog();
|
||||||
|
// Maybe use QUrl::toPunycode.
|
||||||
|
mySession->startNetworkClient(
|
||||||
|
myJoinNetworkGameDialog->lineEdit_ipAddress->text().toUtf8().constData(),
|
||||||
|
myJoinNetworkGameDialog->spinBox_port->value(),
|
||||||
|
myJoinNetworkGameDialog->checkBox_ipv6->isChecked(),
|
||||||
|
myJoinNetworkGameDialog->checkBox_sctp->isChecked(),
|
||||||
|
myJoinNetworkGameDialog->lineEdit_password->text().toUtf8().constData());
|
||||||
|
|
||||||
|
//Dialog mit Statusbalken
|
||||||
|
myConnectToServerDialog->exec();
|
||||||
|
|
||||||
|
if (myConnectToServerDialog->result() == QDialog::Rejected ) {
|
||||||
|
mySession->terminateNetworkClient();
|
||||||
|
actionJoin_Network_Game->trigger(); // re-trigger
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//needed for join and ready sounds - TODO
|
||||||
|
//myStartNetworkGameDialog->setMaxPlayerNumber(gameData.maxNumberOfPlayers);
|
||||||
|
myStartNetworkGameDialog->setWindowTitle("Start Network Game");
|
||||||
|
|
||||||
|
showNetworkStartDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void startWindowImpl::showClientDialog()
|
void startWindowImpl::showClientDialog()
|
||||||
{
|
{
|
||||||
if (mySession->getGameType() == Session::GAME_TYPE_NETWORK)
|
if (mySession->getGameType() == Session::GAME_TYPE_NETWORK)
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ signals:
|
|||||||
public slots:
|
public slots:
|
||||||
void callNewGameDialog();
|
void callNewGameDialog();
|
||||||
void callGameLobbyDialog();
|
void callGameLobbyDialog();
|
||||||
|
void callCreateNetworkGameDialog();
|
||||||
|
void callJoinNetworkGameDialog();
|
||||||
void showLobbyDialog();
|
void showLobbyDialog();
|
||||||
void joinGameLobby();
|
void joinGameLobby();
|
||||||
void showClientDialog();
|
void showClientDialog();
|
||||||
|
|||||||
Reference in new issue
Block a user