Payback 0.0.1
CK Graduation Project
로딩중...
검색중...
일치하는것 없음
UStreamingSubsystem 클래스 참조

#include <StreamingSubsystem.h>

UStreamingSubsystem에 대한 상속 다이어그램 :
Inheritance graph
UStreamingSubsystem에 대한 협력 다이어그램:
Collaboration graph

Public 멤버 함수

virtual void OnWorldBeginPlay (UWorld &InWorld) override
 
virtual void Deinitialize () override
 
void RegisterConstellation (UConstellationBase *Constellation)
 
void TriggerSituation (USituationBase *Situation)
 
TArray< UConstellationBase * > GetConstellations () const
 
TArray< UConstellationBase * > GetRespondingConstellations (ESituationTag BroadcastTags) const
 
UConstellationBaseDrawConstellationForTags (ESituationTag BroadcastTags, const TArray< FName > &ExcludedIDs)
 
UConstellationBaseFindRegisteredConstellation (const FName &ConstellationID) const
 
void StartChatFlow ()
 
void StopChatFlow ()
 
void HandleSituationSelected (USituationBase *Situation)
 
FORCEINLINE ESituationTag GetCurrentReactionTag () const
 
FORCEINLINE bool IsBroadcastTitleConfirmed () const
 

Public 속성

FOnConstellationReaction OnConstellationReaction
 
FOnConstellationRegistered OnConstellationRegistered
 
FOnBroadcastTitleConfirmed OnBroadcastTitleConfirmed
 

Protected 멤버 함수

void ReactToSituation (UConstellationBase *Constellation)
 
void DumpConstellationCandidates (const UStageManifest *Manifest, ESituationTag BroadcastTags, const TArray< FName > &ExcludedIDs) const
 
void SetReactionTag (ESituationTag NewTag)
 
void ScheduleNormalSpawn ()
 
void ScheduleTaggedSpawn ()
 
void SpawnNormalChat ()
 
void SpawnTaggedChat ()
 
void ProcessChatOutput ()
 
void DiscardStaleNormalChats ()
 
void RestartOutputTimer ()
 
void OutputChat (const FConstellationChatEntry &Entry, bool bTagged)
 
bool BuildChatEntry (UConstellationBase *Constellation, bool bTagged, FConstellationChatEntry &OutEntry) const
 
UConstellationBaseDrawChatSpeaker (bool bTagged) const
 
bool IsWaitingInTaggedQueue (const UConstellationBase *Constellation) const
 
float GetChatTime () const
 

정적 Protected 멤버 함수

static const UConstellationSettingsGetChatSettings ()
 

Protected 속성

TArray< FConstellationEntryEntries
 
TArray< FConstellationChatEntryTaggedQueue
 
TArray< FConstellationChatEntryNormalQueue
 
TArray< ESituationTagSelectedTagHistory
 
ESituationTag CurrentReactionTag = ESituationTag::None
 
uint8 bTitleConfirmed: 1 = false
 
uint8 bChatFlowRunning: 1 = false
 

Private 속성

FTimerHandle NormalSpawnTimerHandle
 
FTimerHandle TaggedSpawnTimerHandle
 
FTimerHandle OutputTimerHandle
 

상세한 설명

시청자(성좌) 목록을 들고, 성좌 채팅의 생성·대기열·출력을 모두 맡는 월드 서브시스템.

성좌는 버프를 소유하지 않는다. 버프는 상황 카드(USituationBase)가 들고 있으며, 여기서는 어떤 성좌가 어떤 문구로 언제 반응할지만 정한다.

채팅은 두 레인에서 따로 생성돼 각자의 대기열에 쌓이고, 하나의 출력 펌프가 순서를 조정한다.

  • 태그 레인 : 현재 반응 태그가 있을 때만 돌며, 출력 우선순위가 높다.
  • 일반 레인 : 항상 돌지만, 너무 오래 밀리면 대기열째로 버려진다. 화면에 몇 줄을 남길지는 UI(UChatViewWidget)가 정한다. 여기서는 대기열만 책임진다.

