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


C# ExitGames.Client.Photon.Hashtable.MergeStringKeys方法代码示例

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


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

示例1: OpSetCustomPropertiesOfRoom

        /// <summary>
        /// Updates and synchronizes this Room's Custom Properties. Optionally, expectedProperties can be provided as condition.
        /// </summary>
        /// <remarks>
        /// Custom Properties are a set of string keys and arbitrary values which is synchronized
        /// for the players in a Room. They are available when the client enters the room, as
        /// they are in the response of OpJoin and OpCreate.
        ///
        /// Custom Properties either relate to the (current) Room or a Player (in that Room).
        ///
        /// Both classes locally cache the current key/values and make them available as
        /// property: CustomProperties. This is provided only to read them.
        /// You must use the method SetCustomProperties to set/modify them.
        ///
        /// Any client can set any Custom Properties anytime. It's up to the game logic to organize
        /// how they are best used.
        ///
        /// You should call SetCustomProperties only with key/values that are new or changed. This reduces
        /// traffic and performance.
        ///
        /// Unless you define some expectedProperties, setting key/values is always permitted.
        /// In this case, the property-setting client will not receive the new values from the server but
        /// instead update its local cache in SetCustomProperties.
        ///
        /// If you define expectedProperties, the server will skip updates if the server property-cache
        /// does not contain all expectedProperties with the same values.
        /// In this case, the property-setting client will get an update from the server and update it's
        /// cached key/values at about the same time as everyone else.
        ///
        /// The benefit of using expectedProperties can be only one client successfully sets a key from
        /// one known value to another.
        /// As example: Store who owns an item in a Custom Property "ownedBy". It's 0 initally.
        /// When multiple players reach the item, they all attempt to change "ownedBy" from 0 to their
        /// actorNumber. If you use expectedProperties {"ownedBy", 0} as condition, the first player to
        /// take the item will have it (and the others fail to set the ownership).
        ///
        /// Properties get saved with the game state for Turnbased games (which use IsPersistent = true).
        /// </remarks>
        /// <param name="propertiesToSet">Hashtable of Custom Properties that changes.</param>
        /// <param name="webForward">Defines if the set properties should be forwarded to a WebHook.</param>
        /// <param name="expectedProperties">Provide some keys/values to use as condition for setting the new values.</param>
        public bool OpSetCustomPropertiesOfRoom(Hashtable propertiesToSet, bool webForward, Hashtable expectedProperties = null)
        {
            Hashtable customGameProps = new Hashtable();
            customGameProps.MergeStringKeys(propertiesToSet);

            return this.OpSetPropertiesOfRoom(customGameProps, webForward, expectedProperties);
        }
开发者ID:JiboStore,项目名称:PhotonRealtime,代码行数:48,代码来源:LoadBalancingClient.cs

示例2: OpSetCustomPropertiesOfRoom

        /// <summary>
        /// Sets only custom game properties (which exclusively use strings as key-type in hash).
        /// </summary>
        /// <param name="gameProperties">The roomProperties to udpate or set.</param>
        /// <param name="webForward">If true, this set of properties will be forwarded to your webhooks (if configured).</param>
        /// <returns>If sending the properties to the server worked (not if the operation was executed successfully).</returns>
        public bool OpSetCustomPropertiesOfRoom(Hashtable gameProperties, bool webForward)
        {
            Hashtable customGameProps = new Hashtable();
            customGameProps.MergeStringKeys(gameProperties);

            return this.OpSetPropertiesOfRoom(customGameProps, webForward);
        }
开发者ID:hyf042,项目名称:BakeryGirl-chess,代码行数:13,代码来源:LoadBalancingClient.cs

示例3: OpSetCustomPropertiesOfActor

        /// <summary>
        /// Updates and synchronizes a Player's Custom Properties. Optionally, expectedProperties can be provided as condition.
        /// </summary>
        /// <remarks>
        /// Custom Properties are a set of string keys and arbitrary values which is synchronized
        /// for the players in a Room. They are available when the client enters the room, as
        /// they are in the response of OpJoin and OpCreate.
        ///
        /// Custom Properties either relate to the (current) Room or a Player (in that Room).
        ///
        /// Both classes locally cache the current key/values and make them available as
        /// property: CustomProperties. This is provided only to read them.
        /// You must use the method SetCustomProperties to set/modify them.
        ///
        /// Any client can set any Custom Properties anytime. It's up to the game logic to organize
        /// how they are best used.
        ///
        /// You should call SetCustomProperties only with key/values that are new or changed. This reduces
        /// traffic and performance.
        ///
        /// Unless you define some expectedProperties, setting key/values is always permitted.
        /// In this case, the property-setting client will not receive the new values from the server but
        /// instead update its local cache in SetCustomProperties.
        ///
        /// If you define expectedProperties, the server will skip updates if the server property-cache
        /// does not contain all expectedProperties with the same values.
        /// In this case, the property-setting client will get an update from the server and update it's
        /// cached key/values at about the same time as everyone else.
        ///
        /// The benefit of using expectedProperties can be only one client successfully sets a key from
        /// one known value to another.
        /// As example: Store who owns an item in a Custom Property "ownedBy". It's 0 initally.
        /// When multiple players reach the item, they all attempt to change "ownedBy" from 0 to their
        /// actorNumber. If you use expectedProperties {"ownedBy", 0} as condition, the first player to
        /// take the item will have it (and the others fail to set the ownership).
        ///
        /// Properties get saved with the game state for Turnbased games (which use IsPersistent = true).
        /// </remarks>
        /// <param name="actorNr">Defines which player the Custom Properties belong to. ActorID of a player.</param>
        /// <param name="propertiesToSet">Hashtable of Custom Properties that changes.</param>
        /// <param name="expectedProperties">Provide some keys/values to use as condition for setting the new values.</param>
        public bool OpSetCustomPropertiesOfActor(int actorNr, Hashtable propertiesToSet, Hashtable expectedProperties = null)
        {
            Hashtable customActorProperties = new Hashtable();
            customActorProperties.MergeStringKeys(propertiesToSet);

            return this.OpSetPropertiesOfActor(actorNr, customActorProperties, expectedProperties);
        }
开发者ID:JiboStore,项目名称:PhotonRealtime,代码行数:48,代码来源:LoadBalancingClient.cs

示例4: OpSetCustomPropertiesOfActor

        /// <summary>
        /// Sets custom properties of a player / actor (only passing on the string-typed custom properties).
        /// Use this only when in state Joined.
        /// </summary>
        /// <param name="actorNr">ID of player to update/set properties for.</param>
        /// <param name="actorProperties">The properties to set for target actor.</param>
        /// <returns>If sending the properties to the server worked (not if the operation was executed successfully).</returns>
        public bool OpSetCustomPropertiesOfActor(int actorNr, Hashtable actorProperties)
        {
            Hashtable customActorProperties = new Hashtable();
            customActorProperties.MergeStringKeys(actorProperties);

            return this.OpSetPropertiesOfActor(actorNr, customActorProperties);
        }
开发者ID:hyf042,项目名称:BakeryGirl-chess,代码行数:14,代码来源:LoadBalancingClient.cs


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