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


C# PropertyBag.UpdateWithValues方法代码示例

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


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

示例1: RequestJoinGame

        /// <summary>
        /// Request the joining of an existing game instance on the game server.  
        /// This is a non-blocking call.  Once the game join request has been resolved
        /// the LobbyClient.GameJoinRequestResolved event will fire.
        /// </summary>
        /// <param name="gameId">the ID of the game we wish to join</param>
        /// <param name="msg">a string which will hold player facing text message if the call fails (returns false)</param>
        /// <returns>true if IsGameServerConnected and was ReadyForPlay and the request was thus sent</returns>
        public bool RequestJoinGame(Guid gameId, ref string msg, PropertyBag parms)
        {
            msg = "";
            if (!IsCentralServerConnected || !CentralReadyForCommunication)
            {
                msg = "Not ready to communicate with game server.";
                return false;
            }

            PropertyBag options = new PropertyBag();
            options.SetProperty("IsNewGame", false);
            options.SetProperty((int)PropertyID.GameId, gameId);
            if (parms != null)
            {
                options.UpdateWithValues(parms);
            }
            TargetGameOptions = options;
            Log.LogMsg("Requesting to join game " + gameId.ToString());
            m_CentralServer.SendGenericMessage((int)GenericLobbyMessageType.JoinGame, options, false);
            return true;
        }
开发者ID:kamilion,项目名称:WISP,代码行数:29,代码来源:LobbyClient.cs

示例2: RequestGameListing

        /// <summary>
        /// Request a list of all games that the server knows about. This is a non-blocking call. Once the game data arrives, LobbyClient.Games 
        /// will have the latest data in it and LobbyClient.CompleteMatchListingArrived event will fire.
        /// </summary>
        /// <param name="msg">a string which will hold player facing text message if the call fails (returns false)</param>
        /// <returns>true if IsGameServerConnected and was ReadyForPlay and the request was thus sent</returns>
        public bool RequestGameListing(ref string msg, int page, int numPerPage, bool includeInProgress, int minPlayersAllowed, PropertyBag parms)
        {
            msg = "";
            if (!IsCentralServerConnected || !CentralReadyForCommunication)
            {
                msg = "Not ready to communicate with game server.";
                return false;
            }

            Log.LogMsg("Requesting content listing from game server.");
            PropertyBag bag = new PropertyBag();
            bag.SetProperty("Page", page);
            bag.SetProperty("NumPerPage", numPerPage);
            bag.SetProperty("IncludeInProgress", includeInProgress);
            bag.SetProperty("MinPlayersAllowed", minPlayersAllowed);

            // ad-hoc parms
            bag.UpdateWithValues(parms);

            if (GameRequestSearchInvoker != null)
            {
                PropertyBag add = FireGameRequestSearch();
                if (add != null)
                {
                    bag.UpdateWithValues(add);
                }
            }

            m_CentralServer.SendGenericMessage((int)GenericLobbyMessageType.RequestGameListing, bag, false);
            return true;
        }
开发者ID:kamilion,项目名称:WISP,代码行数:37,代码来源:LobbyClient.cs


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