コード例 #1
0
        /// <summary>
        /// Sets lobby properties of a specified lobby id
        /// </summary>
        public void SetLobbyProperties(int lobbyId, Dictionary <string, string> properties,
                                       SuccessCallback callback, ErrorCallback errorCallback)
        {
            var packet = new LobbyPropertiesSetPacket
            {
                LobbyId    = lobbyId,
                Properties = properties
            };

            Client.SendMessage((ushort)OpCodes.SetLobbyProperties, packet, (status, response) =>
            {
                if (status != ResponseStatus.Success)
                {
                    errorCallback.Invoke(response.AsString("Unknown error"));
                    return;
                }

                callback.Invoke();
            });
        }
コード例 #2
0
        /// <summary>
        /// Sets lobby properties of a specified lobby id
        /// </summary>
        public void SetLobbyProperties(int lobbyId, Dictionary <string, string> properties,
                                       SuccessCallback callback)
        {
            var packet = new LobbyPropertiesSetPacket()
            {
                LobbyId    = lobbyId,
                Properties = properties
            };

            Connection.SendMessage((short)OpCodes.SetLobbyProperties, packet, (status, response) =>
            {
                if (status != ResponseStatus.Success)
                {
                    callback.Invoke(false, response.AsString("Unknown error"));
                    return;
                }

                callback.Invoke(true, null);
            });
        }