public void FindFriendLobbies() { InTrainingLobby = false; if (!SteamCore.SteamIsConnected()) { Offline(); } SteamMatches.SetLobbyCallbacks(null, null, null, () => OnFindLobbies(false)); SteamMatches.FindFriendLobbies(OnFindLobbies); }
public void OnJoinLobby(bool result) { LobbyInfo = new LobbyInfo(Program.MaxPlayers); if (result) { Console.WriteLine("Failure joining the lobby."); Send("joinFailed"); SteamMatches.SetLobbyCallbacks(null, null, null, null); return; } BuildMapList(); if (SteamMatches.IsLobbyOwner()) { GameMapName = null; MapLoading = true; SetMap(Maps[0]); } string lobbyName = SteamMatches.GetLobbyData("name"); Console.WriteLine("joined lobby {0}", lobbyName); IsHost = SteamMatches.IsLobbyOwner(); SendLobbyData(); BuildLobbyInfo(joining_player_id: SteamCore.PlayerId()); SteamP2P.SetOnP2PSessionRequest(OnP2PSessionRequest); SteamP2P.SetOnP2PSessionConnectFail(OnP2PSessionConnectFail); string game_started = SteamMatches.GetLobbyData("GameStarted"); if (game_started == "true") { _StartGame(); } }