浏览代码

Merge remote-tracking branch 'origin/master-staging-wire_implementation' into master-staging-2021_Upgrade-Async_Refactor

# Conflicts:
#	Assets/Scripts/GameLobby/Game/GameManager.cs
#	Assets/Scripts/GameLobby/Game/LocalLobby.cs
#	Assets/Scripts/GameLobby/Relay/RelayUtpSetup.cs
/main/staging/2021_Upgrade/Async_Refactor
UnityJacob 2 年前
当前提交
5abfd865
共有 2 个文件被更改,包括 18 次插入4 次删除
  1. 1
      Assets/Scripts/GameLobby/Game/GameManager.cs
  2. 21
      Assets/Scripts/GameLobby/Lobby/LobbyManager.cs

1
Assets/Scripts/GameLobby/Game/GameManager.cs


LocalPlayer m_LocalUser;
LocalLobby m_LocalLobby;
LobbySynchronizer m_LobbySynchronizer;
RelayUtpSetup m_RelaySetup;
RelayUtpClient m_RelayClient;

21
Assets/Scripts/GameLobby/Lobby/LobbyManager.cs


public Lobby CurrentLobby => m_CurrentLobby;
Lobby m_CurrentLobby;
LobbyEventCallbacks m_LobbyEventCallbacks = new LobbyEventCallbacks();
const int k_maxLobbiesToShow = 16; // If more are necessary, consider retrieving paginated results or using filters.
Task m_HeartBeatTask;

{
if (m_CreateCooldown.IsInCooldown)
{
UnityEngine.Debug.LogWarning("Create Lobby hit the rate limit.");
Debug.LogWarning("Create Lobby hit the rate limit.");
return null;
}

Player = new Player(id: uasId, data: CreateInitialPlayerData(localUser))
};
m_CurrentLobby = await LobbyService.Instance.CreateLobbyAsync(lobbyName, maxPlayers, createOptions);
StartHeartBeat();
return m_CurrentLobby;

m_CurrentLobby = await LobbyService.Instance.JoinLobbyByCodeAsync(lobbyCode, joinOptions);
}
return m_CurrentLobby;
}

Filters = filters
};
return await LobbyService.Instance.QueryLobbiesAsync(queryOptions);
}
//TODO Finish this
public async Task SubscribeToLobbyChanges(string lobbyID, LocalLobby localLobby)
{
m_LobbyEventCallbacks.LobbyChanged += changes =>
{
if (changes.Name.Changed)
localLobby.LobbyName.Value = changes.Name.Value;
if (changes.IsPrivate.Changed)
localLobby.Private.Value = changes.IsPrivate.Value;
};
await LobbyService.Instance.SubscribeToLobbyEventsAsync(lobbyID, m_LobbyEventCallbacks);
}
List<QueryFilter> LobbyColorToFilters(LobbyColor limitToColor)

正在加载...
取消
保存