extra callback for showing internet game login dialog
This commit is contained in:
@@ -296,9 +296,13 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly)
|
|||||||
if ( confAppDataPath ) {
|
if ( confAppDataPath ) {
|
||||||
const char *tmpStr = confAppDataPath->Attribute("value");
|
const char *tmpStr = confAppDataPath->Attribute("value");
|
||||||
if (tmpStr) tempAppDataPath = tmpStr;
|
if (tmpStr) tempAppDataPath = tmpStr;
|
||||||
|
//if appdatapath changes directly update it here not in UpdateConfig()
|
||||||
|
if(tempAppDataPath != myQtToolsInterface->getDataPathStdString(myArgv0)) {
|
||||||
|
confAppDataPath->SetAttribute("value", myQtToolsInterface->stringToUtf8(myQtToolsInterface->getDataPathStdString(myArgv0)));
|
||||||
|
doc.SaveFile( configFileName );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (tempRevision < configRev || tempAppDataPath != myQtToolsInterface->getDataPathStdString(myArgv0) ) { /*löschen()*/
|
if (tempRevision < configRev) {
|
||||||
myConfigState = OLD;
|
myConfigState = OLD;
|
||||||
updateConfig(myConfigState) ;
|
updateConfig(myConfigState) ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ void GuiWrapper::flushLogAtHand() { myLog->signalFlushLogAtHand(); }
|
|||||||
void GuiWrapper::SignalNetClientConnect(int actionID) { myStartWindow->signalNetClientConnect(actionID); }
|
void GuiWrapper::SignalNetClientConnect(int actionID) { myStartWindow->signalNetClientConnect(actionID); }
|
||||||
void GuiWrapper::SignalNetClientServerListAdd(unsigned serverId) { myStartWindow->signalNetClientServerListAdd(serverId); }
|
void GuiWrapper::SignalNetClientServerListAdd(unsigned serverId) { myStartWindow->signalNetClientServerListAdd(serverId); }
|
||||||
void GuiWrapper::SignalNetClientServerListShow() { myStartWindow->signalNetClientServerListShow(); }
|
void GuiWrapper::SignalNetClientServerListShow() { myStartWindow->signalNetClientServerListShow(); }
|
||||||
|
void GuiWrapper::SignalNetClientLoginShow() { myStartWindow->signalNetClientLoginShow(); }
|
||||||
void GuiWrapper::SignalNetClientServerListClear() { myStartWindow->signalNetClientServerListClear(); }
|
void GuiWrapper::SignalNetClientServerListClear() { myStartWindow->signalNetClientServerListClear(); }
|
||||||
void GuiWrapper::SignalNetClientGameInfo(int actionID) { myStartWindow->signalNetClientGameInfo(actionID); }
|
void GuiWrapper::SignalNetClientGameInfo(int actionID) { myStartWindow->signalNetClientGameInfo(actionID); }
|
||||||
void GuiWrapper::SignalNetClientError(int errorID, int osErrorID) { myStartWindow->signalNetClientError(errorID, osErrorID); }
|
void GuiWrapper::SignalNetClientError(int errorID, int osErrorID) { myStartWindow->signalNetClientError(errorID, osErrorID); }
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ public:
|
|||||||
void SignalNetClientServerListAdd(unsigned serverId);
|
void SignalNetClientServerListAdd(unsigned serverId);
|
||||||
void SignalNetClientServerListShow();
|
void SignalNetClientServerListShow();
|
||||||
void SignalNetClientServerListClear();
|
void SignalNetClientServerListClear();
|
||||||
|
void SignalNetClientLoginShow();
|
||||||
void SignalNetClientGameInfo(int actionID);
|
void SignalNetClientGameInfo(int actionID);
|
||||||
void SignalNetClientError(int errorID, int osErrorID);
|
void SignalNetClientError(int errorID, int osErrorID);
|
||||||
void SignalNetClientNotification(int notificationId);
|
void SignalNetClientNotification(int notificationId);
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ startWindowImpl::startWindowImpl(ConfigFile *c)
|
|||||||
// myGuiInterface->setSession(session);
|
// myGuiInterface->setSession(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// #ifdef __APPLE__
|
// #ifdef __APPLE__
|
||||||
// setWindowModality(Qt::ApplicationModal);
|
// setWindowModality(Qt::ApplicationModal);
|
||||||
// setWindowFlags(Qt::WindowSystemMenuHint | Qt::CustomizeWindowHint | Qt::Dialog);
|
// setWindowFlags(Qt::WindowSystemMenuHint | Qt::CustomizeWindowHint | Qt::Dialog);
|
||||||
@@ -120,6 +119,8 @@ startWindowImpl::startWindowImpl(ConfigFile *c)
|
|||||||
connect(this, SIGNAL(signalNetClientServerListClear()), myServerListDialog, SLOT(clearList()));
|
connect(this, SIGNAL(signalNetClientServerListClear()), myServerListDialog, SLOT(clearList()));
|
||||||
connect(this, SIGNAL(signalNetClientServerListAdd(unsigned)), myServerListDialog, SLOT(addServerItem(unsigned)));
|
connect(this, SIGNAL(signalNetClientServerListAdd(unsigned)), myServerListDialog, SLOT(addServerItem(unsigned)));
|
||||||
|
|
||||||
|
connect(this, SIGNAL(signalNetClientLoginShow()), this, SLOT(callInternetGameLoginDialog()));
|
||||||
|
|
||||||
connect(this, SIGNAL(signalNetClientSelfJoined(unsigned, QString, int)), myStartNetworkGameDialog, SLOT(joinedNetworkGame(unsigned, QString, int)));
|
connect(this, SIGNAL(signalNetClientSelfJoined(unsigned, QString, int)), myStartNetworkGameDialog, SLOT(joinedNetworkGame(unsigned, QString, int)));
|
||||||
connect(this, SIGNAL(signalNetClientPlayerJoined(unsigned, QString, int)), myStartNetworkGameDialog, SLOT(addConnectedPlayer(unsigned, QString, int)));
|
connect(this, SIGNAL(signalNetClientPlayerJoined(unsigned, QString, int)), myStartNetworkGameDialog, SLOT(addConnectedPlayer(unsigned, QString, int)));
|
||||||
connect(this, SIGNAL(signalNetClientPlayerChanged(unsigned, QString)), myStartNetworkGameDialog, SLOT(updatePlayer(unsigned, QString)));
|
connect(this, SIGNAL(signalNetClientPlayerChanged(unsigned, QString)), myStartNetworkGameDialog, SLOT(updatePlayer(unsigned, QString)));
|
||||||
@@ -312,11 +313,8 @@ void startWindowImpl::joinGameLobby() {
|
|||||||
// Clear Lobby dialog.
|
// Clear Lobby dialog.
|
||||||
myGameLobbyDialog->clearDialog();
|
myGameLobbyDialog->clearDialog();
|
||||||
|
|
||||||
//login
|
//start internet client with config values for user and pw TODO
|
||||||
myInternetGameLoginDialog->exec();
|
mySession->startInternetClient();
|
||||||
if(myInternetGameLoginDialog->result() == QDialog::Accepted) {
|
|
||||||
//send login infos
|
|
||||||
mySession->startInternetClient(std::string(myInternetGameLoginDialog->lineEdit_username->text().toUtf8().constData()), std::string(myInternetGameLoginDialog->lineEdit_password->text().toUtf8().constData()));
|
|
||||||
|
|
||||||
//Dialog mit Statusbalken
|
//Dialog mit Statusbalken
|
||||||
myConnectToServerDialog->exec();
|
myConnectToServerDialog->exec();
|
||||||
@@ -327,6 +325,20 @@ void startWindowImpl::joinGameLobby() {
|
|||||||
mySession->terminateNetworkClient();
|
mySession->terminateNetworkClient();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void startWindowImpl::callInternetGameLoginDialog() {
|
||||||
|
|
||||||
|
//login
|
||||||
|
myInternetGameLoginDialog->exec();
|
||||||
|
if(myInternetGameLoginDialog->result() == QDialog::Accepted) {
|
||||||
|
//send login infos
|
||||||
|
// mySession->
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
myConnectToServerDialog->reject();
|
||||||
|
mySession->terminateNetworkClient();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void startWindowImpl::callCreateNetworkGameDialog() {
|
void startWindowImpl::callCreateNetworkGameDialog() {
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ signals:
|
|||||||
void signalNetClientServerListShow();
|
void signalNetClientServerListShow();
|
||||||
void signalNetClientServerListClear();
|
void signalNetClientServerListClear();
|
||||||
void signalNetClientServerListAdd(unsigned serverId);
|
void signalNetClientServerListAdd(unsigned serverId);
|
||||||
|
void signalNetClientLoginShow();
|
||||||
void signalNetClientGameInfo(int actionID);
|
void signalNetClientGameInfo(int actionID);
|
||||||
void signalNetClientError(int errorID, int osErrorID);
|
void signalNetClientError(int errorID, int osErrorID);
|
||||||
void signalNetClientNotification(int notificationId);
|
void signalNetClientNotification(int notificationId);
|
||||||
@@ -110,6 +111,7 @@ public slots:
|
|||||||
void callCreateNetworkGameDialog();
|
void callCreateNetworkGameDialog();
|
||||||
void callJoinNetworkGameDialog();
|
void callJoinNetworkGameDialog();
|
||||||
void showLobbyDialog();
|
void showLobbyDialog();
|
||||||
|
void callInternetGameLoginDialog();
|
||||||
void joinGameLobby();
|
void joinGameLobby();
|
||||||
void showClientDialog();
|
void showClientDialog();
|
||||||
void showNetworkStartDialog();
|
void showNetworkStartDialog();
|
||||||
|
|||||||
+3
-3
@@ -154,7 +154,7 @@ boost::shared_ptr<AvatarManager> Session::getAvatarManager()
|
|||||||
return myAvatarManager;
|
return myAvatarManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::startInternetClient(const std::string &username, const std::string &password)
|
void Session::startInternetClient()
|
||||||
{
|
{
|
||||||
if (myNetClient || !myGui)
|
if (myNetClient || !myGui)
|
||||||
{
|
{
|
||||||
@@ -178,8 +178,8 @@ void Session::startInternetClient(const std::string &username, const std::string
|
|||||||
myConfig->readConfigInt("InternetServerUseIpv6") == 1,
|
myConfig->readConfigInt("InternetServerUseIpv6") == 1,
|
||||||
myConfig->readConfigInt("InternetServerUseSctp") == 1,
|
myConfig->readConfigInt("InternetServerUseSctp") == 1,
|
||||||
useAvatarServer ? myConfig->readConfigString("AvatarServerAddress") : "",
|
useAvatarServer ? myConfig->readConfigString("AvatarServerAddress") : "",
|
||||||
username,
|
myConfig->readConfigString("MyName"),
|
||||||
password,
|
"testpw",
|
||||||
myConfig->readConfigString("MyAvatar"),
|
myConfig->readConfigString("MyAvatar"),
|
||||||
myQtToolsInterface->stringFromUtf8(myConfig->readConfigString("CacheDir")));
|
myQtToolsInterface->stringFromUtf8(myConfig->readConfigString("CacheDir")));
|
||||||
myNetClient->Run();
|
myNetClient->Run();
|
||||||
|
|||||||
+1
-1
@@ -62,7 +62,7 @@ public:
|
|||||||
|
|
||||||
boost::shared_ptr<AvatarManager> getAvatarManager();
|
boost::shared_ptr<AvatarManager> getAvatarManager();
|
||||||
|
|
||||||
void startInternetClient(const std::string &username, const std::string &password);
|
void startInternetClient();
|
||||||
void startNetworkClient(const std::string &serverAddress, unsigned serverPort, bool ipv6, bool sctp, const std::string &pwd);
|
void startNetworkClient(const std::string &serverAddress, unsigned serverPort, bool ipv6, bool sctp, const std::string &pwd);
|
||||||
void startNetworkClientForLocalServer(const GameData &gameData);
|
void startNetworkClientForLocalServer(const GameData &gameData);
|
||||||
void terminateNetworkClient();
|
void terminateNetworkClient();
|
||||||
|
|||||||
Reference in New Issue
Block a user