멤버 함수 문서화

◆ BuildChatEntry()

bool UStreamingSubsystem::BuildChatEntry ( UConstellationBase Constellation,
bool  bTagged,
FConstellationChatEntry OutEntry 
) const
protected
475{
476 if (Constellation == nullptr)
477 {
478 return false;
479 }
480
481 const FText ChatText = Constellation->BuildReactionText(bTagged);
482
483 if (ChatText.IsEmpty())
484 {
485 return false;
486 }
487
488 OutEntry.Constellation = Constellation;
489 OutEntry.ChatText = ChatText;
490 OutEntry.EnqueuedTime = GetChatTime();
491
492 return true;
493}
FText BuildReactionText(bool bTagged) const
Definition ConstellationBase.cpp:35
float GetChatTime() const
Definition StreamingSubsystem.cpp:554
TObjectPtr< UConstellationBase > Constellation
Definition StreamingSubsystem.h:50
float EnqueuedTime
Definition StreamingSubsystem.h:56
FText ChatText
Definition StreamingSubsystem.h:53
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ Deinitialize()

void UStreamingSubsystem::Deinitialize ( )
overridevirtual
30{
32
33 if (UWorld* World = GetWorld())
34 {
35 World->GetTimerManager().ClearTimer(OutputTimerHandle);
36 }
37
38 Entries.Empty();
39 SelectedTagHistory.Empty();
40
41 Super::Deinitialize();
42}
TArray< FConstellationEntry > Entries
Definition StreamingSubsystem.h:173
FTimerHandle OutputTimerHandle
Definition StreamingSubsystem.h:198
void StopChatFlow()
Definition StreamingSubsystem.cpp:227
TArray< ESituationTag > SelectedTagHistory
Definition StreamingSubsystem.h:184
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ DiscardStaleNormalChats()

void UStreamingSubsystem::DiscardStaleNormalChats ( )
protected
430{
431 const UConstellationSettings* Settings = GetChatSettings();
432
433 if (Settings == nullptr || NormalQueue.IsEmpty())
434 {
435 return;
436 }
437
438 // 가장 오래된 일반 채팅 하나의 대기 시간만 확인한다.
439 const float WaitedTime = GetChatTime() - NormalQueue[0].EnqueuedTime;
440
441 // 기준 시간과 정확히 같을 때는 유지하고, 넘겼을 때만 지연으로 판정한다.
442 if (WaitedTime > Settings->GetNormalChatStaleThreshold())
443 {
444 NormalQueue.Reset();
445 }
446}
Definition ConstellationSettings.h:12
FORCEINLINE float GetNormalChatStaleThreshold() const
Definition ConstellationSettings.h:36
TArray< FConstellationChatEntry > NormalQueue
Definition StreamingSubsystem.h:180
static const UConstellationSettings * GetChatSettings()
Definition StreamingSubsystem.cpp:563
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ DrawChatSpeaker()

UConstellationBase * UStreamingSubsystem::DrawChatSpeaker ( bool  bTagged) const
protected
497{
498 TArray<UConstellationBase*> Candidates;
499 Candidates.Reserve(Entries.Num());
500
501 for (const FConstellationEntry& Entry : Entries)
502 {
503 UConstellationBase* Constellation = Entry.Constellation;
504
505 if (Constellation == nullptr)
506 {
507 continue;
508 }
509
510 // 태그 채팅은 현재 반응 태그에 반응하는 성좌만 후보다.
511 if (bTagged && Constellation->ReactsTo(CurrentReactionTag) == false)
512 {
513 continue;
514 }
515
516 const FConstellationData& Data = Constellation->GetConstellationData();
517 const FText& RawText = bTagged ? Data.TaggedReaction : Data.DefaultReaction;
518
519 // 해당 종류의 문구가 비어 있으면 그 성좌는 그 채팅을 내지 않는다.
520 if (RawText.IsEmpty())
521 {
522 continue;
523 }
524
525 Candidates.Add(Constellation);
526 }
527
528 if (Candidates.IsEmpty())
529 {
530 return nullptr;
531 }
532
533 // 후보는 모두 같은 확률로 뽑는다.
534 return Candidates[FMath::RandRange(0, Candidates.Num() - 1)];
535}
Definition ConstellationBase.h:35
bool ReactsTo(ESituationTag BroadcastTags) const
Definition ConstellationBase.cpp:9
FORCEINLINE const FConstellationData & GetConstellationData() const
Definition ConstellationBase.h:53
ESituationTag CurrentReactionTag
Definition StreamingSubsystem.h:187
Definition ConstellationData.h:16
FText DefaultReaction
Definition ConstellationData.h:39
FText TaggedReaction
Definition ConstellationData.h:43
Definition StreamingSubsystem.h:30
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ DrawConstellationForTags()

