- fixed loss of username sometimes when changing slots in network game lobby
This commit is contained in:
parent
13962863b2
commit
bdb4db9756
|
@ -594,9 +594,14 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){
|
||||||
ClientInterface* clientInterface= NetworkManager::getInstance().getClientInterface();
|
ClientInterface* clientInterface= NetworkManager::getInstance().getClientInterface();
|
||||||
if(clientInterface->isConnected()){
|
if(clientInterface->isConnected()){
|
||||||
clientInterface->setGameSettingsReceived(false);
|
clientInterface->setGameSettingsReceived(false);
|
||||||
clientInterface->sendSwitchSetupRequest(listBoxFactions[i].getSelectedItem(), i, -1,
|
clientInterface->sendSwitchSetupRequest(
|
||||||
listBoxTeams[i].getSelectedItemIndex(), getHumanPlayerName(),
|
listBoxFactions[i].getSelectedItem(),
|
||||||
getNetworkPlayerStatus(), switchSetupRequestFlagType);
|
i,
|
||||||
|
-1,
|
||||||
|
listBoxTeams[i].getSelectedItemIndex(),
|
||||||
|
getHumanPlayerName(),
|
||||||
|
getNetworkPlayerStatus(),
|
||||||
|
switchSetupRequestFlagType);
|
||||||
switchSetupRequestFlagType= ssrft_None;
|
switchSetupRequestFlagType= ssrft_None;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -607,9 +612,14 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){
|
||||||
soundRenderer.playFx(coreData.getClickSoundA());
|
soundRenderer.playFx(coreData.getClickSoundA());
|
||||||
if(clientInterface->isConnected()){
|
if(clientInterface->isConnected()){
|
||||||
clientInterface->setGameSettingsReceived(false);
|
clientInterface->setGameSettingsReceived(false);
|
||||||
clientInterface->sendSwitchSetupRequest(listBoxFactions[i].getSelectedItem(), i, -1,
|
clientInterface->sendSwitchSetupRequest(
|
||||||
listBoxTeams[i].getSelectedItemIndex(), getHumanPlayerName(),
|
listBoxFactions[i].getSelectedItem(),
|
||||||
getNetworkPlayerStatus(), switchSetupRequestFlagType);
|
i,
|
||||||
|
-1,
|
||||||
|
listBoxTeams[i].getSelectedItemIndex(),
|
||||||
|
getHumanPlayerName(),
|
||||||
|
getNetworkPlayerStatus(),
|
||||||
|
switchSetupRequestFlagType);
|
||||||
switchSetupRequestFlagType= ssrft_None;
|
switchSetupRequestFlagType= ssrft_None;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -624,9 +634,14 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d] sending a switchSlot request from %d to %d\n",__FILE__,__FUNCTION__,__LINE__,clientInterface->getGameSettings()->getThisFactionIndex(),i);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d] sending a switchSlot request from %d to %d\n",__FILE__,__FUNCTION__,__LINE__,clientInterface->getGameSettings()->getThisFactionIndex(),i);
|
||||||
|
|
||||||
clientInterface->sendSwitchSetupRequest(listBoxFactions[myCurrentIndex].getSelectedItem(),
|
clientInterface->sendSwitchSetupRequest(
|
||||||
myCurrentIndex, i, listBoxTeams[myCurrentIndex].getSelectedItemIndex(),
|
listBoxFactions[myCurrentIndex].getSelectedItem(),
|
||||||
labelPlayerNames[myCurrentIndex].getText(), getNetworkPlayerStatus(),
|
myCurrentIndex,
|
||||||
|
i,
|
||||||
|
listBoxTeams[myCurrentIndex].getSelectedItemIndex(),
|
||||||
|
//labelPlayerNames[myCurrentIndex].getText(),
|
||||||
|
getHumanPlayerName(),
|
||||||
|
getNetworkPlayerStatus(),
|
||||||
switchSetupRequestFlagType);
|
switchSetupRequestFlagType);
|
||||||
labelPlayerNames[myCurrentIndex].setText("");
|
labelPlayerNames[myCurrentIndex].setText("");
|
||||||
labelPlayerNames[i].setText("");
|
labelPlayerNames[i].setText("");
|
||||||
|
@ -1591,8 +1606,11 @@ void MenuStateConnectedGame::update() {
|
||||||
clientInterface->getIntroDone() == true &&
|
clientInterface->getIntroDone() == true &&
|
||||||
(switchSetupRequestFlagType & ssrft_NetworkPlayerName) == ssrft_NetworkPlayerName) {
|
(switchSetupRequestFlagType & ssrft_NetworkPlayerName) == ssrft_NetworkPlayerName) {
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] getHumanPlayerName() = [%s], clientInterface->getGameSettings()->getThisFactionIndex() = %d\n",__FILE__,__FUNCTION__,__LINE__,getHumanPlayerName().c_str(),clientInterface->getGameSettings()->getThisFactionIndex());
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] getHumanPlayerName() = [%s], clientInterface->getGameSettings()->getThisFactionIndex() = %d\n",__FILE__,__FUNCTION__,__LINE__,getHumanPlayerName().c_str(),clientInterface->getGameSettings()->getThisFactionIndex());
|
||||||
clientInterface->sendSwitchSetupRequest("",
|
clientInterface->sendSwitchSetupRequest(
|
||||||
clientInterface->getPlayerIndex(),-1,-1,
|
"",
|
||||||
|
clientInterface->getPlayerIndex(),
|
||||||
|
-1,
|
||||||
|
-1,
|
||||||
getHumanPlayerName(),
|
getHumanPlayerName(),
|
||||||
getNetworkPlayerStatus(),
|
getNetworkPlayerStatus(),
|
||||||
switchSetupRequestFlagType);
|
switchSetupRequestFlagType);
|
||||||
|
|
Loading…
Reference in New Issue