Roomlist not update correctly...

Hello community, good evening, I am from Argentina.
I'm having problems with room pairing, it doesn't update properly ...

it works this way.

I enter the game, I press a button to connect using: "ConnectUsingSettings ()", I wait for it to connect to pass the OnJoined () filter.

When I want to update the lists of the rooms created, they very rarely appear.

Yes, there are active rooms, because there are more than 35 people creating rooms at the same time to carry out the testing, we are all from Argentina ...

the rooms are created, but cannot be seen.
Very rarely do we manage to see a room, and when we all join together, users cannot see others. some of us see each other, others do not see each other even when we are in the room watching us.

I understand that this may be due to the region, we would like to use "sa" because we are from South America.

To configure it, should you do it from the photon configuration in the "fixed region" tab?

the code I use is the following:

public void Start()
{
Instance = this;
}

public void conectar() { // connect using button.
if (!PhotonNetwork.IsConnected) {
PhotonNetwork.ConnectUsingSettings();
}
}

public override void OnConnectedToMaster()
{
Debug.Log("Connected to Master");
PhotonNetwork.JoinLobby();
PhotonNetwork.AutomaticallySyncScene = true;
}

public override void OnJoinedLobby()
{
MenuManagerLobby.Instance.OpenMenu("title");
Debug.Log("Joined Lobby");
PhotonNetwork.NickName = "+ " +and.username;
}

public override void OnJoinRandomFailed(short returnCode, string message) {
Log.text += "NNo hay salas disponibles, creando una nueva...";
if (PhotonNetwork.CreateRoom("CDF - " + and.username, new Photon.Realtime.RoomOptions() { MaxPlayers = maxPlayersRoom })) {
Log.text = "Sala creada";
} else {
Log.text = "No se pudo crear la sala :(";
}
}


public void CreateRoom()
{
if(string.IsNullOrEmpty(roomNameInputField.text))
{
return;
}
PhotonNetwork.CreateRoom("abc - " + roomNameInputField.text, new Photon.Realtime.RoomOptions() { MaxPlayers = maxPlayersRoom, IsVisible = true });
MenuManagerLobby.Instance.OpenMenu("loading");
}

public void JoinRandom() {
PhotonNetwork.JoinRandomRoom();
}

public override void OnJoinedRoom()
{
Log.text = "Unido";
MenuManagerLobby.Instance.OpenMenu("room");
roomNameText.text = PhotonNetwork.CurrentRoom.Name;

Player[] players = PhotonNetwork.PlayerList;

foreach(Transform child in playerListContent)
{
Destroy(child.gameObject);
}

for(int i = 0; i < players.Count(); i++)
{
Instantiate(PlayerListItemPrefab, playerListContent).GetComponent<PlayerListItem>().SetUp(players);
}

//if (startGameButton) startGameButton.SetActive(PhotonNetwork.IsMasterClient);

if (PhotonNetwork.CurrentRoom.PlayerCount < minPlayersRoom) {
Log.text = "Esperando Oponente...";
}
}

private void FixedUpdate() {
if (PhotonNetwork.CurrentRoom != null) {
playersCount = PhotonNetwork.CurrentRoom.PlayerCount;
}

if (playersCount >= minPlayersRoom) {
IsLoading = true;
protec = true;
Log.text = "Iniciando...";
}
}

IEnumerator moveToRace() {
yield return new WaitForSeconds(0.5f);
LoadMap();
protec = true;
PhotonNetwork.CurrentRoom.IsOpen = false;
PhotonNetwork.CurrentRoom.IsVisible = false;
}

private void LoadMap() {
if (IsLoading && protec) {
PhotonNetwork.LoadLevel("galvez_online");
}
}

public override void OnMasterClientSwitched(Player newMasterClient)
{
// if(startGameButton) startGameButton.SetActive(PhotonNetwork.IsMasterClient);
}

public override void OnCreateRoomFailed(short returnCode, string message)
{
errorText.text = "Room Creation Failed: " + message;
Debug.LogError("Room Creation Failed: " + message);
MenuManagerLobby.Instance.OpenMenu("error");
}

public void StartGame(string map)
{
PhotonNetwork.LoadLevel(map);
}

public void LeaveRoom()
{
PhotonNetwork.LeaveRoom();
MenuManagerLobby.Instance.OpenMenu("loading");
}

public void JoinRoom(RoomInfo info)
{
PhotonNetwork.JoinRoom(info.Name);
MenuManagerLobby.Instance.OpenMenu("loading");
}

public override void OnLeftRoom()
{
MenuManagerLobby.Instance.OpenMenu("title");
}

public override void OnRoomListUpdate(List<RoomInfo> roomList)
{
foreach(Transform trans in roomListContent)
{
Destroy(trans.gameObject);
}

for(int i = 0; i < roomList.Count; i++)
{
if (roomList.RemovedFromList) {
continue;
} else {
Instantiate(roomListItemPrefab, roomListContent).GetComponent<RoomListItem>().SetUp(roomList);
}
}
}

public override void OnPlayerEnteredRoom(Player newPlayer)
{
Instantiate(PlayerListItemPrefab, playerListContent).GetComponent<PlayerListItem>().SetUp(newPlayer);
}
}

Comments

  • I didn't find if this is mentioned on the Matchmaking doc page, so:
    You can not join a lobby while being in a room. In the rooms, there is no matchmaking.
    So you have to leave the room, wait until the client is on the Master Server and then join a lobby to get lists at all.

    It is highly recommended to not rely on lists. They don't mean a lot to users and aside from a name, they rarely make a useful decision which room to join (all have the same ping).
    If you know the room name: JoinRoom(name). If you want some room: JoinRandomRoom(). If there are a few conditions to be met: JoinRandomRoom(... expectedProperties,...).