UConstellationBase * UStreamingSubsystem::DrawConstellationForTags ( ESituationTag  BroadcastTags,
const TArray< FName > &  ExcludedIDs 
)
153{
154 UStageManifest* Manifest = UDataBundleRegistry::GetBundleAssetByTag<UStageManifest>(TAG_BUNDLE_INITIAL);
155
156 if (Manifest == nullptr)
157 {
158 LOG_WARNING(LogCK, "%s 를 찾지 못해 카드에 묶을 성좌를 뽑을 수 없습니다.", NAMEOF(UStageManifest));
159 return nullptr;
160 }
161
162 // 태그가 맞는 성좌를 모은다.
163 // 같은 선택창의 다른 카드가 이미 문 성좌는 금지가 아니라 후순위로만 둔다.
164 // 태그당 성좌가 1명뿐이라 겹침을 금지하면 카드에 성좌가 안 붙는다.
165 TArray<const FDT_ConstellationTable*> Matched;
166 TArray<const FDT_ConstellationTable*> Unused;
167
168 for (const TPair<FName, FDT_ConstellationTable>& Pair : Manifest->GetConstellationMap())
169 {
170 if (EnumHasAnyFlags(Pair.Value.ParsedReactionTags, BroadcastTags) == false)
171 {
172 continue;
173 }
174
175 Matched.Add(&Pair.Value);
176
177 if (ExcludedIDs.Contains(Pair.Key) != false)
178 {
179 continue;
180 }
181
182 Unused.Add(&Pair.Value);
183 }
184
185 const TArray<const FDT_ConstellationTable*>& Pool = Unused.IsEmpty() ? Matched : Unused;
186
187 if (Pool.IsEmpty())
188 {
189 LOG_WARNING(LogCK, "방송 태그 '%s' 에 반응하는 성좌가 Constellation_Master 에 없습니다.", *BroadcastTag::ToDisplayString(BroadcastTags));
190 DumpConstellationCandidates(Manifest, BroadcastTags, ExcludedIDs);
191 return nullptr;
192 }
193
194 const FDT_ConstellationTable* Picked = Pool[FMath::RandRange(0, Pool.Num() - 1)];
195
196 // 이미 시청 중인 성좌면 새로 만들지 않고 그 인스턴스를 그대로 쓴다.
198 {
199 return Registered;
200 }
201 else
202 {
204 }
205}
#define NAMEOF(Type)
Definition CK_UE.h:30
#define LOG_WARNING(Category, Format,...)
Definition CK_UE.h:39
static UConstellationBase * CreateConstellationFromRow(UObject *Outer, const FDT_ConstellationTable &Row)
Definition ConstellationFactory.cpp:36
Definition StageManifest.h:161
UConstellationBase * FindRegisteredConstellation(const FName &ConstellationID) const
Definition StreamingSubsystem.cpp:139
void DumpConstellationCandidates(const UStageManifest *Manifest, ESituationTag BroadcastTags, const TArray< FName > &ExcludedIDs) const
Definition StreamingSubsystem.cpp:569
CK_UE_API FString ToDisplayString(ESituationTag Tags)
Definition SituationTag.cpp:28
Definition DT_ConstellationTable.h:19
FName Constellation_ID
Definition DT_ConstellationTable.h:31
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ DumpConstellationCandidates()

