本文整理汇总了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;
}
示例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;
}
}