コード例 #1
0
 public void Set(LobbyModificationAddAttributeOptions other)
 {
     if (other != null)
     {
         m_ApiVersion = LobbyModification.LobbymodificationAddattributeApiLatest;
         Attribute    = other.Attribute;
         Visibility   = other.Visibility;
     }
 }
コード例 #2
0
        /// <summary>
        /// Associate an attribute with this lobby
        /// An attribute is something may be public or private with the lobby.
        /// If public, it can be queried for in a search, otherwise the data remains known only to lobby members
        /// </summary>
        /// <param name="options">Options to set the attribute and its visibility state</param>
        /// <returns>
        /// <see cref="Result.Success" /> if setting this parameter was successful
        /// <see cref="Result.InvalidParameters" /> if the attribute is missing information or otherwise invalid
        /// <see cref="Result.IncompatibleVersion" /> if the API version passed in is incorrect
        /// </returns>
        public Result AddAttribute(LobbyModificationAddAttributeOptions options)
        {
            System.IntPtr optionsAddress = new System.IntPtr();
            Helper.TryMarshalSet <LobbyModificationAddAttributeOptionsInternal, LobbyModificationAddAttributeOptions>(ref optionsAddress, options);

            var funcResult = EOS_LobbyModification_AddAttribute(InnerHandle, optionsAddress);

            Helper.TryMarshalDispose(ref optionsAddress);

            return(funcResult);
        }
コード例 #3
0
        /// <summary>
        /// Short UpdateLobbyModification
        /// </summary>
        /// <param name="lobby">LobbyModification</param>
        /// <param name="key">Key</param>
        /// <param name="value">Value</param>
        /// <param name="visibility">Visibility type</param>
        public static void AddAttribute(this LobbyModification modify, string key, AttributeDataValue value, LobbyAttributeVisibility visibility)
        {
            var attr = new AttributeData();

            attr.Key   = key;
            attr.Value = value;
            var addOp = new LobbyModificationAddAttributeOptions
            {
                Attribute  = attr,
                Visibility = visibility
            };
            var addRes = modify.AddAttribute(addOp);

            if (addRes != Result.Success)
            {
                Debug.LogError($"{nameof(addRes)}:{addRes}");
            }
        }