mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-03 09:17:47 +00:00
Timpoint for actiontimeline
This commit is contained in:
parent
d08906e736
commit
866103c9d5
3 changed files with 57 additions and 15 deletions
|
@ -210,6 +210,7 @@ namespace Sapphire::Network::ActorControl
|
|||
*/
|
||||
AetherReductionDlg = 0x17D,
|
||||
|
||||
PlayActionTimeline = 0x197,
|
||||
/*!
|
||||
* param1 = state
|
||||
* param2 = actorid
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
#include <Territory/InstanceContent.h>
|
||||
#include <Util/UtilMath.h>
|
||||
|
||||
#include <Network/CommonActorControl.h>
|
||||
#include <Network/Util/PacketUtil.h>
|
||||
|
||||
namespace Sapphire::Encounter
|
||||
{
|
||||
const TimepointDataPtr Timepoint::getData() const
|
||||
|
@ -52,25 +55,26 @@ namespace Sapphire::Encounter
|
|||
{
|
||||
const static std::unordered_map< std::string, TimepointDataType > timepointTypeMap =
|
||||
{
|
||||
{ "idle", TimepointDataType::Idle },
|
||||
{ "castAction", TimepointDataType::CastAction },
|
||||
{ "setPos", TimepointDataType::SetPos },
|
||||
{ "idle", TimepointDataType::Idle },
|
||||
{ "castAction", TimepointDataType::CastAction },
|
||||
{ "setPos", TimepointDataType::SetPos },
|
||||
{ "playActionTimeLine", TimepointDataType::ActionTimeLine },
|
||||
|
||||
{ "logMessage", TimepointDataType::LogMessage },
|
||||
{ "battleTalk", TimepointDataType::BattleTalk },
|
||||
{ "logMessage", TimepointDataType::LogMessage },
|
||||
{ "battleTalk", TimepointDataType::BattleTalk },
|
||||
|
||||
{ "directorVar", TimepointDataType::DirectorVar },
|
||||
{ "directorSeq", TimepointDataType::DirectorSeq },
|
||||
{ "directorFlags", TimepointDataType::DirectorFlags },
|
||||
{ "directorVar", TimepointDataType::DirectorVar },
|
||||
{ "directorSeq", TimepointDataType::DirectorSeq },
|
||||
{ "directorFlags", TimepointDataType::DirectorFlags },
|
||||
|
||||
{ "bNpcDespawn", TimepointDataType::BNpcDespawn },
|
||||
{ "bNpcSpawn", TimepointDataType::BNpcSpawn },
|
||||
{ "bNpcFlags", TimepointDataType::BNpcFlags },
|
||||
{ "setEObjState", TimepointDataType::SetEObjState },
|
||||
{ "setBGM", TimepointDataType::SetBgm },
|
||||
{ "bNpcDespawn", TimepointDataType::BNpcDespawn },
|
||||
{ "bNpcSpawn", TimepointDataType::BNpcSpawn },
|
||||
{ "bNpcFlags", TimepointDataType::BNpcFlags },
|
||||
{ "setEObjState", TimepointDataType::SetEObjState },
|
||||
{ "setBGM", TimepointDataType::SetBgm },
|
||||
|
||||
{ "setCondition", TimepointDataType::SetCondition },
|
||||
{ "snapshot", TimepointDataType::Snapshot }
|
||||
{ "setCondition", TimepointDataType::SetCondition },
|
||||
{ "snapshot", TimepointDataType::Snapshot }
|
||||
};
|
||||
|
||||
const static std::unordered_map< std::string, DirectorOpId > directorOpMap =
|
||||
|
@ -149,6 +153,15 @@ namespace Sapphire::Encounter
|
|||
pos[ 0 ], pos[ 1 ], pos[ 2 ], rot );
|
||||
}
|
||||
break;
|
||||
case TimepointDataType::ActionTimeLine:
|
||||
{
|
||||
auto& dataJ = json.at( "data" );
|
||||
auto action = dataJ.at( "action" ).get< uint32_t >();
|
||||
auto actorRef = dataJ.at( "actorName" ).get< std::string >();
|
||||
|
||||
m_pData = std::make_shared< TimepointDataActionTimeLine >( actorRef, action );
|
||||
}
|
||||
break;
|
||||
case TimepointDataType::LogMessage:
|
||||
{
|
||||
auto& dataJ = json.at( "data" );
|
||||
|
@ -446,6 +459,21 @@ namespace Sapphire::Encounter
|
|||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case TimepointDataType::ActionTimeLine:
|
||||
{
|
||||
auto pActionTimelineData = std::dynamic_pointer_cast< TimepointDataActionTimeLine, TimepointData >( m_pData );
|
||||
auto pBNpc = pack.getBNpcByRef( pActionTimelineData->m_actorRef, pTeri );
|
||||
auto action = pActionTimelineData->m_actionId;
|
||||
|
||||
if( pBNpc )
|
||||
{
|
||||
Network::Util::Packet::sendActorControl( pBNpc->getInRangePlayerIds(), pBNpc->getId(),
|
||||
Network::ActorControl::PlayActionTimeline, action );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
/*
|
||||
case TimepointDataType::MoveTo:
|
||||
{
|
||||
|
|
|
@ -18,6 +18,7 @@ namespace Sapphire::Encounter
|
|||
Idle,
|
||||
CastAction,
|
||||
SetPos,
|
||||
ActionTimeLine,
|
||||
|
||||
LogMessage,
|
||||
BattleTalk,
|
||||
|
@ -113,6 +114,18 @@ namespace Sapphire::Encounter
|
|||
}
|
||||
};
|
||||
|
||||
struct TimepointDataActionTimeLine : public TimepointData {
|
||||
std::string m_actorRef;
|
||||
uint32_t m_actionId;
|
||||
|
||||
TimepointDataActionTimeLine( const std::string& actorRef, uint32_t action ) :
|
||||
TimepointData( TimepointDataType::ActionTimeLine ),
|
||||
m_actorRef( actorRef ),
|
||||
m_actionId( action )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
struct TimepointDataSetPos : public TimepointData {
|
||||
// todo: use internal id
|
||||
std::string m_actorRef;
|
||||
|
|
Loading…
Add table
Reference in a new issue