private void Launch() { CoopSteamManager.Initialize(); CoopPeerStarter.Dedicated = true; CoopPeerStarter.DedicatedHost = true; CoopLobby.SetActive(new CoopLobbyInfo(SteamGameServer.GetSteamID()) { Name = SteamDSConfig.ServerName, Joinable = true, MemberLimit = SteamDSConfig.ServerPlayers }); if (GameSetup.IsSavedGame) { SaveSlotUtils.LoadHostGameGUID(); } if (string.IsNullOrEmpty(CoopLobby.Instance.Info.Guid) || GameSetup.IsNewGame) { CoopLobby.Instance.SetGuid(Guid.NewGuid().ToString()); } SteamDSConfig.ServerGUID = CoopLobby.Instance.Info.Guid; GameSetup.SetMpType(MpTypes.Server); GameSetup.SetPlayerMode(PlayerModes.Multiplayer); FMOD_StudioSystem.ForceFmodOff = true; GameObject gameObject = new GameObject("CoopSteamServerStarter"); CoopSteamServerStarter coopSteamServerStarter = gameObject.AddComponent <CoopSteamServerStarter>(); coopSteamServerStarter.mapState = CoopPeerStarter.MapState.None; coopSteamServerStarter._async = this.loadAsync; UnityEngine.Object.DontDestroyOnLoad(gameObject); }
private static void LobbyCreated(LobbyCreated_t param) { Debug.Log(string.Concat(new object[] { "LobbyCreated param.m_eResult=", param.m_eResult, ", lobbyId=", param.m_ulSteamIDLobby })); try { if (param.m_eResult == EResult.k_EResultOK) { CSteamID cSteamID = new CSteamID(param.m_ulSteamIDLobby); if (cSteamID.IsValid()) { CoopLobbyInfo coopLobbyInfo = new CoopLobbyInfo(param.m_ulSteamIDLobby); coopLobbyInfo.IsOwner = true; coopLobbyInfo.Name = CoopLobbyManager.createValues.Name; coopLobbyInfo.MemberLimit = CoopLobbyManager.createValues.MemberLimit; CoopLobbyManager.LobbyMatchList_Result = new List <CoopLobbyInfo>(); CoopLobbyManager.LobbyMatchList_Result.Add(coopLobbyInfo); CoopLobby.SetActive(coopLobbyInfo); if (TitleScreen.StartGameSetup.Type == TitleScreen.GameSetup.InitTypes.Continue) { SaveSlotUtils.LoadHostGameGUID(); } if (CoopLobbyManager.createCallback != null) { try { CoopLobbyManager.createCallback(); } catch (Exception var_1_E2) { } } goto IL_10C; } } if (CoopLobbyManager.createFailCallback != null) { try { CoopLobbyManager.createFailCallback(); } catch (Exception var_2_106) { } } IL_10C :; } finally { CoopLobbyManager.createValues = null; CoopLobbyManager.createCallback = null; CoopLobbyManager.createFailCallback = null; } }
private static void LobbyCreated(LobbyCreated_t param) { Debug.Log(string.Concat(new object[] { "LobbyCreated param.m_eResult=", param.m_eResult, ", lobbyId=", param.m_ulSteamIDLobby })); try { if (param.m_eResult == EResult.k_EResultOK) { CSteamID csteamID = new CSteamID(param.m_ulSteamIDLobby); if (csteamID.IsValid()) { CoopLobbyInfo coopLobbyInfo = new CoopLobbyInfo(param.m_ulSteamIDLobby); coopLobbyInfo.IsOwner = true; coopLobbyInfo.Name = CoopLobbyManager.createValues.Name; coopLobbyInfo.MemberLimit = CoopLobbyManager.createValues.MemberLimit; CoopLobbyManager.LobbyMatchList_Result = new List <CoopLobbyInfo>(); CoopLobbyManager.LobbyMatchList_Result.Add(coopLobbyInfo); CoopLobby.SetActive(coopLobbyInfo); if (GameSetup.IsSavedGame) { SaveSlotUtils.LoadHostGameGUID(); } if (CoopLobbyManager.createCallback != null) { try { CoopLobbyManager.createCallback(); } catch (Exception exception) { BoltLog.Exception(exception); } } goto IL_112; } } if (CoopLobbyManager.createFailCallback != null) { try { CoopLobbyManager.createFailCallback(); } catch (Exception exception2) { BoltLog.Exception(exception2); } } IL_112 :; } finally { CoopLobbyManager.createValues = null; CoopLobbyManager.createCallback = null; CoopLobbyManager.createFailCallback = null; } }