private void Awake() { if (singleton == null) { singleton = this; } else { Destroy(this.gameObject); } Utilities.DontDestroyOnLoad(this.gameObject); Steamworks.SteamMatchmaking.OnLobbyCreated += OnLobbyCreated; Steamworks.SteamMatchmaking.OnLobbyEntered += OnLobbyEntered; }
private void Start() { Debug.Log("Clearing network: "); SteamLobby.LeaveLobby(); // Cancel auth ticket if (MyAuthenticator.localClientTicket != null) { MyAuthenticator.localClientTicket.Cancel(); } MyAuthenticator.localClientTicket = null; UpdateRoomDisplayText(); Refresh(); }
public void LeaveServer() { SteamLobby.LeaveLobby(); // Cancel auth ticket if (MyAuthenticator.localClientTicket != null) { MyAuthenticator.localClientTicket.Cancel(); } MyAuthenticator.localClientTicket = null; // Shutdown network if (Mirror.NetworkServer.active) { Debug.Log("Stopping host"); Mirror.NetworkManager.singleton.StopHost(); Mirror.NetworkClient.Disconnect(); Mirror.NetworkManager.singleton.StopClient(); } else { Debug.Log("Disconnecting client"); Mirror.NetworkClient.Disconnect(); Mirror.NetworkManager.singleton.StopClient(); } // Go to main menu SceneManager.LoadScene("MainMenu"); }
public void OnExitLobby(SteamLobby lobby) { Debug.Log("Exiting lobby: " + lobby.Name); }
public void OnEnterLobby(SteamLobby lobby) { lobby.Name = steamSettings.client.userData.DisplayName + "'s Lobby"; Debug.Log("Entered lobby: " + lobby.Name); }
public void StopClient() { SteamLobby.LeaveSteamLobby(); }
public void OpenFriendsListToInvite() { SteamLobby.OpenFriendsListInvite(); }