本文整理汇总了C#中SteamSDK.Lobby.GetOwner方法的典型用法代码示例。如果您正苦于以下问题:C# Lobby.GetOwner方法的具体用法?C# Lobby.GetOwner怎么用?C# Lobby.GetOwner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SteamSDK.Lobby
的用法示例。
在下文中一共展示了Lobby.GetOwner方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: MyMultiplayerLobby
internal MyMultiplayerLobby(Lobby lobby, MySyncLayer syncLayer)
: base(syncLayer, new EndpointId(Sync.MyId))
{
Lobby = lobby;
ServerId = Lobby.GetOwner();
SyncLayer.RegisterClientEvents(this);
HostName = MySteam.UserName;
Debug.Assert(IsServer, "Wrong object created");
MySteam.API.Matchmaking.LobbyChatUpdate += Matchmaking_LobbyChatUpdate;
MySteam.API.Matchmaking.LobbyChatMsg += Matchmaking_LobbyChatMsg;
ClientLeft += MyMultiplayerLobby_ClientLeft;
AcceptMemberSessions();
}
示例3: MyMultiplayerLobby
internal MyMultiplayerLobby(Lobby lobby, MySyncLayer syncLayer)
: base(syncLayer)
{
Lobby = lobby;
ServerId = Lobby.GetOwner();
SyncLayer.RegisterClientEvents(this);
if (IsServer)
{
HostName = MySteam.UserName;
}
else
{
SyncLayer.TransportLayer.IsBuffering = true;
}
MySteam.API.Matchmaking.LobbyChatUpdate += Matchmaking_LobbyChatUpdate;
MySteam.API.Matchmaking.LobbyChatMsg += Matchmaking_LobbyChatMsg;
ClientLeft += MyMultiplayerLobby_ClientLeft;
AcceptMemberSessions();
}
示例4: MyMultiplayerLobbyClient
internal MyMultiplayerLobbyClient(Lobby lobby, MySyncLayer syncLayer)
: base(syncLayer)
{
Lobby = lobby;
ServerId = Lobby.GetOwner();
SyncLayer.RegisterClientEvents(this);
if (IsServer)
{
HostName = MySteam.UserName;
}
else
{
SyncLayer.TransportLayer.IsBuffering = true;
SetReplicationLayer(new MyReplicationClient(this, new MyClientState()));
syncLayer.TransportLayer.Register(MyMessageId.SERVER_DATA, ReplicationLayer.ProcessServerData);
syncLayer.TransportLayer.Register(MyMessageId.REPLICATION_CREATE, ReplicationLayer.ProcessReplicationCreate);
syncLayer.TransportLayer.Register(MyMessageId.REPLICATION_DESTROY, ReplicationLayer.ProcessReplicationDestroy);
syncLayer.TransportLayer.Register(MyMessageId.SERVER_STATE_SYNC, ReplicationLayer.ProcessStateSync);
syncLayer.TransportLayer.Register(MyMessageId.RPC, ReplicationLayer.ProcessEvent);
}
Debug.Assert(!IsServer, "Wrong object created");
SyncLayer.RegisterMessageImmediate<AllMembersDataMsg>(OnAllMembersData, MyMessagePermissions.ToServer|MyMessagePermissions.FromServer);
MySteam.API.Matchmaking.LobbyChatUpdate += Matchmaking_LobbyChatUpdate;
MySteam.API.Matchmaking.LobbyChatMsg += Matchmaking_LobbyChatMsg;
ClientLeft += MyMultiplayerLobby_ClientLeft;
AcceptMemberSessions();
}
示例5: 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;
}
}
示例6: MyMultiplayerLobby
internal MyMultiplayerLobby(Lobby lobby, MySyncLayer syncLayer)
: base(syncLayer)
{
Lobby = lobby;
ServerId = Lobby.GetOwner();
SyncLayer.RegisterClientEvents(this);
if (IsServer)
{
HostName = MySteam.UserName;
}
else
{
SyncLayer.TransportLayer.IsBuffering = true;
}
Debug.Assert(IsServer, "Wrong object created");
SyncLayer.RegisterMessageImmediate<AllMembersDataMsg>(OnAllMembersData, MyMessagePermissions.ToServer|MyMessagePermissions.FromServer);
MySteam.API.Matchmaking.LobbyChatUpdate += Matchmaking_LobbyChatUpdate;
MySteam.API.Matchmaking.LobbyChatMsg += Matchmaking_LobbyChatMsg;
ClientLeft += MyMultiplayerLobby_ClientLeft;
AcceptMemberSessions();
}
示例7: MyMultiplayerLobbyClient
internal MyMultiplayerLobbyClient(Lobby lobby, MySyncLayer syncLayer)
: base(syncLayer)
{
Lobby = lobby;
ServerId = Lobby.GetOwner();
SyncLayer.RegisterClientEvents(this);
SyncLayer.TransportLayer.IsBuffering = true;
SetReplicationLayer(new MyReplicationClient(this, CreateClientState()));
syncLayer.TransportLayer.Register(MyMessageId.SERVER_DATA, ReplicationLayer.ProcessServerData);
syncLayer.TransportLayer.Register(MyMessageId.REPLICATION_CREATE, ReplicationLayer.ProcessReplicationCreate);
syncLayer.TransportLayer.Register(MyMessageId.REPLICATION_DESTROY, ReplicationLayer.ProcessReplicationDestroy);
syncLayer.TransportLayer.Register(MyMessageId.SERVER_STATE_SYNC, ReplicationLayer.ProcessStateSync);
syncLayer.TransportLayer.Register(MyMessageId.RPC, ReplicationLayer.ProcessEvent);
syncLayer.TransportLayer.Register(MyMessageId.REPLICATION_STREAM_BEGIN, ReplicationLayer.ProcessReplicationCreateBegin);
Debug.Assert(!IsServer, "Wrong object created");
MySteam.API.Matchmaking.LobbyChatUpdate += Matchmaking_LobbyChatUpdate;
MySteam.API.Matchmaking.LobbyChatMsg += Matchmaking_LobbyChatMsg;
ClientLeft += MyMultiplayerLobby_ClientLeft;
AcceptMemberSessions();
}