void UStreamingSubsystem::DumpConstellationCandidates ( const UStageManifest Manifest,
ESituationTag  BroadcastTags,
const TArray< FName > &  ExcludedIDs 
) const
protected
570{
571 LOG_WARNING(LogCK, "--- 성좌 추첨 진단 (찾던 태그: %s / ConstellationMap %d개 / 시청 중 %d명 / 제외 %d개) ---",
572 *BroadcastTag::ToDisplayString(BroadcastTags), Manifest->GetConstellationMap().Num(), Entries.Num(), ExcludedIDs.Num());
573
574 for (const TPair<FName, FDT_ConstellationTable>& Pair : Manifest->GetConstellationMap())
575 {
576 LOG_WARNING(LogCK, " [테이블] %s : Reaction_Tags=\"%s\" -> 파싱=%s",
577 *Pair.Key.ToString(), *Pair.Value.Reaction_Tags, *BroadcastTag::ToDisplayString(Pair.Value.ParsedReactionTags));
578 }
579
580 for (const FConstellationEntry& Entry : Entries)
581 {
582 if (Entry.Constellation == nullptr)
583 {
584 LOG_WARNING(LogCK, " [시청중] (nullptr)");
585 continue;
586 }
587
588 LOG_WARNING(LogCK, " [시청중] %s : 반응태그=%s",
589 *Entry.Constellation->GetConstellationData().Constellation_ID.ToString(),
590 *BroadcastTag::ToDisplayString(Entry.Constellation->GetConstellationData().ReactionTags));
591 }
592
593 for (const FName& ExcludedID : ExcludedIDs)
594 {
595 LOG_WARNING(LogCK, " [제외됨] %s", *ExcludedID.ToString());
596 }
597}
FORCEINLINE const TMap< FName, FDT_ConstellationTable > & GetConstellationMap() const
Definition StageManifest.h:202
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ FindRegisteredConstellation()

UConstellationBase * UStreamingSubsystem::FindRegisteredConstellation ( const FName &  ConstellationID) const
140{
141 auto MatchesID = [&ConstellationID](const FConstellationEntry& Entry)
142 {
143 return Entry.Constellation && Entry.Constellation->GetConstellationData().Constellation_ID == ConstellationID;
144 };
145
146 const FConstellationEntry* Found = Entries.FindByPredicate(MatchesID);
147
148 return Found ? Found->Constellation : nullptr;
149}
TObjectPtr< UConstellationBase > Constellation
Definition StreamingSubsystem.h:35
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ GetChatSettings()

const UConstellationSettings * UStreamingSubsystem::GetChatSettings ( )
staticprotected
564{
565 return GetDefault<UConstellationSettings>();
566}
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ GetChatTime()

float UStreamingSubsystem::GetChatTime ( ) const
protected
555{
556 const UWorld* World = GetWorld();
557
558 // 시간 배율이 걸린 월드 시각이라, 시간이 멈춘 동안에는 대기 시간도 함께 멈춘다.
559 return World ? World->GetTimeSeconds() : 0.0f;
560}
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ GetConstellations()

TArray< UConstellationBase * > UStreamingSubsystem::GetConstellations ( ) const
107{
108 TArray<UConstellationBase*> Result;
109 Result.Reserve(Entries.Num());
110
111 for (const FConstellationEntry& Entry : Entries)
112 {
113 if (Entry.Constellation)
114 {
115 Result.Add(Entry.Constellation);
116 }
117 }
118
119 return Result;
120}
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ GetCurrentReactionTag()

FORCEINLINE ESituationTag UStreamingSubsystem::GetCurrentReactionTag ( ) const
inline
114 {
115 return CurrentReactionTag;
116 }

◆ GetRespondingConstellations()

TArray< UConstellationBase * > UStreamingSubsystem::GetRespondingConstellations ( ESituationTag  BroadcastTags) const
124{
125 TArray<UConstellationBase*> Result;
126
127 for (const FConstellationEntry& Entry : Entries)
128 {
129 if (Entry.Constellation && Entry.Constellation->ReactsTo(BroadcastTags))
130 {
131 Result.Add(Entry.Constellation);
132 }
133 }
134
135 return Result;
136}

