Adding Status and Last server response handled but not tested
This commit is contained in:
@ -36,18 +36,20 @@ void UDTFluxModelAsset::AddPerson(const FDTFluxPerson& InPerson)
|
||||
|
||||
void UDTFluxModelAsset::AddParticipant(const FDTFluxParticipant& InParticipant, const int ContestId)
|
||||
{
|
||||
UE_LOG(logDTFluxCore, Error, TEXT("%i Person in Participant %i"), InParticipant.GetTeammateNum(), InParticipant.Bib);
|
||||
FDTFluxContest TargetContest;
|
||||
if(GetContestById(ContestId, TargetContest))
|
||||
{
|
||||
if(!PersonExists(InParticipant.Person1))
|
||||
TArray<FDTFluxPerson> Teammate = InParticipant.Teammate;
|
||||
for(auto& Person : InParticipant.Teammate)
|
||||
{
|
||||
AddPerson(InParticipant.Person1);
|
||||
}
|
||||
if(InParticipant.Person2 != 0)
|
||||
{
|
||||
if(!PersonExists(InParticipant.Person2))
|
||||
UE_LOG(logDTFluxCore, Error, TEXT("AddParticipant() DTFlux Person %s %s %s"),
|
||||
*Person.FirstName, *Person.LastName, *Person.Gender);
|
||||
if(!PersonExists(Person))
|
||||
{
|
||||
AddPerson(InParticipant.Person2);
|
||||
UE_LOG(logDTFluxCore, Error, TEXT("AddParticipant() DTFlux Person %s %s %s doesnot exists, adding..."),
|
||||
*Person.FirstName, *Person.LastName, *Person.Gender);
|
||||
AddPerson(Person);
|
||||
}
|
||||
}
|
||||
Participants.Add(InParticipant.Bib, InParticipant);
|
||||
@ -79,30 +81,24 @@ void UDTFluxModelAsset::AddContestRanking(const FDTFluxContestRankings& NewConte
|
||||
ContestRankings.Add(NewContestRankings.ContestId, NewContestRankings);
|
||||
}
|
||||
|
||||
bool UDTFluxModelAsset::UpdateStageRanking(const FDTFluxStageRankings& InStageRankings)
|
||||
void UDTFluxModelAsset::UpdateOrCreateStageRanking(const FDTFluxStageRankings& InStageRankings)
|
||||
{
|
||||
const int ContestId = InStageRankings.ContestId;
|
||||
const int StageId = InStageRankings.StageId;
|
||||
int Index = 0;
|
||||
int StageRankingArraySize = StageRankings.Num()-1;
|
||||
for(auto Ranking : StageRankings)
|
||||
{
|
||||
if(Ranking.ContestId == ContestId && Ranking.StageId == StageId)
|
||||
{
|
||||
Index++;
|
||||
break;
|
||||
}
|
||||
Index++;
|
||||
}
|
||||
if(Index != StageRankingArraySize )
|
||||
{
|
||||
StageRankings[Index] = InStageRankings;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
FDTFluxStageKey StageKey = InStageRankings.GetCompositeKey();
|
||||
StageRankings.FindOrAdd(StageKey) = InStageRankings;
|
||||
}
|
||||
|
||||
bool UDTFluxModelAsset::UpdateSplitRanking(const FDTFluxStageRankings& InStageRankings)
|
||||
void UDTFluxModelAsset::AddStageRanking(const FDTFluxStageRankings& InStageRankings)
|
||||
{
|
||||
return true;
|
||||
StageRankings.Add(InStageRankings.GetCompositeKey(), InStageRankings);
|
||||
}
|
||||
|
||||
void UDTFluxModelAsset::AddSplitRanking(const FDTFluxSplitRankings& InSplitRanking)
|
||||
{
|
||||
SplitRankings.Add(InSplitRanking.GetCompositeKey(), InSplitRanking);
|
||||
}
|
||||
|
||||
void UDTFluxModelAsset::UpdateOrCreateSplitRanking(const FDTFluxSplitRankings& InSplitRankings)
|
||||
{
|
||||
FDTFluxSplitKey SplitKey = InSplitRankings.GetCompositeKey();
|
||||
SplitRankings.FindOrAdd(SplitKey) = InSplitRankings;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user