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