◆ HandleSituationSelected()

void UStreamingSubsystem::HandleSituationSelected ( USituationBase Situation)
244{
245 if (Situation == nullptr)
246 {
247 return;
248 }
249
250 // 제목이 확정된 뒤에는 어떤 카드를 골라도 반응 태그가 바뀌지 않는다.
251 if (bTitleConfirmed)
252 {
253 return;
254 }
255
256 const ESituationTag SelectedTag = Situation->GetSituationTags();
257
258 if (SelectedTag == ESituationTag::None)
259 {
260 LOG_WARNING(LogCK, "상황 '%s'에 방송 태그가 없어 반응 태그를 바꾸지 않습니다.", *Situation->GetSituationID().ToString());
261 return;
262 }
263
264 SelectedTagHistory.Add(SelectedTag);
265
266 int32 SameTagCount = 0;
267
268 for (const ESituationTag PickedTag : SelectedTagHistory)
269 {
270 SameTagCount += PickedTag == SelectedTag ? 1 : 0;
271 }
272
273 const UConstellationSettings* Settings = GetChatSettings();
274
275 // 같은 태그를 기준 수만큼 모으면 방송 제목이 확정되고 그 태그로 고정된다.
276 if (Settings && SameTagCount >= Settings->GetBroadcastTitleTagCount())
277 {
278 bTitleConfirmed = true;
279
280 LOG_INFO(LogCK, "방송 제목이 '%s' 태그로 확정돼 반응 태그를 고정합니다.", *BroadcastTag::ToDisplayString(SelectedTag));
281 }
282
283 SetReactionTag(SelectedTag);
284
285 // 반응 태그까지 고정한 뒤에 알린다. 구독자가 서브시스템 상태를 되물어도 일관되게 보인다.
286 // 함수 첫머리에서 확정 상태를 걸러내므로 여기서 참이면 방금 확정된 것이다.
287 if (bTitleConfirmed)
288 {
289 OnBroadcastTitleConfirmed.Broadcast(SelectedTag);
290 }
291}
#define LOG_INFO(Category, Format,...)
Definition CK_UE.h:38
ESituationTag
Definition SituationTag.h:17
FORCEINLINE int32 GetBroadcastTitleTagCount() const
Definition ConstellationSettings.h:52
FORCEINLINE ESituationTag GetSituationTags() const
Definition SituationBase.h:87
FORCEINLINE FName GetSituationID() const
Definition SituationBase.h:82
uint8 bTitleConfirmed
Definition StreamingSubsystem.h:190
void SetReactionTag(ESituationTag NewTag)
Definition StreamingSubsystem.cpp:294
FOnBroadcastTitleConfirmed OnBroadcastTitleConfirmed
Definition StreamingSubsystem.h:126
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ IsBroadcastTitleConfirmed()

FORCEINLINE bool UStreamingSubsystem::IsBroadcastTitleConfirmed ( ) const
inline
119 {
120 return bTitleConfirmed;
121 }

◆ IsWaitingInTaggedQueue()

bool UStreamingSubsystem::IsWaitingInTaggedQueue ( const UConstellationBase Constellation) const
protected
539{
540 if (Constellation == nullptr)
541 {
542 return false;
543 }
544
545 auto MatchesConstellation = [Constellation](const FConstellationChatEntry& Entry)
546 {
547 return Entry.Constellation == Constellation;
548 };
549
550 return TaggedQueue.ContainsByPredicate(MatchesConstellation);
551}
TArray< FConstellationChatEntry > TaggedQueue
Definition StreamingSubsystem.h:177
Definition StreamingSubsystem.h:45
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ OnWorldBeginPlay()

void UStreamingSubsystem::OnWorldBeginPlay ( UWorld &  InWorld)
overridevirtual
19{
20 Super::OnWorldBeginPlay(InWorld);
21
22 // 출력 펌프는 월드가 도는 동안 계속 돈다. 대기열이 비어 있으면 아무 일도 하지 않는다.
24
26}
void RestartOutputTimer()
Definition StreamingSubsystem.cpp:449
void StartChatFlow()
Definition StreamingSubsystem.cpp:208
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ OutputChat()

