Core/Packets: converted SMSG_TRIGGER_CINEMATIC, SMSG_TRIGGER_MOVIE, CMSG_COMPLETE_CINEMATIC, CMSG_NEXT_CINEMATIC_CAMERA, CMSG_COMPLETE_MOVIE and SMSG_STREAMING_MOVIES to packet class
This commit is contained in:
1 parent
183ac5fd7b
commit
b7f7e99d63
11 files changed
+150
-49
No files matched your search
@@ -204,6 +204,7 @@ Player::Player(WorldSession* session): Unit(true)
|
||||
m_trade = nullptr;
|
||||
|
||||
m_cinematic = 0;
|
||||
m_movie = 0;
|
||||
|
||||
PlayerTalkClass = new PlayerMenu(GetSession());
|
||||
m_currentBuybackSlot = BUYBACK_SLOT_START;
|
||||
@@ -6265,20 +6266,22 @@ void Player::SendDirectMessage(WorldPacket const* data) const
|
||||
m_session->SendPacket(data);
|
||||
}
|
||||
|
||||
void Player::SendCinematicStart(uint32 CinematicSequenceId) const
|
||||
void Player::SendCinematicStart(uint32 cinematicId)
|
||||
{
|
||||
WorldPacket data(SMSG_TRIGGER_CINEMATIC, 4);
|
||||
data << uint32(CinematicSequenceId);
|
||||
SendDirectMessage(&data);
|
||||
if (CinematicSequencesEntry const* sequence = sCinematicSequencesStore.LookupEntry(CinematicSequenceId))
|
||||
WorldPackets::Misc::TriggerCinematic packet;
|
||||
packet.CinematicID = cinematicId;
|
||||
SendDirectMessage(packet.Write());
|
||||
|
||||
if (CinematicSequencesEntry const* sequence = sCinematicSequencesStore.LookupEntry(cinematicId))
|
||||
_cinematicMgr->SetActiveCinematicCamera(sequence->Camera[0]);
|
||||
}
|
||||
|
||||
void Player::SendMovieStart(uint32 MovieId) const
|
||||
void Player::SendMovieStart(uint32 movieId)
|
||||
{
|
||||
WorldPacket data(SMSG_TRIGGER_MOVIE, 4);
|
||||
data << uint32(MovieId);
|
||||
SendDirectMessage(&data);
|
||||
SetMovie(movieId);
|
||||
WorldPackets::Misc::TriggerMovie packet;
|
||||
packet.MovieID = movieId;
|
||||
SendDirectMessage(packet.Write());
|
||||
}
|
||||
|
||||
void Player::CheckAreaExploreAndOutdoor()
|
||||
|
||||
@@ -1699,6 +1699,9 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
uint8 getCinematic() const { return m_cinematic; }
|
||||
void setCinematic(uint8 cine) { m_cinematic = cine; }
|
||||
|
||||
uint32 GetMovie() const { return m_movie; }
|
||||
void SetMovie(uint32 movie) { m_movie = movie; }
|
||||
|
||||
ActionButton* addActionButton(uint8 button, uint32 action, uint8 type);
|
||||
void removeActionButton(uint8 button);
|
||||
ActionButton const* GetActionButton(uint8 button);
|
||||
@@ -2217,8 +2220,8 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
void ResummonPetTemporaryUnSummonedIfAny();
|
||||
bool IsPetNeedBeTemporaryUnsummoned() const;
|
||||
|
||||
void SendCinematicStart(uint32 CinematicSequenceId) const;
|
||||
void SendMovieStart(uint32 MovieId) const;
|
||||
void SendCinematicStart(uint32 cinematicId);
|
||||
void SendMovieStart(uint32 movieId);
|
||||
|
||||
uint32 DoRandomRoll(uint32 minimum, uint32 maximum);
|
||||
|
||||
@@ -2608,6 +2611,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
JoinedChannelsList m_channels;
|
||||
|
||||
uint8 m_cinematic;
|
||||
uint32 m_movie;
|
||||
|
||||
TradeData* m_trade;
|
||||
|
||||
|
||||
@@ -2468,18 +2468,3 @@ void WorldSession::HandleReorderCharacters(WorldPacket& recvData)
|
||||
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
}
|
||||
|
||||
void WorldSession::HandleOpeningCinematic(WorldPacket& /*recvData*/)
|
||||
{
|
||||
// Only players that has not yet gained any experience can use this
|
||||
if (_player->GetUInt32Value(PLAYER_XP))
|
||||
return;
|
||||
|
||||
if (ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(_player->getClass()))
|
||||
{
|
||||
if (classEntry->CinematicSequenceID)
|
||||
_player->SendCinematicStart(classEntry->CinematicSequenceID);
|
||||
else if (ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(_player->getRace()))
|
||||
_player->SendCinematicStart(raceEntry->CinematicSequenceID);
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "MiscPackets.h"
|
||||
#include "Object.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
@@ -927,18 +928,22 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recvData)
|
||||
GetPlayer()->addActionButton(button, ACTION_BUTTON_ACTION(packetData), ACTION_BUTTON_TYPE(packetData));
|
||||
}
|
||||
|
||||
void WorldSession::HandleCompleteMovie(WorldPacket& /*recvData*/)
|
||||
void WorldSession::HandleCompleteMovie(WorldPackets::Misc::CompleteMovie& /*packet*/)
|
||||
{
|
||||
TC_LOG_DEBUG("network", "WORLD: Received CMSG_COMPLETE_MOVIE");
|
||||
uint32 movie = _player->GetMovie();
|
||||
if (!movie)
|
||||
return;
|
||||
|
||||
_player->SetMovie(0);
|
||||
}
|
||||
|
||||
void WorldSession::HandleCompleteCinematic(WorldPacket& /*recvData*/)
|
||||
void WorldSession::HandleCompleteCinematic(WorldPackets::Misc::CompleteCinematic& /*packet*/)
|
||||
{
|
||||
// If player has sight bound to visual waypoint NPC we should remove it
|
||||
GetPlayer()->GetCinematicMgr()->EndCinematic();
|
||||
}
|
||||
|
||||
void WorldSession::HandleNextCinematicCamera(WorldPacket& /*recvData*/)
|
||||
void WorldSession::HandleNextCinematicCamera(WorldPackets::Misc::NextCinematicCamera& /*packet*/)
|
||||
{
|
||||
// Sent by client when cinematic actually begun. So we begin the server side process
|
||||
GetPlayer()->GetCinematicMgr()->BeginCinematic();
|
||||
@@ -1978,17 +1983,10 @@ void WorldSession::HandleChangePlayerDifficulty(WorldPacket& recvData)
|
||||
|
||||
void WorldSession::SendStreamingMovie()
|
||||
{
|
||||
uint8 count = 0;
|
||||
WorldPacket data(SMSG_STREAMING_MOVIE, 4+(2*count));
|
||||
WorldPackets::Misc::StreamingMovies packet;
|
||||
|
||||
data.WriteBits(count, 25);
|
||||
|
||||
for(int8 i = 0; i < 0; ++i)
|
||||
{
|
||||
data << uint16(0); //File Data ID
|
||||
}
|
||||
|
||||
SendPacket(&data);
|
||||
// To-do: implement
|
||||
SendPacket(packet.Write());
|
||||
}
|
||||
|
||||
void WorldSession::HandleRequestResearchHistory(WorldPacket & /*recv_data*/)
|
||||
@@ -1996,3 +1994,18 @@ void WorldSession::HandleRequestResearchHistory(WorldPacket & /*recv_data*/)
|
||||
if (Player* player = GetPlayer())
|
||||
player->NotifyRequestResearchHistory();
|
||||
}
|
||||
|
||||
void WorldSession::HandleOpeningCinematic(WorldPackets::Misc::OpeningCinematic& /*packet*/)
|
||||
{
|
||||
// Only players that has not yet gained any experience can use this
|
||||
if (_player->GetUInt32Value(PLAYER_XP))
|
||||
return;
|
||||
|
||||
if (ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(_player->getClass()))
|
||||
{
|
||||
if (classEntry->CinematicSequenceID)
|
||||
_player->SendCinematicStart(classEntry->CinematicSequenceID);
|
||||
else if (ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(_player->getRace()))
|
||||
_player->SendCinematicStart(raceEntry->CinematicSequenceID);
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "CharacterPackets.h"
|
||||
#include "GuildPackets.h"
|
||||
#include "LFGPackets.h"
|
||||
#include "MiscPackets.h"
|
||||
#include "NPCPackets.h"
|
||||
#include "QuestPackets.h"
|
||||
#include "SystemPackets.h"
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef MiscPackets_h__
|
||||
#define MiscPackets_h__
|
||||
#ifndef CharacterPackets_h__
|
||||
#define CharacterPackets_h__
|
||||
|
||||
#include "Packet.h"
|
||||
#include "ObjectGuid.h"
|
||||
|
||||
@@ -61,3 +61,28 @@ WorldPacket const* WorldPackets::Misc::RequestPVPRewardsResponse::Write()
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::Misc::TriggerMovie::Write()
|
||||
{
|
||||
_worldPacket << int32(MovieID);
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
WorldPacket const* WorldPackets::Misc::TriggerCinematic::Write()
|
||||
{
|
||||
_worldPacket << int32(CinematicID);
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::Misc::StreamingMovies::Write()
|
||||
{
|
||||
_worldPacket.WriteBits(MovieIDs.size(), 25);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
for (uint16 moveId : MovieIDs)
|
||||
_worldPacket << int16(moveId);
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
@@ -61,6 +61,68 @@ namespace WorldPackets
|
||||
int32 ArenaMaxRewardPointsThisWeek = 0;
|
||||
int32 MaxRewardPointsThisWeek = 0;
|
||||
};
|
||||
|
||||
class TriggerCinematic final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
TriggerCinematic() : ServerPacket(SMSG_TRIGGER_CINEMATIC, 4) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
uint32 CinematicID = 0;
|
||||
};
|
||||
|
||||
class TriggerMovie final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
TriggerMovie() : ServerPacket(SMSG_TRIGGER_MOVIE, 4) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
uint32 MovieID = 0;
|
||||
};
|
||||
|
||||
class CompleteCinematic final : public ClientPacket
|
||||
{
|
||||
public:
|
||||
CompleteCinematic(WorldPacket&& packet) : ClientPacket(CMSG_COMPLETE_CINEMATIC, std::move(packet)) { }
|
||||
|
||||
void Read() override { }
|
||||
};
|
||||
|
||||
class NextCinematicCamera final : public ClientPacket
|
||||
{
|
||||
public:
|
||||
NextCinematicCamera(WorldPacket&& packet) : ClientPacket(CMSG_NEXT_CINEMATIC_CAMERA, std::move(packet)) { }
|
||||
|
||||
void Read() override { }
|
||||
};
|
||||
|
||||
class CompleteMovie final : public ClientPacket
|
||||
{
|
||||
public:
|
||||
CompleteMovie(WorldPacket&& packet) : ClientPacket(CMSG_COMPLETE_MOVIE, std::move(packet)) { }
|
||||
|
||||
void Read() override { }
|
||||
};
|
||||
|
||||
class OpeningCinematic final : public ClientPacket
|
||||
{
|
||||
public:
|
||||
OpeningCinematic(WorldPacket&& packet) : ClientPacket(CMSG_OPENING_CINEMATIC, std::move(packet)) { }
|
||||
|
||||
void Read() override { }
|
||||
};
|
||||
|
||||
class StreamingMovies final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
StreamingMovies() : ServerPacket(SMSG_STREAMING_MOVIES) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
std::vector<uint16> MovieIDs;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -277,7 +277,7 @@ void OpcodeTable::Initialize()
|
||||
DEFINE_HANDLER(CMSG_COMMENTATOR_START_WARGAME, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
||||
DEFINE_HANDLER(CMSG_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleComplainOpcode );
|
||||
DEFINE_HANDLER(CMSG_COMPLETE_CINEMATIC, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCompleteCinematic );
|
||||
DEFINE_HANDLER(CMSG_COMPLETE_MOVIE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleCompleteMovie );
|
||||
DEFINE_HANDLER(CMSG_COMPLETE_MOVIE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCompleteMovie );
|
||||
DEFINE_HANDLER(CMSG_CONNECT_TO_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess );
|
||||
DEFINE_HANDLER(CMSG_CONTACT_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleContactListOpcode );
|
||||
DEFINE_HANDLER(CMSG_CORPSE_MAP_POSITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseMapPositionQuery );
|
||||
@@ -1273,7 +1273,7 @@ void OpcodeTable::Initialize()
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_START_TIMER, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_STOP_DANCE, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_STOP_MIRROR_TIMER, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_STREAMING_MOVIE, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_STREAMING_MOVIES, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SUMMON_CANCEL, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SUMMON_REQUEST, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SUPERCEDED_SPELL, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
|
||||
|
||||
@@ -1233,7 +1233,7 @@ enum OpcodeServer
|
||||
SMSG_START_TIMER = 0x59A5,
|
||||
SMSG_STOP_DANCE = 0x4637,
|
||||
SMSG_STOP_MIRROR_TIMER = 0x0B06,
|
||||
SMSG_STREAMING_MOVIE = 0x15B7,
|
||||
SMSG_STREAMING_MOVIES = 0x15B7,
|
||||
SMSG_SUMMON_CANCEL = 0x0B34,
|
||||
SMSG_SUMMON_REQUEST = 0x2A07,
|
||||
SMSG_SUPERCEDED_SPELL = 0x35B0,
|
||||
|
||||
@@ -131,6 +131,14 @@ namespace WorldPackets
|
||||
class RequestGuildRewardsList;
|
||||
}
|
||||
|
||||
namespace Misc
|
||||
{
|
||||
class CompleteCinematic;
|
||||
class CompleteMovie;
|
||||
class NextCinematicCamera;
|
||||
class OpeningCinematic;
|
||||
}
|
||||
|
||||
namespace NPC
|
||||
{
|
||||
class Hello;
|
||||
@@ -577,10 +585,10 @@ class TC_GAME_API WorldSession
|
||||
void HandleAlterAppearance(WorldPacket& recvData);
|
||||
void HandleCharCustomize(WorldPacket& recvData);
|
||||
void HandleCharCustomizeCallback(std::shared_ptr<CharacterCustomizeInfo> customizeInfo, PreparedQueryResult result);
|
||||
void HandleOpeningCinematic(WorldPackets::Misc::OpeningCinematic& packet);
|
||||
|
||||
void HandleRandomizeCharNameOpcode(WorldPacket& recvData);
|
||||
void HandleReorderCharacters(WorldPacket& recvData);
|
||||
void HandleOpeningCinematic(WorldPacket& recvData);
|
||||
void SendCharCreate(ResponseCodes result);
|
||||
void SendCharDelete(ResponseCodes result);
|
||||
void SendCharRename(ResponseCodes result, CharacterRenameInfo const* renameInfo);
|
||||
@@ -940,9 +948,9 @@ class TC_GAME_API WorldSession
|
||||
void HandleSetChannelWatch(WorldPacket& recvPacket);
|
||||
void HandleUnsetChannelWatch(WorldPacket& recvPacket);
|
||||
|
||||
void HandleCompleteMovie(WorldPacket& recvPacket);
|
||||
void HandleCompleteCinematic(WorldPacket& recvPacket);
|
||||
void HandleNextCinematicCamera(WorldPacket& recvPacket);
|
||||
void HandleCompleteCinematic(WorldPackets::Misc::CompleteCinematic& packet);
|
||||
void HandleNextCinematicCamera(WorldPackets::Misc::NextCinematicCamera& packet);
|
||||
void HandleCompleteMovie(WorldPackets::Misc::CompleteMovie& packet);
|
||||
|
||||
void HandlePageTextQueryOpcode(WorldPacket& recvPacket);
|
||||
|
||||
|
||||
Reference in new issue
Block a user