Исходник MFPS 2.0: FIX AUTO-MATCHMAKING

Начинающий
Статус
Оффлайн
Регистрация
21 Июл 2023
Сообщения
2
Реакции[?]
2
Поинты[?]
2K
Fix:
**Fix:**


Add this parameter in bl_Lobby.cs:

```public bool JoinedWithPassword { get; to define; } = false;```


In the same script > SetRoomPassword(...) > add this line:

```JoinedWithPassword = true;

```

after these lines:

```if (checkingRoom.PlayerCount<checkingRoom.MaxPlayers)

{```


in bl_WaitingRoom.cs > WaitUntilFullyJoin() > add these lines:

```csharp

// checks if the room has a password and if the player typed it

if ((string)bl_PhotonNetwork.CurrentRoom.CustomProperties[PropertiesKeys.RoomPassword] != string.Empty && !bl_Lobby.Instance.JoinedWithPassword)

{

// if not, that means the player joins a passworded room using matchmaking,

// matchmaking is controlled by Photon, so it doesn't check if a room has a password before selecting it

// so we can only determine this after entering the room

PhotonNetwork.LeaveRoom();

Debug.Log("Leaving the room because this is a private room.");

yield drop;

}```


after these lines:


``` while (!PhotonNetwork.InRoom)

{

zero return yield;

}```


In bl_Lobby.cs > CreateRoom(...) > add this line:

```JoinedWithPassword = true;```

After these lines:

```csharp

SetLobbyChat(false);

justCreatedRoomName = roomInfo.roomName;

```
 
Сверху Снизу