- avoid double joining a game in progress
This commit is contained in:
parent
b6cefa3388
commit
c6e3fd1156
|
@ -1871,23 +1871,24 @@ void MenuStateConnectedGame::PlayNow(bool saveGame) {
|
||||||
|
|
||||||
//printf("Tell server we want to join!\n");
|
//printf("Tell server we want to join!\n");
|
||||||
|
|
||||||
//if(readyToJoinInProgressGame == true) {
|
|
||||||
if(clientInterface->getJoinGameInProgress() == true) {
|
if(clientInterface->getJoinGameInProgress() == true) {
|
||||||
Lang &lang= Lang::getInstance();
|
if(readyToJoinInProgressGame == false) {
|
||||||
const vector<string> languageList = clientInterface->getGameSettings()->getUniqueNetworkPlayerLanguages();
|
Lang &lang= Lang::getInstance();
|
||||||
for(unsigned int i = 0; i < languageList.size(); ++i) {
|
const vector<string> languageList = clientInterface->getGameSettings()->getUniqueNetworkPlayerLanguages();
|
||||||
char szMsg[8096]="";
|
for(unsigned int i = 0; i < languageList.size(); ++i) {
|
||||||
if(lang.hasString("JoinPlayerToCurrentGameLaunch",languageList[i]) == true) {
|
char szMsg[8096]="";
|
||||||
snprintf(szMsg,8096,lang.get("JoinPlayerToCurrentGameLaunch",languageList[i]).c_str(),getHumanPlayerName().c_str());
|
if(lang.hasString("JoinPlayerToCurrentGameLaunch",languageList[i]) == true) {
|
||||||
|
snprintf(szMsg,8096,lang.get("JoinPlayerToCurrentGameLaunch",languageList[i]).c_str(),getHumanPlayerName().c_str());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
snprintf(szMsg,8096,"Player: %s is about to join the game, please wait...",getHumanPlayerName().c_str());
|
||||||
|
}
|
||||||
|
bool localEcho = lang.isLanguageLocal(languageList[i]);
|
||||||
|
clientInterface->sendTextMessage(szMsg,-1, localEcho,languageList[i]);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
snprintf(szMsg,8096,"Player: %s is about to join the game, please wait...",getHumanPlayerName().c_str());
|
|
||||||
}
|
|
||||||
bool localEcho = lang.isLanguageLocal(languageList[i]);
|
|
||||||
clientInterface->sendTextMessage(szMsg,-1, localEcho,languageList[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
clientInterface->broadcastGameStart(&gameSettings);
|
clientInterface->broadcastGameStart(&gameSettings);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user