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


C# Lobby.GetLobbyData方法代码示例

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


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

示例1: JoinGame

        public static void JoinGame(Lobby lobby, bool requestData = true)
        {
            // Data not received
            if (requestData && String.IsNullOrEmpty(lobby.GetLobbyData(MyMultiplayer.AppVersionTag)))
            {
                var helper = new MyLobbyHelper(lobby);
                helper.OnSuccess += (l) => JoinGame(l, false);
                if (helper.RequestData())
                    return;
            }

            if (!JoinGameTest(lobby))
                return;

            if (MyMultiplayerLobby.GetLobbyScenario(lobby))
            {
                MyJoinGameHelper.JoinScenarioGame(lobby.LobbyId);
            }
            else if (MyFakes.ENABLE_BATTLE_SYSTEM && MyMultiplayerLobby.GetLobbyBattle(lobby))
            {
                bool canBeJoined = MyMultiplayerLobby.GetLobbyBattleCanBeJoined(lobby);
                // Check also valid faction ids in battle lobby.
                long faction1Id = MyMultiplayerLobby.GetLobbyBattleFaction1Id(lobby);
                long faction2Id = MyMultiplayerLobby.GetLobbyBattleFaction2Id(lobby);

                if (canBeJoined && faction1Id != 0 && faction2Id != 0)
                    MyJoinGameHelper.JoinBattleGame(lobby.LobbyId);
            }
            else
            {
                JoinGame(lobby.LobbyId);
            }
        }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:33,代码来源:MyJoinGameHelper.cs

示例2: JoinBattleGame

        public static void JoinBattleGame(Lobby lobby, bool requestData = true)
        {
            // Data not received
            if (requestData && String.IsNullOrEmpty(lobby.GetLobbyData(MyMultiplayer.AppVersionTag)))
            {
                var helper = new MyLobbyHelper(lobby);
                helper.OnSuccess += (l) => JoinBattleGame(l, false);
                if (helper.RequestData())
                    return;
            }

            if (!JoinGameTest(lobby))
                return;

            JoinBattleGame(lobby.LobbyId);
        }
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:16,代码来源:MyJoinGameHelper.cs

示例3: GetLobbyScenarioBriefing

 public static string GetLobbyScenarioBriefing(Lobby lobby)
 {
     return lobby.GetLobbyData(MyMultiplayer.ScenarioBriefingTag);
 }
开发者ID:rem02,项目名称:SpaceEngineers,代码行数:4,代码来源:MyMultiplayerLobby.cs

示例4: GetLobbyMods

        public static List<MyObjectBuilder_Checkpoint.ModItem> GetLobbyMods(Lobby lobby)
        {
            var modsCount = GetLobbyModCount(lobby);
            var mods = new List<MyObjectBuilder_Checkpoint.ModItem>(modsCount);
            for (int i = 0; i < modsCount; ++i)
            {
                string modInfo = lobby.GetLobbyData(MyMultiplayer.ModItemTag + i);

                var index = modInfo.IndexOf("_");
                if (index != -1)
                {
                    ulong publishedFileId = 0;
                    ulong.TryParse(modInfo.Substring(0, index), out publishedFileId);
                    var name = modInfo.Substring(index + 1);
                    mods.Add(new MyObjectBuilder_Checkpoint.ModItem(name, publishedFileId, name));
                }
                else
                {
                    MySandboxGame.Log.WriteLineAndConsole(string.Format("Failed to parse mod details from LobbyData. '{0}'", modInfo));
                }

            }
            return mods;
        }
开发者ID:rem02,项目名称:SpaceEngineers,代码行数:24,代码来源:MyMultiplayerLobby.cs

示例5: GetDataHash

 public static string GetDataHash(Lobby lobby)
 {
     return lobby.GetLobbyData(MyMultiplayer.DataHashTag);
 }
开发者ID:rem02,项目名称:SpaceEngineers,代码行数:4,代码来源:MyMultiplayerLobby.cs

示例6: GetLobbyAppVersion

 public static int GetLobbyAppVersion(Lobby lobby)
 {
     int result;
     return int.TryParse(lobby.GetLobbyData(MyMultiplayer.AppVersionTag), out result) ? result : 0;
 }
开发者ID:rem02,项目名称:SpaceEngineers,代码行数:5,代码来源:MyMultiplayerLobby.cs

示例7: GetLobbyHostName

 public static string GetLobbyHostName(Lobby lobby)
 {
     return lobby.GetLobbyData(MyMultiplayer.HostNameTag);
 }
开发者ID:rem02,项目名称:SpaceEngineers,代码行数:4,代码来源:MyMultiplayerLobby.cs

示例8: GetLobbyWorldSize

        public static ulong GetLobbyWorldSize(Lobby lobby)
        {
            var s = lobby.GetLobbyData(MyMultiplayer.WorldSizeTag);
            if (!string.IsNullOrEmpty(s))
                return Convert.ToUInt64(s);

            return 0;
        }
开发者ID:rem02,项目名称:SpaceEngineers,代码行数:8,代码来源:MyMultiplayerLobby.cs

示例9: GetLobbyBool

 public static bool GetLobbyBool(string key, Lobby lobby, bool defValue)
 {
     bool val;
     if (bool.TryParse(lobby.GetLobbyData(key), out val))
         return val;
     else
         return defValue;
 }
开发者ID:rem02,项目名称:SpaceEngineers,代码行数:8,代码来源:MyMultiplayerLobby.cs

示例10: GetLobbyULong

 public static ulong GetLobbyULong(string key, Lobby lobby, ulong defValue)
 {
     ulong val;
     if (ulong.TryParse(lobby.GetLobbyData(key), out val))
         return val;
     else
         return defValue;
 }
开发者ID:rem02,项目名称:SpaceEngineers,代码行数:8,代码来源:MyMultiplayerLobby.cs

示例11: GetLobbyDateTime

 public static DateTime GetLobbyDateTime(string key, Lobby lobby, DateTime defValue)
 {
     DateTime val;
     if (DateTime.TryParse(lobby.GetLobbyData(key), CultureInfo.InvariantCulture, DateTimeStyles.None, out val))
         return val;
     else
         return defValue;
 }
开发者ID:rem02,项目名称:SpaceEngineers,代码行数:8,代码来源:MyMultiplayerLobby.cs

示例12: GetLobbyInt

 public static int GetLobbyInt(string key, Lobby lobby, int defValue)
 {
     int val;
     if (int.TryParse(lobby.GetLobbyData(key), NumberStyles.Integer, CultureInfo.InvariantCulture, out val))
         return val;
     else
         return defValue;
 }
开发者ID:rem02,项目名称:SpaceEngineers,代码行数:8,代码来源:MyMultiplayerLobby.cs

示例13: GetLobbyFloat

 public static float GetLobbyFloat(string key, Lobby lobby, float defValue)
 {
     float val;
     if (float.TryParse(lobby.GetLobbyData(key), NumberStyles.Float, CultureInfo.InvariantCulture, out val))
         return val;
     else
         return defValue;
 }
开发者ID:rem02,项目名称:SpaceEngineers,代码行数:8,代码来源:MyMultiplayerLobby.cs

示例14: GetLobbyGameMode

 public static MyGameModeEnum GetLobbyGameMode(Lobby lobby)
 {
     int val;
     if (int.TryParse(lobby.GetLobbyData(MyMultiplayer.GameModeTag), out val))
         return (MyGameModeEnum)val;
     else
         return MyGameModeEnum.Creative;
 }
开发者ID:rem02,项目名称:SpaceEngineers,代码行数:8,代码来源:MyMultiplayerLobby.cs


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