浏览代码

merging in latest from main-github

/main/staging
当前提交
070d67e5
共有 5 个文件被更改,包括 403 次插入613 次删除
  1. 5
      Assets/Scripts/Lobby/LobbyAPIInterface.cs
  2. 8
      Assets/Scripts/Lobby/LobbyAsyncRequests.cs
  3. 4
      Assets/Scripts/Relay/RelayUtpSetup.cs
  4. 999
      ~Documentation/Images/2_lobby.PNG

5
Assets/Scripts/Lobby/LobbyAPIInterface.cs


AsyncRequestLobby.Instance.DoRequest(task, onComplete);
}
public static void UpdatePlayerAsync(string lobbyId, string playerId, Dictionary<string, PlayerDataObject> data, Action<Lobby> onComplete, string allocationId, string connectionInfo)
public static void UpdatePlayerAsync(string lobbyId, string playerId, Dictionary<string, PlayerDataObject> data, Action<Lobby> onComplete, string allocationId)
AllocationId = allocationId,
ConnectionInfo = connectionInfo
AllocationId = allocationId
};
var task = Lobbies.Instance.UpdatePlayerAsync(lobbyId, playerId, updateOptions);
AsyncRequestLobby.Instance.DoRequest(task, onComplete);

8
Assets/Scripts/Lobby/LobbyAsyncRequests.cs


if (result != null)
m_lastKnownLobby = result; // Store the most up-to-date lobby now since we have it, instead of waiting for the next heartbeat.
onComplete?.Invoke();
}, null, null);
}, null);
public void UpdatePlayerRelayInfoAsync(string allocationId, string connectionInfo, Action onComplete)
public void UpdatePlayerRelayInfoAsync(string allocationId, Action onComplete)
if (!ShouldUpdateData(() => { UpdatePlayerRelayInfoAsync(allocationId, connectionInfo, onComplete); }, onComplete, true)) // Do retry here since the RelayUtpSetup that called this might be destroyed right after this.
if (!ShouldUpdateData(() => { UpdatePlayerRelayInfoAsync(allocationId, onComplete); }, onComplete, true)) // Do retry here since the RelayUtpSetup that called this might be destroyed right after this.
LobbyAPIInterface.UpdatePlayerAsync(m_lastKnownLobby.Id, playerId, new Dictionary<string, PlayerDataObject>(), (r) => { onComplete?.Invoke(); }, allocationId, connectionInfo);
LobbyAPIInterface.UpdatePlayerAsync(m_lastKnownLobby.Id, playerId, new Dictionary<string, PlayerDataObject>(), (r) => { onComplete?.Invoke(); }, allocationId);
}
/// <param name="data">Key-value pairs, which will overwrite any existing data for these keys. Presumed to be available to all lobby members but not publicly.</param>

4
Assets/Scripts/Relay/RelayUtpSetup.cs


RelayUtpHost host = gameObject.AddComponent<RelayUtpHost>();
host.Initialize(m_networkDriver, m_connections, m_localUser, m_localLobby);
m_onJoinComplete(true, host);
LobbyAsyncRequests.Instance.UpdatePlayerRelayInfoAsync(m_allocation.AllocationId.ToString(), m_localLobby.RelayCode, null);
LobbyAsyncRequests.Instance.UpdatePlayerRelayInfoAsync(m_allocation.AllocationId.ToString(), null);
}
}
}

RelayUtpClient client = gameObject.AddComponent<RelayUtpClient>();
client.Initialize(m_networkDriver, m_connections, m_localUser, m_localLobby);
m_onJoinComplete(true, client);
LobbyAsyncRequests.Instance.UpdatePlayerRelayInfoAsync(m_allocation.AllocationId.ToString(), m_localLobby.RelayCode, null);
LobbyAsyncRequests.Instance.UpdatePlayerRelayInfoAsync(m_allocation.AllocationId.ToString(), null);
}
}
}

999
~Documentation/Images/2_lobby.PNG
文件差异内容过多而无法显示
查看文件

正在加载...
取消
保存