Show in-game surveys to players and record their completion.
Surveys are authored in the Web Console as a set of typed questions. A survey without segments is visible to every player; with segments it is only returned to players that match them. List the surveys a player can see with ListSurveys(), render the questions, submit the answers with SubmitSurveyAnswers(), then record the completion with CompleteSurvey(). Answers are stored as player metadata, keyed by each question's metadata_key, and the completion is stored separately, so Completed and Completed_at tell you whether a player has already responded.
◆ FLootLockerCompleteSurveyResponseDelegate
C++ response delegate for completing a survey.
◆ FLootLockerGetSurveyResponseDelegate
C++ response delegate for getting a single survey.
◆ FLootLockerListSurveysResponseDelegate
C++ response delegate for listing surveys.
◆ CompleteSurvey()
Record a completion of the given survey for the current player.
Answers are submitted separately through the player metadata API using each question's metadata_key. The request fails when a required question has no stored answer.
- Parameters
-
| SurveyId | The ULID of the survey to complete |
| OnComplete | Delegate for handling the server response |
| ForPlayerWithUlid | Optional: Execute for the specified player ULID (default player if empty) |
- Returns
- A unique id for this request, use this to match callbacks to requests when you have multiple simultaneous requests outbound
◆ GetSurvey()
Get a single survey and its questions, if the current player meets the survey's segments.
- Parameters
-
| SurveyId | The ULID of the survey to fetch |
| OnComplete | Delegate for handling the server response |
| ForPlayerWithUlid | Optional: Execute for the specified player ULID (default player if empty) |
- Returns
- A unique id for this request, use this to match callbacks to requests when you have multiple simultaneous requests outbound
◆ ListSurveys()
List the surveys the current player can see, filtered by each survey's segments.
- Parameters
-
| OnComplete | Delegate for handling the server response |
| ForPlayerWithUlid | Optional: Execute for the specified player ULID (default player if empty) |
- Returns
- A unique id for this request, use this to match callbacks to requests when you have multiple simultaneous requests outbound
◆ SubmitSurveyAnswers()
Submit answers to a survey for the current player.
Survey answers are stored as player metadata, so this writes each answer to the player's own metadata under the question's metadata_key. Call CompleteSurvey afterwards to record the completion.
- Parameters
-
| Answers | The answers to submit, built with FLootLockerSurveyAnswer::FromText and friends |
| OnComplete | Delegate for handling the server response |
| ForPlayerWithUlid | Optional: Execute for the specified player ULID (default player if empty) |
- Returns
- A unique id for this request, use this to match callbacks to requests when you have multiple simultaneous requests outbound