void UStreamingSubsystem::OutputChat ( const FConstellationChatEntry Entry,
bool  bTagged 
)
protected
464{
465 if (Entry.Constellation == nullptr)
466 {
467 return;
468 }
469
470 OnConstellationReaction.Broadcast(Entry.Constellation, Entry.ChatText, bTagged);
471}
FOnConstellationReaction OnConstellationReaction
Definition StreamingSubsystem.h:124
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ ProcessChatOutput()

void UStreamingSubsystem::ProcessChatOutput ( )
protected
405{
406 // 지연 검사는 채팅을 출력하려는 이 시점에만 한다. 생성할 때마다 하지 않는다.
408
409 // 둘 다 기다리고 있으면 태그 채팅이 먼저 나간다.
410 if (TaggedQueue.IsEmpty() == false)
411 {
412 const FConstellationChatEntry Entry = TaggedQueue[0];
413 TaggedQueue.RemoveAt(0);
414
415 OutputChat(Entry, true);
416 return;
417 }
418
419 if (NormalQueue.IsEmpty() == false)
420 {
421 const FConstellationChatEntry Entry = NormalQueue[0];
422 NormalQueue.RemoveAt(0);
423
424 OutputChat(Entry, false);
425 }
426}
void OutputChat(const FConstellationChatEntry &Entry, bool bTagged)
Definition StreamingSubsystem.cpp:463
void DiscardStaleNormalChats()
Definition StreamingSubsystem.cpp:429
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ ReactToSituation()

void UStreamingSubsystem::ReactToSituation ( UConstellationBase Constellation)
protected
92{
94
95 // 태그 채팅 문구가 비어 있으면 그 성좌는 이번 반응을 건너뛴다.
96 if (BuildChatEntry(Constellation, true, Entry) == false)
97 {
98 return;
99 }
100
101 // 즉시 띄우지 않고 태그 대기열에 넣는다. 출력 순서와 간격은 출력 펌프가 정한다.
102 TaggedQueue.Add(MoveTemp(Entry));
103}
bool BuildChatEntry(UConstellationBase *Constellation, bool bTagged, FConstellationChatEntry &OutEntry) const
Definition StreamingSubsystem.cpp:474
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ RegisterConstellation()

void UStreamingSubsystem::RegisterConstellation ( UConstellationBase Constellation)
46{
47 if (Constellation == nullptr)
48 {
49 return;
50 }
51
52 // 후보가 동나 재사용된 성좌가 들어올 수 있다. 이미 시청 중이면 다시 넣지 않는다.
53 auto MatchesConstellation = [Constellation](const FConstellationEntry& Entry)
54 {
55 return Entry.Constellation == Constellation;
56 };
57
58 if (Entries.ContainsByPredicate(MatchesConstellation))
59 {
60 return;
61 }
62
63 FConstellationEntry NewEntry;
64 NewEntry.Constellation = Constellation;
65 Entries.Add(MoveTemp(NewEntry));
66
67 OnConstellationRegistered.Broadcast(Constellation);
68}
FOnConstellationRegistered OnConstellationRegistered
Definition StreamingSubsystem.h:125

◆ RestartOutputTimer()

void UStreamingSubsystem::RestartOutputTimer ( )
protected
450{
451 UWorld* World = GetWorld();
452 const UConstellationSettings* Settings = GetChatSettings();
453
454 if (World == nullptr || Settings == nullptr)
455 {
456 return;
457 }
458
459 World->GetTimerManager().SetTimer(OutputTimerHandle, this, &UStreamingSubsystem::ProcessChatOutput, Settings->GetChatOutputInterval(), true);
460}
FORCEINLINE float GetChatOutputInterval() const
Definition ConstellationSettings.h:31
void ProcessChatOutput()
Definition StreamingSubsystem.cpp:404
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ ScheduleNormalSpawn()

