Core/PacketIO: Implemented splash screen opcodes

This commit is contained in:
Shauren
2021-11-12 21:53:40 +01:00
parent c1915d386c
commit 14b8d7d839
12 changed files with 170 additions and 2 deletions

View File

@@ -1171,3 +1171,20 @@ void WorldSession::HandleConversationLineStarted(WorldPackets::Misc::Conversatio
if (Conversation* convo = ObjectAccessor::GetConversation(*_player, conversationLineStarted.ConversationGUID))
sScriptMgr->OnConversationLineStarted(convo, conversationLineStarted.LineID, _player);
}
void WorldSession::HandleRequestLatestSplashScreen(WorldPackets::Misc::RequestLatestSplashScreen& /*requestLatestSplashScreen*/)
{
UISplashScreenEntry const* splashScreen = nullptr;
for (auto itr = sUISplashScreenStore.begin(); itr != sUISplashScreenStore.end(); ++itr)
{
if (PlayerConditionEntry const* playerCondition = sPlayerConditionStore.LookupEntry(itr->CharLevelConditionID))
if (!ConditionMgr::IsPlayerMeetingCondition(_player, playerCondition))
continue;
splashScreen = *itr;
}
WorldPackets::Misc::SplashScreenShowLatest splashScreenShowLatest;
splashScreenShowLatest.UISplashScreenID = splashScreen ? splashScreen->ID : 0;
SendPacket(splashScreenShowLatest.Write());
}