当前位置: 首页>>代码示例>>C#>>正文


C# Lobby.GetLobbyType方法代码示例

本文整理汇总了C#中SteamSDK.Lobby.GetLobbyType方法的典型用法代码示例。如果您正苦于以下问题:C# Lobby.GetLobbyType方法的具体用法?C# Lobby.GetLobbyType怎么用?C# Lobby.GetLobbyType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SteamSDK.Lobby的用法示例。


在下文中一共展示了Lobby.GetLobbyType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: JoinGameTest

        private static bool JoinGameTest(Lobby lobby)
        {
            if (!lobby.IsValid)
                return false;

            if (lobby.GetLobbyType() == LobbyTypeEnum.FriendsOnly && !MySteam.API.Friends.HasFriend(lobby.GetOwner()))
            {
                MyGuiSandbox.Show(MyCommonTexts.OnlyFriendsCanJoinThisGame);
                return false;
            }
            if (!MyMultiplayerLobby.IsLobbyCorrectVersion(lobby))
            {
                var formatString = MyTexts.GetString(MyCommonTexts.MultiplayerError_IncorrectVersion);
                var myVersion = MyBuildNumbers.ConvertBuildNumberFromIntToString(MyFinalBuildConstants.APP_VERSION);
                var serverVersion = MyBuildNumbers.ConvertBuildNumberFromIntToString(MyMultiplayerLobby.GetLobbyAppVersion(lobby));
                MyGuiSandbox.Show(new StringBuilder(String.Format(formatString, myVersion, serverVersion)));
                return false;
            }
            if (MyFakes.ENABLE_MP_DATA_HASHES && !MyMultiplayerLobby.HasSameData(lobby))
            {
                MyGuiSandbox.Show(MyCommonTexts.MultiplayerError_DifferentData);
                MySandboxGame.Log.WriteLine("Different game data when connecting to server. Local hash: " + MyDataIntegrityChecker.GetHashBase64() + ", server hash: " + MyMultiplayerLobby.GetDataHash(lobby));
                return false;
            }
            return true;
        }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:26,代码来源:MyJoinGameHelper.cs

示例2: Matchmaking_LobbyDataUpdate

        protected void Matchmaking_LobbyDataUpdate(bool success, Lobby lobby, ulong memberOrLobby)
        {
            if (!success)
                return;

            var newOwnerId = lobby.GetOwner();
            var oldOwnerRow = m_playersTable.Find((row) => (row.GetCell(GameAdminColumn).Text.Length == GAME_OWNER_MARKER.Length));
            var newOwnerRow = m_playersTable.Find((row) => ((ulong)row.UserData) == newOwnerId);
            Debug.Assert(oldOwnerRow != null);
            Debug.Assert(newOwnerRow != null);
            if (oldOwnerRow != null) oldOwnerRow.GetCell(GameAdminColumn).Text.Clear();
            if (newOwnerRow != null) newOwnerRow.GetCell(GameAdminColumn).Text.Clear().Append(GAME_OWNER_MARKER);

            var lobbyType = lobby.GetLobbyType();
            m_lobbyTypeCombo.SelectItemByKey((int)lobbyType, sendEvent: false);
            MySession.Static.Settings.OnlineMode = GetOnlineMode(lobbyType);

            UpdateButtonsEnabledState();

            if (!Sync.IsServer)
            {
                m_maxPlayersSlider.ValueChanged = null;
                MySession.Static.Settings.MaxPlayers = (short)MyMultiplayer.Static.MemberLimit;
                m_maxPlayersSlider.Value = MySession.Static.MaxPlayers;
                m_maxPlayersSlider.ValueChanged = MaxPlayersSlider_Changed;
            }
        }
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:27,代码来源:MyGuiScreenPlayers.cs


注:本文中的SteamSDK.Lobby.GetLobbyType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。