# 类 UMatchmakerClientBlueprintUtil

> Review the utility functions available for working with the Matchmaker Client Blueprint API.

##### Include（包括）##include

```cpp
#include <MatchmakerClient/Public/Utils/MatchmakerClientBlueprintUtil.h>
```

##### 语法##syntax

```cpp
UCLASS()
class UMatchmakerClientBlueprintUtil : public UBlueprintFunctionLibrary
```

继承自 [UBlueprintFunctionLibrary](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Engine/Kismet/UBlueprintFunctionLibrary/)

## 方法##methods

### PlayerCustomDataAddStringData(FMatchmakerPlayer&, FString, FString)##playercustomdataaddstringdata(fmatchmakerplayer&,-fstring,-fstring)

将自定义数据字符串添加到玩家的 CustomData 字段。

#### 声明##declaration

```cpp
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Matchmaker Util")
static bool PlayerCustomDataAddStringData(UPARAM(ref) FMatchmakerPlayer& Player, FString Key, FString Value)
```

#### 参数##parameters

| **Name** | **类型**                                                                                                    | **描述**                     |
| :------- | :-------------------------------------------------------------------------------------------------------- | :------------------------- |
| `Player` | [FMatchmakerPlayer](/matchmaker/unreal-engine-sdk/sdk-api/matchmaker-core/models/matchmaker-player.md)`&` | 要将自定义数据添加到的 Matchmaker 玩家。 |
| `Key`    | [FString](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/FString/)                   | 自定义数据的键。                   |
| `Value`  | [FString](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/FString/)                   | 为自定义数据添加的字符串值。             |

#### 返回##returns

| **类型** | **描述**                              |
| :----- | :---------------------------------- |
| `bool` | 如果添加自定义数据成功，返回 `true`，否则返回 `false`。 |

### PlayerCustomDataAddNumberData(FMatchmakerPlayer&, FString, float)##playercustomdataaddnumberdata(fmatchmakerplayer&,-fstring,-float)

将自定义数据数字添加到玩家的 CustomData 字段。

#### 声明##declaration

```cpp
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Matchmaker Util")
static bool PlayerCustomDataAddNumberData(UPARAM(ref) FMatchmakerPlayer& Player, FString Key, float Value)
```

#### 参数##parameters

| **Name** | **类型**                                                                                                    | **描述**                     |
| :------- | :-------------------------------------------------------------------------------------------------------- | :------------------------- |
| `Player` | [FMatchmakerPlayer](/matchmaker/unreal-engine-sdk/sdk-api/matchmaker-core/models/matchmaker-player.md)`&` | 要将自定义数据添加到的 Matchmaker 玩家。 |
| `Key`    | [FString](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/FString/)                   | 自定义数据的键。                   |
| `Value`  | `float`                                                                                                   | 为自定义数据添加的数字值。              |

#### 返回##returns

| **类型** | **描述**                              |
| :----- | :---------------------------------- |
| `bool` | 如果添加自定义数据成功，返回 `true`，否则返回 `false`。 |

### PlayerCustomDataRemoveData(FMatchmakerPlayer&, FString)##playercustomdataremovedata(fmatchmakerplayer&,-fstring)

从 [MatchmakerPlayer 的 CustomData](/matchmaker-unreal/sdk-api/matchmaker-core/models/matchmaker-player.md#customdata) 中移除自定义数据字段。

#### 声明##declaration

```cpp
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Matchmaker Util")
static bool PlayerCustomDataRemoveData(UPARAM(ref) FMatchmakerPlayer& Player, FString Key)
```

#### 参数##parameters

| **Name** | **类型**                                                                                                    | **描述**                   |
| :------- | :-------------------------------------------------------------------------------------------------------- | :----------------------- |
| `Player` | [FMatchmakerPlayer](/matchmaker/unreal-engine-sdk/sdk-api/matchmaker-core/models/matchmaker-player.md)`&` | 要移除自定义数据的 Matchmaker 玩家。 |
| `Key`    | [FString](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/FString/)                   | 要移除的数据的键。                |

#### 返回##returns

| **类型** | **描述**                                                                                                                                                                |
| :----- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `bool` | 如果 [MatchmakerPlayer](/matchmaker/unreal-engine-sdk/sdk-api/matchmaker-core/models/matchmaker-player.md) `CustomData` 包含该字段并且该字段已被移除，则返回 `true`；如果不包含该字段，则返回 `false`。 |

### CreateTicketOptionsAddStringAttribute(FCreateTicketOptions&, FString, FString)##createticketoptionsaddstringattribute(fcreateticketoptions&,-fstring,-fstring)

向 CreateTicketOptions 添加字符串属性。

#### 声明##declaration

```cpp
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Matchmaker Util")
static bool CreateTicketOptionsAddStringAttribute(UPARAM(ref) FCreateTicketOptions& Options, FString Key, FString Value)
```

#### 参数##parameters

| **Name**  | **类型**                                                                                  | **描述**      |
| :-------- | :-------------------------------------------------------------------------------------- | :---------- |
| `Options` | [FCreateTicketOptions](../models/create-ticket-options)`&`                              | 要添加属性的工单选项。 |
| `Key`     | [FString](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/FString/) | 属性的键。       |
| `Value`   | [FString](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/FString/) | 为属性添加的字符串值。 |

#### 返回##returns

| **类型** | **描述**                           |
| :----- | :------------------------------- |
| `bool` | 如果添加属性成功，返回 `true`，否则返回 `false`。 |

### CreateTicketOptionsAddNumberAttribute(FCreateTicketOptions&, FString, float)##createticketoptionsaddnumberattribute(fcreateticketoptions&,-fstring,-float)

向 `CreateTicketOptions` 添加数字属性。

#### 声明##declaration

```cpp
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Matchmaker Util")
static bool CreateTicketOptionsAddNumberAttribute(UPARAM(ref) FCreateTicketOptions& Options, FString Key, float Value)
```

#### 参数##parameters

| **Name**  | **类型**                                                                                  | **描述**      |
| :-------- | :-------------------------------------------------------------------------------------- | :---------- |
| `Options` | [FCreateTicketOptions](../models/create-ticket-options)`&`                              | 要添加属性的工单选项。 |
| `Key`     | [FString](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/FString/) | 属性的键。       |
| `Value`   | `float`                                                                                 | 为属性添加的数字值。  |

#### 返回##returns

| **类型** | **描述**                              |
| :----- | :---------------------------------- |
| `bool` | 如果添加自定义数据成功，返回 `true`，否则返回 `false`。 |

### CreateTicketOptionsRemoveAtrribute(FCreateTicketOptions&, FString)##createticketoptionsremoveatrribute(fcreateticketoptions&,-fstring)

从 CreateTicketOptions 移除属性。

#### 声明##declaration

```cpp
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Matchmaker Util")
static bool CreateTicketOptionsRemoveAtrribute(UPARAM(ref) FCreateTicketOptions& Options, FString Key)
```

#### 参数##parameters

| **Name**  | **类型**                                                                                  | **描述**      |
| :-------- | :-------------------------------------------------------------------------------------- | :---------- |
| `Options` | [FCreateTicketOptions](../models/create-ticket-options)`&`                              | 要移除属性的工单选项。 |
| `Key`     | [FString](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/FString/) | 要移除的属性的键。   |

#### 返回##returns

| **类型** | **描述**                                                     |
| :----- | :--------------------------------------------------------- |
| `bool` | 如果 Options 包含该属性并且该属性已被移除，则返回 `true`；如果不包含该属性，则返回 `false`。 |
