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,
|
AetherReductionDlg = 0x17D,
|
||||||
|
|
||||||
|
PlayActionTimeline = 0x197,
|
||||||
/*!
|
/*!
|
||||||
* param1 = state
|
* param1 = state
|
||||||
* param2 = actorid
|
* param2 = actorid
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
#include <Territory/InstanceContent.h>
|
#include <Territory/InstanceContent.h>
|
||||||
#include <Util/UtilMath.h>
|
#include <Util/UtilMath.h>
|
||||||
|
|
||||||
|
#include <Network/CommonActorControl.h>
|
||||||
|
#include <Network/Util/PacketUtil.h>
|
||||||
|
|
||||||
namespace Sapphire::Encounter
|
namespace Sapphire::Encounter
|
||||||
{
|
{
|
||||||
const TimepointDataPtr Timepoint::getData() const
|
const TimepointDataPtr Timepoint::getData() const
|
||||||
|
@ -52,25 +55,26 @@ namespace Sapphire::Encounter
|
||||||
{
|
{
|
||||||
const static std::unordered_map< std::string, TimepointDataType > timepointTypeMap =
|
const static std::unordered_map< std::string, TimepointDataType > timepointTypeMap =
|
||||||
{
|
{
|
||||||
{ "idle", TimepointDataType::Idle },
|
{ "idle", TimepointDataType::Idle },
|
||||||
{ "castAction", TimepointDataType::CastAction },
|
{ "castAction", TimepointDataType::CastAction },
|
||||||
{ "setPos", TimepointDataType::SetPos },
|
{ "setPos", TimepointDataType::SetPos },
|
||||||
|
{ "playActionTimeLine", TimepointDataType::ActionTimeLine },
|
||||||
|
|
||||||
{ "logMessage", TimepointDataType::LogMessage },
|
{ "logMessage", TimepointDataType::LogMessage },
|
||||||
{ "battleTalk", TimepointDataType::BattleTalk },
|
{ "battleTalk", TimepointDataType::BattleTalk },
|
||||||
|
|
||||||
{ "directorVar", TimepointDataType::DirectorVar },
|
{ "directorVar", TimepointDataType::DirectorVar },
|
||||||
{ "directorSeq", TimepointDataType::DirectorSeq },
|
{ "directorSeq", TimepointDataType::DirectorSeq },
|
||||||
{ "directorFlags", TimepointDataType::DirectorFlags },
|
{ "directorFlags", TimepointDataType::DirectorFlags },
|
||||||
|
|
||||||
{ "bNpcDespawn", TimepointDataType::BNpcDespawn },
|
{ "bNpcDespawn", TimepointDataType::BNpcDespawn },
|
||||||
{ "bNpcSpawn", TimepointDataType::BNpcSpawn },
|
{ "bNpcSpawn", TimepointDataType::BNpcSpawn },
|
||||||
{ "bNpcFlags", TimepointDataType::BNpcFlags },
|
{ "bNpcFlags", TimepointDataType::BNpcFlags },
|
||||||
{ "setEObjState", TimepointDataType::SetEObjState },
|
{ "setEObjState", TimepointDataType::SetEObjState },
|
||||||
{ "setBGM", TimepointDataType::SetBgm },
|
{ "setBGM", TimepointDataType::SetBgm },
|
||||||
|
|
||||||
{ "setCondition", TimepointDataType::SetCondition },
|
{ "setCondition", TimepointDataType::SetCondition },
|
||||||
{ "snapshot", TimepointDataType::Snapshot }
|
{ "snapshot", TimepointDataType::Snapshot }
|
||||||
};
|
};
|
||||||
|
|
||||||
const static std::unordered_map< std::string, DirectorOpId > directorOpMap =
|
const static std::unordered_map< std::string, DirectorOpId > directorOpMap =
|
||||||
|
@ -149,6 +153,15 @@ namespace Sapphire::Encounter
|
||||||
pos[ 0 ], pos[ 1 ], pos[ 2 ], rot );
|
pos[ 0 ], pos[ 1 ], pos[ 2 ], rot );
|
||||||
}
|
}
|
||||||
break;
|
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:
|
case TimepointDataType::LogMessage:
|
||||||
{
|
{
|
||||||
auto& dataJ = json.at( "data" );
|
auto& dataJ = json.at( "data" );
|
||||||
|
@ -446,6 +459,21 @@ namespace Sapphire::Encounter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
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:
|
case TimepointDataType::MoveTo:
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,6 +18,7 @@ namespace Sapphire::Encounter
|
||||||
Idle,
|
Idle,
|
||||||
CastAction,
|
CastAction,
|
||||||
SetPos,
|
SetPos,
|
||||||
|
ActionTimeLine,
|
||||||
|
|
||||||
LogMessage,
|
LogMessage,
|
||||||
BattleTalk,
|
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 {
|
struct TimepointDataSetPos : public TimepointData {
|
||||||
// todo: use internal id
|
// todo: use internal id
|
||||||
std::string m_actorRef;
|
std::string m_actorRef;
|
||||||
|
|
Loading…
Add table
Reference in a new issue