void UStreamingSubsystem::ScheduleNormalSpawn ( )
protected
322{
323 UWorld* World = GetWorld();
324 const UConstellationSettings* Settings = GetChatSettings();
325
326 if (World == nullptr || Settings == nullptr)
327 {
328 return;
329 }
330
331 const float Interval = FMath::FRandRange(Settings->GetChatSpawnIntervalMin(), Settings->GetChatSpawnIntervalMax());
332
333 World->GetTimerManager().SetTimer(NormalSpawnTimerHandle, this, &UStreamingSubsystem::SpawnNormalChat, Interval, false);
334}
FORCEINLINE float GetChatSpawnIntervalMax() const
Definition ConstellationSettings.h:47
FORCEINLINE float GetChatSpawnIntervalMin() const
Definition ConstellationSettings.h:41
FTimerHandle NormalSpawnTimerHandle
Definition StreamingSubsystem.h:196
void SpawnNormalChat()
Definition StreamingSubsystem.cpp:353
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ ScheduleTaggedSpawn()

void UStreamingSubsystem::ScheduleTaggedSpawn ( )
protected
338{
339 UWorld* World = GetWorld();
340 const UConstellationSettings* Settings = GetChatSettings();
341
342 if (World == nullptr || Settings == nullptr)
343 {
344 return;
345 }
346
347 const float Interval = FMath::FRandRange(Settings->GetChatSpawnIntervalMin(), Settings->GetChatSpawnIntervalMax());
348
349 World->GetTimerManager().SetTimer(TaggedSpawnTimerHandle, this, &UStreamingSubsystem::SpawnTaggedChat, Interval, false);
350}
FTimerHandle TaggedSpawnTimerHandle
Definition StreamingSubsystem.h:197
void SpawnTaggedChat()
Definition StreamingSubsystem.cpp:383
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ SetReactionTag()

void UStreamingSubsystem::SetReactionTag ( ESituationTag  NewTag)
protected
295{
296 CurrentReactionTag = NewTag;
297
298 // 이전 태그로 뽑아둔 채팅은 더 이상 유효하지 않다. 일반 레인은 건드리지 않는다.
299 TaggedQueue.Reset();
300
302 {
304 }
305
306 // 첫 태그 채팅 한 줄만 출력 간격을 기다리지 않고 즉시 내보낸다.
307 FConstellationChatEntry FirstEntry;
308
309 if (BuildChatEntry(DrawChatSpeaker(true), true, FirstEntry) == false)
310 {
311 return;
312 }
313
314 OutputChat(FirstEntry, true);
315
316 // 즉시 반응을 낸 지금부터 다음 출력 간격을 다시 센다.
318}
void ScheduleTaggedSpawn()
Definition StreamingSubsystem.cpp:337
UConstellationBase * DrawChatSpeaker(bool bTagged) const
Definition StreamingSubsystem.cpp:496
uint8 bChatFlowRunning
Definition StreamingSubsystem.h:193
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ SpawnNormalChat()

void UStreamingSubsystem::SpawnNormalChat ( )
protected
354{
355 // 주기는 매번 다시 뽑는다. 추첨에 실패해도 레인은 계속 돌아야 한다.
357
358 UConstellationBase* Speaker = DrawChatSpeaker(false);
359
360 // 두 레인이 같은 성좌를 뽑으면 태그 쪽을 살리고 일반 쪽만 1회 재추첨한다.
361 if (IsWaitingInTaggedQueue(Speaker))
362 {
363 Speaker = DrawChatSpeaker(false);
364 }
365
366 // 재추첨도 겹치면 이번 일반 채팅 생성을 건너뛴다.
367 if (IsWaitingInTaggedQueue(Speaker))
368 {
369 return;
370 }
371
373
374 if (BuildChatEntry(Speaker, false, Entry) == false)
375 {
376 return;
377 }
378
379 NormalQueue.Add(MoveTemp(Entry));
380}
bool IsWaitingInTaggedQueue(const UConstellationBase *Constellation) const
Definition StreamingSubsystem.cpp:538
void ScheduleNormalSpawn()
Definition StreamingSubsystem.cpp:321
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ SpawnTaggedChat()

