فهرست منبع

Use account name from lobby when joining lobby game rooms

Ivan Savenko 1 سال پیش
والد
کامیت
30a3081ab4
2فایلهای تغییر یافته به همراه5 افزوده شده و 3 حذف شده
  1. 1 1
      client/globalLobby/GlobalLobbyClient.cpp
  2. 4 2
      client/globalLobby/GlobalLobbyServerSetup.cpp

+ 1 - 1
client/globalLobby/GlobalLobbyClient.cpp

@@ -279,7 +279,7 @@ void GlobalLobbyClient::receiveJoinRoomSuccess(const JsonNode & json)
 {
 	if (json["proxyMode"].Bool())
 	{
-		CSH->resetStateForLobby(EStartMode::NEW_GAME, ESelectionScreen::newGame, EServerMode::LOBBY_GUEST, {});
+		CSH->resetStateForLobby(EStartMode::NEW_GAME, ESelectionScreen::newGame, EServerMode::LOBBY_GUEST, { CSH->getGlobalLobby().getAccountDisplayName() });
 		CSH->loadMode = ELoadMode::MULTI;
 
 		std::string hostname = getServerHost();

+ 4 - 2
client/globalLobby/GlobalLobbyServerSetup.cpp

@@ -11,6 +11,8 @@
 #include "StdInc.h"
 #include "GlobalLobbyServerSetup.h"
 
+#include "GlobalLobbyClient.h"
+
 #include "../CGameInfo.h"
 #include "../CServerHandler.h"
 #include "../gui/CGuiHandler.h"
@@ -125,9 +127,9 @@ void GlobalLobbyServerSetup::onGameModeChanged(int value)
 void GlobalLobbyServerSetup::onCreate()
 {
 	if(toggleGameMode->getSelected() == 0)
-		CSH->resetStateForLobby(EStartMode::NEW_GAME, ESelectionScreen::newGame, EServerMode::LOBBY_HOST, {});
+		CSH->resetStateForLobby(EStartMode::NEW_GAME, ESelectionScreen::newGame, EServerMode::LOBBY_HOST, { CSH->getGlobalLobby().getAccountDisplayName() });
 	else
-		CSH->resetStateForLobby(EStartMode::LOAD_GAME, ESelectionScreen::loadGame, EServerMode::LOBBY_HOST, {});
+		CSH->resetStateForLobby(EStartMode::LOAD_GAME, ESelectionScreen::loadGame, EServerMode::LOBBY_HOST, { CSH->getGlobalLobby().getAccountDisplayName() });
 
 	CSH->loadMode = ELoadMode::MULTI;
 	CSH->startLocalServerAndConnect(true);