Teams #

Read more about the Teams system in Hiro here.

Create a team #

Create a team which other players can join.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
FHiroTeamCreateRequest Request;
Request.Name = TEXT("Example team");
Request.Desc = TEXT("Example description");
Request.Open = true;
Request.Icon = TEXT("icon.png");
Request.LangTag = TEXT("en");
Request.SetupMetadata = TEXT("");

FHiroOnTeamsCreate OnTeamsCreate;
OnTeamsCreate.AddDynamic(this, &AMyActor::OnTeamsCreate);
FOnError OnError;

HiroClient->TeamsCreate(Session, Request, OnTeamsCreate, OnError);

void AMyActor::OnTeamsCreate(const FHiroTeam& Team)
{
    UE_LOG(LogTemp, Log, TEXT("%s"), *Team.ToJson());
}

List one or more teams #

List one or more teams which the player can join.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
FHiroTeamListRequest Request;
Request.Cursor = TEXT("");
Request.Location = TEXT("UK");
Request.Limit = 100;

FHiroOnTeamsList OnTeamsList;
OnTeamsList.AddDynamic(this, &AMyActor::OnTeamsList);
FOnError OnError;

HiroClient->TeamsList(Session, Request, OnTeamsList, OnError);

void AMyActor::OnTeamsList(const FHiroTeamList& TeamList)
{
    UE_LOG(LogTemp, Log, TEXT("%s"), *TeamList.ToJson());
}

Search for a team #

Search for a team by name or optional short code.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
FHiroTeamSearchRequest Request;
Request.Input = TEXT("heroes");
Request.Limit = 100;

FHiroOnTeamsSearch OnTeamsSearch;
OnTeamsSearch.AddDynamic(this, &AMyActor::OnTeamsSearch);
FOnError OnError;

HiroClient->TeamsSearch(Session, Request, OnTeamsSearch, OnError);

void AMyActor::OnTeamsSearch(const FHiroTeamList& TeamList)
{
    UE_LOG(LogTemp, Log, TEXT("%s"), *TeamList.ToJson());
}

Send team chat message #

Write a chat message to the Team’s chat channel.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
FHiroTeamWriteChatMessageRequest Request;
Request.Id = TEXT("team_1");
Request.Content = TEXT("{\"message\":\"Hey everyone!\"}");

FHiroOnTeamsWriteChatMessage OnTeamsWriteChatMessage;
OnTeamsWriteChatMessage.AddDynamic(this, &AMyActor::OnTeamsWriteChatMessage);
FOnError OnError;

HiroClient->TeamsWriteChatmessage(Session, Request, OnTeamsWriteChatMessage, OnError);

void AMyActor::OnTeamsWriteChatMessage(const FHiroChannelMessageAck& ChannelMessageAck)
{
    UE_LOG(LogTemp, Log, TEXT("%s"), *ChannelMessageAck.ToJson());
}