void UStreamingSubsystem::SpawnTaggedChat ( )
protected
384{
385 // 현재 반응 태그가 없으면 태그 레인은 멈춘 채로 둔다.
387 {
388 return;
389 }
390
392
394
395 if (BuildChatEntry(DrawChatSpeaker(true), true, Entry) == false)
396 {
397 return;
398 }
399
400 TaggedQueue.Add(MoveTemp(Entry));
401}
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ StartChatFlow()

void UStreamingSubsystem::StartChatFlow ( )
209{
211 {
212 return;
213 }
214
215 bChatFlowRunning = true;
216
218
219 // 반응 태그가 아직 없으면 태그 레인은 카드를 고를 때까지 멈춰 있는다.
221 {
223 }
224}
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ StopChatFlow()

void UStreamingSubsystem::StopChatFlow ( )
228{
229 bChatFlowRunning = false;
230
231 if (UWorld* World = GetWorld())
232 {
233 World->GetTimerManager().ClearTimer(NormalSpawnTimerHandle);
234 World->GetTimerManager().ClearTimer(TaggedSpawnTimerHandle);
235 }
236
237 // 아직 출력되지 않은 채팅만 버린다. 이미 화면에 올라간 줄은 UI 가 그대로 들고 있는다.
238 NormalQueue.Reset();
239 TaggedQueue.Reset();
240}
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ TriggerSituation()

void UStreamingSubsystem::TriggerSituation ( USituationBase Situation)
72{
73 if (Situation == nullptr)
74 {
75 return;
76 }
77
78 // 카드를 후원한 성좌가 대표로 반응한다. 나머지 성좌는 자기 일반 채팅 주기를 그대로 유지한다.
79 UConstellationBase* Sponsor = Situation->GetConstellation();
80
81 if (Sponsor == nullptr)
82 {
83 LOG_WARNING(LogCK, "상황 '%s'에 후원 성좌가 묶여 있지 않아 반응할 성좌가 없습니다.", *Situation->GetSituationID().ToString());
84 return;
85 }
86
87 ReactToSituation(Sponsor);
88}
UConstellationBase * GetConstellation() const
Definition SituationBase.cpp:413
void ReactToSituation(UConstellationBase *Constellation)
Definition StreamingSubsystem.cpp:91
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

멤버 데이터 문서화

◆ bChatFlowRunning

uint8 UStreamingSubsystem::bChatFlowRunning
protected

◆ bTitleConfirmed

uint8 UStreamingSubsystem::bTitleConfirmed
protected

◆ CurrentReactionTag

ESituationTag UStreamingSubsystem::CurrentReactionTag = ESituationTag::None
protected

◆ Entries

TArray<FConstellationEntry> UStreamingSubsystem::Entries
protected

◆ NormalQueue

TArray<FConstellationChatEntry> UStreamingSubsystem::NormalQueue
protected

◆ NormalSpawnTimerHandle

FTimerHandle UStreamingSubsystem::NormalSpawnTimerHandle
private

◆ OnBroadcastTitleConfirmed

FOnBroadcastTitleConfirmed UStreamingSubsystem::OnBroadcastTitleConfirmed

◆ OnConstellationReaction

FOnConstellationReaction UStreamingSubsystem::OnConstellationReaction

◆ OnConstellationRegistered

FOnConstellationRegistered UStreamingSubsystem::OnConstellationRegistered

◆ OutputTimerHandle

FTimerHandle UStreamingSubsystem::OutputTimerHandle
private

◆ SelectedTagHistory

TArray<ESituationTag> UStreamingSubsystem::SelectedTagHistory
protected

◆ TaggedQueue

TArray<FConstellationChatEntry> UStreamingSubsystem::TaggedQueue
protected

◆ TaggedSpawnTimerHandle

FTimerHandle UStreamingSubsystem::TaggedSpawnTimerHandle
private

이 클래스에 대한 문서화 페이지는 다음의 파일들로부터 생성되었습니다.: