浏览代码

Addressing most minor points from Thomas' feedback that needed actual work. Doesn't address: When the host pushes player data, it also pushes lobby data even if there aren't changes. There was some inconsistent issue with clients being unable to press the Join button. Tests need to be cleaned a bit before release.

/main/staging
nathaniel.buck@unity3d.com 3 年前
当前提交
f98fd886
共有 3 个文件被更改,包括 12 次插入6 次删除
  1. 5
      Assets/Scripts/Entities/GameStateManager.cs
  2. 2
      Assets/Scripts/Lobby/LobbyAPIInterface.cs
  3. 11
      Assets/Scripts/Lobby/LobbyListHeartbeat.cs

5
Assets/Scripts/Entities/GameStateManager.cs


IEnumerator LeaveBeforeQuit()
{
ForceLeaveAttempt();
// TEMP: Since we're temporarily (as of 6/31/21) deleting empty lobbies when we leave them manually, we'll delay longer to ensure that happens.
//yield return null;
yield return new WaitForSeconds(0.5f);
yield return null;
Application.Quit();
}
}

2
Assets/Scripts/Lobby/LobbyAPIInterface.cs


}
}
private const int k_maxLobbiesToShow = 64;
private const int k_maxLobbiesToShow = 16; // If more are necessary, consider retrieving paginated results or using filters.
public static void CreateLobbyAsync(string requesterUASId, string lobbyName, int maxPlayers, bool isPrivate, Dictionary<string, PlayerDataObject> localUserData, Action<Response<Lobby>> onComplete)
{

11
Assets/Scripts/Lobby/LobbyListHeartbeat.cs


/// </summary>
public class LobbyListHeartbeat : MonoBehaviour
{
private const float k_refreshRate = 5;
private float m_refreshTimer = 0;
// This is called in-editor via events.
public void SetActive(bool isActive)
{

Locator.Get.UpdateSlow.Unsubscribe(OnUpdate);
m_refreshTimer = 0;
Locator.Get.Messenger.OnReceiveMessage(MessageType.QueryLobbies, null);
m_refreshTimer += dt;
if (m_refreshTimer > k_refreshRate)
{
Locator.Get.Messenger.OnReceiveMessage(MessageType.QueryLobbies, null);
m_refreshTimer = 0;
}
}
}
}
正在加载...
取消
保存