Skip to content

Commit 2a833a7

Browse files
fix: populate lobby room name if creation room input field is empty (#522)
1 parent f126cbc commit 2a833a7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Assets/BossRoom/Scripts/Client/UI/Lobby/LobbyUIMediator.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public class LobbyUIMediator : MonoBehaviour
2828
GameNetPortal m_GameNetPortal;
2929
ClientGameNetPortal m_ClientNetPortal;
3030

31+
const string k_DefaultLobbyName = "no-name";
32+
3133
[Inject]
3234
void InjectDependenciesAndInitialize(
3335
LobbyServiceFacade lobbyServiceFacade,
@@ -62,6 +64,12 @@ void OnDestroy()
6264

6365
public void CreateLobbyRequest(string lobbyName, bool isPrivate, int maxPlayers, OnlineMode onlineMode)
6466
{
67+
// before sending request to lobby service, populate an empty lobby name, if necessary
68+
if (string.IsNullOrEmpty(lobbyName))
69+
{
70+
lobbyName = k_DefaultLobbyName;
71+
}
72+
6573
m_LobbyServiceFacade.CreateLobbyAsync(lobbyName, maxPlayers, isPrivate, onlineMode, OnCreatedLobby, OnFailedLobbyCreateOrJoin);
6674
BlockUIWhileLoadingIsInProgress();
6775
}

0 commit comments

Comments
 (0)