Read the target-actor key from the request envelope. Wire * format: `{"target": " ", "target_by": "actor_id" | * "actor_name"}` (default `"actor_id"` when `target_by` is * absent). Returns false + populates OutError if `target` is * missing. */
| 38 | * absent). Returns false + populates OutError if `target` is |
| 39 | * missing. */ |
| 40 | inline bool ResolveActorKey(const TSharedPtr<FJsonObject>& Req, |
| 41 | FString& OutKey, bool& OutByName, |
| 42 | FString& OutError) |
| 43 | { |
| 44 | OutKey.Empty(); |
| 45 | OutByName = false; |
| 46 | OutError.Empty(); |
| 47 | |
| 48 | FString Target, By; |
| 49 | Req->TryGetStringField(TEXT("target"), Target); |
| 50 | Req->TryGetStringField(TEXT("target_by"), By); |
| 51 | if (Target.IsEmpty()) |
| 52 | { |
| 53 | OutError = TEXT("missing 'target' field"); |
| 54 | return false; |
| 55 | } |
| 56 | OutKey = Target; |
| 57 | OutByName = By.Equals(TEXT("actor_name"), ESearchCase::IgnoreCase); |
| 58 | return true; |
| 59 | } |
| 60 | |
| 61 | /** Read a 3-element float array under Key. Falls back to Default |
| 62 | * if missing or wrong size. Returns true if the field was present |
no test coverage detected