Hello, for some reason this code isn’t working, what I am trying to do is to update the settings of a lobby before a game begins, but for some reason the lobby’s settings don’t get changed at all.
Could you please tell me what I am doing wrong?
public async void begin() {
Debug.Log($"The hidden join code is {joinCode}");
LobManager.assignLobby(lobby);
var x = await Lock();
Debug.Log($"Privated {lobby.IsPrivate}"); //false
Debug.Log($"Locked {lobby.IsLocked}"); //false
networkManager.SceneManager.LoadScene("Game Board", LoadSceneMode.Single);
}
private IEnumerator Lock() {
Debug.Log("Locking");
UpdateLobbyOptions updateOptions = new UpdateLobbyOptions() {
IsPrivate = true,
IsLocked = true
};
Debug.Log($"update IsPrivate = {updateOptions.IsPrivate}"); //true
Debug.Log($"update IsLocked = {updateOptions.IsLocked}"); //true
var t = Lobbies.Instance.UpdateLobbyAsync(lobby.Id, updateOptions);
Debug.Log($"t.IsCompleted {t.IsCompleted}"); //false
yield return new WaitWhile(() => t.IsCompleted == false);
Debug.Log($"update IsPrivate = {updateOptions.IsPrivate}"); //true
Debug.Log($"update IsLocked = {updateOptions.IsLocked}"); //true
Debug.Log($"t.IsCompleted {t.IsCompleted}"); //true
Debug.Log($"Finish with private = {lobby.IsPrivate}"); //false
Debug.Log($"Finish with lock {lobby.IsLocked}"); //false
}