mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-25 02:57:45 +00:00
Merge branch 'master' of https://github.com/SapphireMordred/Sapphire into party_crap
This commit is contained in:
commit
aeae64a8d5
48 changed files with 420 additions and 343 deletions
|
@ -1,5 +1,5 @@
|
||||||
# Sapphire - FINAL FANTASY XIV Server Emulator
|
# Sapphire - FINAL FANTASY XIV Server Emulator
|
||||||
[](https://discord.gg/KfrZCkx)
|
[](https://discord.gg/xxcdCER)
|
||||||
[](https://travis-ci.org/SapphireMordred/Sapphire)
|
[](https://travis-ci.org/SapphireMordred/Sapphire)
|
||||||
[](https://ci.appveyor.com/project/SapphireMordred/Sapphire)
|
[](https://ci.appveyor.com/project/SapphireMordred/Sapphire)
|
||||||

|

|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 2d0e1a962d13c8e07d1131789642e044eb489579
|
Subproject commit 8a26ae78e37701a9b66e7200f1e0ad3387da17c3
|
|
@ -169,6 +169,8 @@ inline istream& operator>>(istream& is, FFXIVARR_IPC_HEADER& hdr)
|
||||||
return is.read(reinterpret_cast<char*>(&hdr), sizeof hdr);
|
return is.read(reinterpret_cast<char*>(&hdr), sizeof hdr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} /* Packets */
|
} /* Packets */
|
||||||
} /* Network */
|
} /* Network */
|
||||||
} /* Core */
|
} /* Core */
|
||||||
|
|
|
@ -22,6 +22,12 @@ class GamePacketNew;
|
||||||
template <typename T, typename T1>
|
template <typename T, typename T1>
|
||||||
std::ostream& operator<< ( std::ostream& os, const GamePacketNew<T, T1>& packet );
|
std::ostream& operator<< ( std::ostream& os, const GamePacketNew<T, T1>& packet );
|
||||||
|
|
||||||
|
template< class T >
|
||||||
|
using ZoneChannelPacket = GamePacketNew< T, ServerZoneIpcType >;
|
||||||
|
|
||||||
|
template< class T >
|
||||||
|
using ChatChannelPacket = GamePacketNew< T, ServerChatIpcType >;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of a game packet. Needed for parsing packets.
|
* The base implementation of a game packet. Needed for parsing packets.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -50,7 +50,7 @@ void Core::Action::ActionCast::onStart()
|
||||||
m_pSource->getAsPlayer()->sendDebug( "onStart()" );
|
m_pSource->getAsPlayer()->sendDebug( "onStart()" );
|
||||||
m_startTime = Util::getTimeMs();
|
m_startTime = Util::getTimeMs();
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcActorCast, ServerZoneIpcType > castPacket( m_pSource->getId() );
|
ZoneChannelPacket< FFXIVIpcActorCast > castPacket( m_pSource->getId() );
|
||||||
|
|
||||||
castPacket.data().action_id = m_id;
|
castPacket.data().action_id = m_id;
|
||||||
castPacket.data().skillType = Common::SkillType::Normal;
|
castPacket.data().skillType = Common::SkillType::Normal;
|
||||||
|
|
|
@ -49,7 +49,7 @@ void Core::Action::ActionMount::onStart()
|
||||||
m_pSource->getAsPlayer()->sendDebug( "ActionMount::onStart()" );
|
m_pSource->getAsPlayer()->sendDebug( "ActionMount::onStart()" );
|
||||||
m_startTime = Util::getTimeMs();
|
m_startTime = Util::getTimeMs();
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcActorCast, ServerZoneIpcType > castPacket( m_pSource->getId() );
|
ZoneChannelPacket< FFXIVIpcActorCast > castPacket( m_pSource->getId() );
|
||||||
|
|
||||||
castPacket.data().action_id = m_id;
|
castPacket.data().action_id = m_id;
|
||||||
castPacket.data().skillType = Common::SkillType::MountSkill;
|
castPacket.data().skillType = Common::SkillType::MountSkill;
|
||||||
|
@ -74,7 +74,7 @@ void Core::Action::ActionMount::onFinish()
|
||||||
pPlayer->unsetStateFlag( PlayerStateFlag::Casting );
|
pPlayer->unsetStateFlag( PlayerStateFlag::Casting );
|
||||||
pPlayer->sendStateFlags();
|
pPlayer->sendStateFlags();
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket(pPlayer->getId());
|
ZoneChannelPacket< FFXIVIpcEffect > effectPacket(pPlayer->getId());
|
||||||
effectPacket.data().targetId = pPlayer->getId();
|
effectPacket.data().targetId = pPlayer->getId();
|
||||||
effectPacket.data().actionAnimationId = m_id;
|
effectPacket.data().actionAnimationId = m_id;
|
||||||
effectPacket.data().unknown_62 = 13; // Affects displaying action name next to number in floating text
|
effectPacket.data().unknown_62 = 13; // Affects displaying action name next to number in floating text
|
||||||
|
|
|
@ -45,7 +45,7 @@ void Core::Action::ActionTeleport::onStart()
|
||||||
|
|
||||||
m_startTime = Util::getTimeMs();
|
m_startTime = Util::getTimeMs();
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcActorCast, ServerZoneIpcType > castPacket( m_pSource->getId() );
|
ZoneChannelPacket< FFXIVIpcActorCast > castPacket( m_pSource->getId() );
|
||||||
|
|
||||||
castPacket.data().action_id = 5;
|
castPacket.data().action_id = 5;
|
||||||
castPacket.data().unknown = 1;
|
castPacket.data().unknown = 1;
|
||||||
|
@ -83,7 +83,7 @@ void Core::Action::ActionTeleport::onFinish()
|
||||||
|
|
||||||
pPlayer->setZoningType( Common::ZoneingType::Teleport );
|
pPlayer->setZoningType( Common::ZoneingType::Teleport );
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( pPlayer->getId() );
|
ZoneChannelPacket< FFXIVIpcEffect > effectPacket( pPlayer->getId() );
|
||||||
effectPacket.data().targetId = pPlayer->getId();
|
effectPacket.data().targetId = pPlayer->getId();
|
||||||
effectPacket.data().actionAnimationId = 5;
|
effectPacket.data().actionAnimationId = 5;
|
||||||
//effectPacket.data().unknown_3 = 1;
|
//effectPacket.data().unknown_3 = 1;
|
||||||
|
|
|
@ -2,12 +2,13 @@
|
||||||
#include <src/servers/Server_Common/Util/UtilMath.h>
|
#include <src/servers/Server_Common/Util/UtilMath.h>
|
||||||
#include <src/servers/Server_Common/Network/PacketContainer.h>
|
#include <src/servers/Server_Common/Network/PacketContainer.h>
|
||||||
#include <src/servers/Server_Common/Exd/ExdData.h>
|
#include <src/servers/Server_Common/Exd/ExdData.h>
|
||||||
|
#include <src/servers/Server_Common/Network/GamePacket.h>
|
||||||
|
|
||||||
#include "src/servers/Server_Zone/Forwards.h"
|
#include "src/servers/Server_Zone/Forwards.h"
|
||||||
#include "src/servers/Server_Zone/Action/Action.h"
|
#include "src/servers/Server_Zone/Action/Action.h"
|
||||||
#include "Actor.h"
|
|
||||||
#include "src/servers/Server_Zone/Zone/Zone.h"
|
#include "src/servers/Server_Zone/Zone/Zone.h"
|
||||||
#include <src/servers/Server_Common/Network/GamePacket.h>
|
|
||||||
#include "src/servers/Server_Zone/Network/GameConnection.h"
|
#include "src/servers/Server_Zone/Network/GameConnection.h"
|
||||||
#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h"
|
#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h"
|
||||||
#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h"
|
#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h"
|
||||||
|
@ -19,7 +20,8 @@
|
||||||
#include "src/servers/Server_Zone/Action/ActionCollision.h"
|
#include "src/servers/Server_Zone/Action/ActionCollision.h"
|
||||||
#include "src/servers/Server_Zone/ServerZone.h"
|
#include "src/servers/Server_Zone/ServerZone.h"
|
||||||
#include "src/servers/Server_Zone/Session.h"
|
#include "src/servers/Server_Zone/Session.h"
|
||||||
#include "CalcBattle.h"
|
#include "src/servers/Server_Zone/Math/CalcBattle.h"
|
||||||
|
#include "Actor.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
|
|
||||||
extern Core::ServerZone g_serverZone;
|
extern Core::ServerZone g_serverZone;
|
||||||
|
@ -626,7 +628,7 @@ void Core::Entity::Actor::autoAttack( ActorPtr pTarget )
|
||||||
uint32_t damage = 10 + rand() % 12;
|
uint32_t damage = 10 + rand() % 12;
|
||||||
uint32_t variation = 0 + rand() % 4;
|
uint32_t variation = 0 + rand() % 4;
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( getId() );
|
ZoneChannelPacket< FFXIVIpcEffect > effectPacket( getId() );
|
||||||
effectPacket.data().targetId = pTarget->getId();
|
effectPacket.data().targetId = pTarget->getId();
|
||||||
effectPacket.data().actionAnimationId = 0x366;
|
effectPacket.data().actionAnimationId = 0x366;
|
||||||
effectPacket.data().unknown_2 = variation;
|
effectPacket.data().unknown_2 = variation;
|
||||||
|
@ -669,7 +671,7 @@ void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint32_t actionId, u
|
||||||
// Todo: Effect packet generator. 90% of this is basically setting params and it's basically unreadable.
|
// Todo: Effect packet generator. 90% of this is basically setting params and it's basically unreadable.
|
||||||
// Prepare packet. This is seemingly common for all packets in the action handler.
|
// Prepare packet. This is seemingly common for all packets in the action handler.
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( getId() );
|
ZoneChannelPacket< FFXIVIpcEffect > effectPacket( getId() );
|
||||||
effectPacket.data().targetId = pTarget.getId();
|
effectPacket.data().targetId = pTarget.getId();
|
||||||
effectPacket.data().actionAnimationId = actionId;
|
effectPacket.data().actionAnimationId = actionId;
|
||||||
effectPacket.data().unknown_62 = 1; // Affects displaying action name next to number in floating text
|
effectPacket.data().unknown_62 = 1; // Affects displaying action name next to number in floating text
|
||||||
|
@ -738,7 +740,7 @@ void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint32_t actionId, u
|
||||||
|
|
||||||
case ActionEffectType::Heal:
|
case ActionEffectType::Heal:
|
||||||
{
|
{
|
||||||
uint32_t calculatedHeal = Data::CalcBattle::calculateHealValue( getAsPlayer(), static_cast< uint32_t >( param1 ) );
|
uint32_t calculatedHeal = Math::CalcBattle::calculateHealValue( getAsPlayer(), static_cast< uint32_t >( param1 ) );
|
||||||
|
|
||||||
effectPacket.data().effects[0].value = calculatedHeal;
|
effectPacket.data().effects[0].value = calculatedHeal;
|
||||||
effectPacket.data().effects[0].effectType = ActionEffectType::Heal;
|
effectPacket.data().effects[0].effectType = ActionEffectType::Heal;
|
||||||
|
|
|
@ -66,7 +66,7 @@ Core::Entity::BattleNpc::BattleNpc( uint32_t modelId, uint32_t nameid, const Com
|
||||||
m_currentStance = Stance::Passive;
|
m_currentStance = Stance::Passive;
|
||||||
|
|
||||||
m_class = ClassJob::Gladiator;
|
m_class = ClassJob::Gladiator;
|
||||||
m_level = level > 0 ? level : 60;
|
m_level = level > 0 ? level : 70;
|
||||||
|
|
||||||
m_modelId = modelId;
|
m_modelId = modelId;
|
||||||
m_nameId = nameid;
|
m_nameId = nameid;
|
||||||
|
@ -125,7 +125,7 @@ void Core::Entity::BattleNpc::spawn( Core::Entity::PlayerPtr pTarget )
|
||||||
|
|
||||||
//pTarget->queuePacket( spawnPacket );
|
//pTarget->queuePacket( spawnPacket );
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcNpcSpawn, ServerZoneIpcType > spawnPacket( getId(), pTarget->getId() );
|
ZoneChannelPacket< FFXIVIpcNpcSpawn > spawnPacket( getId(), pTarget->getId() );
|
||||||
|
|
||||||
|
|
||||||
spawnPacket.data().pos.x = m_pos.x;
|
spawnPacket.data().pos.x = m_pos.x;
|
||||||
|
@ -223,14 +223,14 @@ void Core::Entity::BattleNpc::setOwner( Core::Entity::PlayerPtr pPlayer )
|
||||||
|
|
||||||
if( pPlayer != nullptr )
|
if( pPlayer != nullptr )
|
||||||
{
|
{
|
||||||
GamePacketNew< FFXIVIpcActorOwner, ServerZoneIpcType > setOwnerPacket( getId(), pPlayer->getId() );
|
ZoneChannelPacket< FFXIVIpcActorOwner > setOwnerPacket( getId(), pPlayer->getId() );
|
||||||
setOwnerPacket.data().type = 0x01;
|
setOwnerPacket.data().type = 0x01;
|
||||||
setOwnerPacket.data().actorId = pPlayer->getId();
|
setOwnerPacket.data().actorId = pPlayer->getId();
|
||||||
sendToInRangeSet( setOwnerPacket );
|
sendToInRangeSet( setOwnerPacket );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GamePacketNew< FFXIVIpcActorOwner, ServerZoneIpcType > setOwnerPacket(getId(), INVALID_GAME_OBJECT_ID );
|
ZoneChannelPacket< FFXIVIpcActorOwner > setOwnerPacket(getId(), INVALID_GAME_OBJECT_ID );
|
||||||
setOwnerPacket.data().type = 0x01;
|
setOwnerPacket.data().type = 0x01;
|
||||||
setOwnerPacket.data().actorId = INVALID_GAME_OBJECT_ID;
|
setOwnerPacket.data().actorId = INVALID_GAME_OBJECT_ID;
|
||||||
sendToInRangeSet( setOwnerPacket );
|
sendToInRangeSet( setOwnerPacket );
|
||||||
|
@ -489,6 +489,8 @@ void Core::Entity::BattleNpc::update( int64_t currTime )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !m_pStatusEffectContainer )
|
||||||
|
initStatusEffectContainer();
|
||||||
m_pStatusEffectContainer->update();
|
m_pStatusEffectContainer->update();
|
||||||
float distance = Math::Util::distance( m_pos.x, m_pos.y, m_pos.z,
|
float distance = Math::Util::distance( m_pos.x, m_pos.y, m_pos.z,
|
||||||
m_posOrigin.x, m_posOrigin.y, m_posOrigin.z );
|
m_posOrigin.x, m_posOrigin.y, m_posOrigin.z );
|
||||||
|
|
|
@ -41,7 +41,8 @@
|
||||||
#include "src/servers/Server_Zone/Action/EventAction.h"
|
#include "src/servers/Server_Zone/Action/EventAction.h"
|
||||||
#include "src/servers/Server_Zone/Action/EventItemAction.h"
|
#include "src/servers/Server_Zone/Action/EventItemAction.h"
|
||||||
#include "src/servers/Server_Zone/Zone/ZonePosition.h"
|
#include "src/servers/Server_Zone/Zone/ZonePosition.h"
|
||||||
#include "src/servers/Server_Zone/Actor/CalcBattle.h"
|
#include "src/servers/Server_Zone/Math/CalcStats.h"
|
||||||
|
#include "src/servers/Server_Zone/Math/CalcBattle.h"
|
||||||
#include <boost/make_shared.hpp>
|
#include <boost/make_shared.hpp>
|
||||||
|
|
||||||
extern Core::Logger g_log;
|
extern Core::Logger g_log;
|
||||||
|
@ -71,7 +72,8 @@ Core::Entity::Player::Player() :
|
||||||
m_bMarkedForZoning( false ),
|
m_bMarkedForZoning( false ),
|
||||||
m_zoningType( Common::ZoneingType::None ),
|
m_zoningType( Common::ZoneingType::None ),
|
||||||
m_bAutoattack( false ),
|
m_bAutoattack( false ),
|
||||||
m_markedForRemoval( false )
|
m_markedForRemoval( false ),
|
||||||
|
m_mount( 0 )
|
||||||
{
|
{
|
||||||
m_id = 0;
|
m_id = 0;
|
||||||
m_type = ActorType::Player;
|
m_type = ActorType::Player;
|
||||||
|
@ -198,7 +200,7 @@ uint64_t Core::Entity::Player::getOnlineStatusMask() const
|
||||||
|
|
||||||
void Core::Entity::Player::prepareZoning( uint16_t targetZone, bool fadeOut, uint8_t fadeOutTime, uint16_t animation )
|
void Core::Entity::Player::prepareZoning( uint16_t targetZone, bool fadeOut, uint8_t fadeOutTime, uint16_t animation )
|
||||||
{
|
{
|
||||||
GamePacketNew< FFXIVIpcPrepareZoning, ServerZoneIpcType > preparePacket( getId() );
|
ZoneChannelPacket< FFXIVIpcPrepareZoning > preparePacket( getId() );
|
||||||
preparePacket.data().targetZone = targetZone;
|
preparePacket.data().targetZone = targetZone;
|
||||||
preparePacket.data().fadeOutTime = fadeOutTime;
|
preparePacket.data().fadeOutTime = fadeOutTime;
|
||||||
preparePacket.data().animation = animation;
|
preparePacket.data().animation = animation;
|
||||||
|
@ -226,7 +228,7 @@ void Core::Entity::Player::calculateStats()
|
||||||
auto paramGrowthInfo = paramGrowthInfoIt->second;
|
auto paramGrowthInfo = paramGrowthInfoIt->second;
|
||||||
|
|
||||||
// TODO: put formula somewhere else...
|
// TODO: put formula somewhere else...
|
||||||
float base = Data::CalcBattle::calculateBaseStat( getAsPlayer() );
|
float base = Math::CalcStats::calculateBaseStat( getAsPlayer() );
|
||||||
|
|
||||||
m_baseStats.str = static_cast< uint32_t >( base * ( static_cast< float >( classInfo.mod_str ) / 100 ) + tribeInfo.mod_str );
|
m_baseStats.str = static_cast< uint32_t >( base * ( static_cast< float >( classInfo.mod_str ) / 100 ) + tribeInfo.mod_str );
|
||||||
m_baseStats.dex = static_cast< uint32_t >( base * ( static_cast< float >( classInfo.mod_dex ) / 100 ) + tribeInfo.mod_dex );
|
m_baseStats.dex = static_cast< uint32_t >( base * ( static_cast< float >( classInfo.mod_dex ) / 100 ) + tribeInfo.mod_dex );
|
||||||
|
@ -242,9 +244,9 @@ void Core::Entity::Player::calculateStats()
|
||||||
m_baseStats.attackPotMagic = paramGrowthInfo.base_secondary;
|
m_baseStats.attackPotMagic = paramGrowthInfo.base_secondary;
|
||||||
m_baseStats.healingPotMagic = paramGrowthInfo.base_secondary;
|
m_baseStats.healingPotMagic = paramGrowthInfo.base_secondary;
|
||||||
|
|
||||||
m_baseStats.max_mp = Data::CalcBattle::calculateMaxMp( getAsPlayer() );
|
m_baseStats.max_mp = Math::CalcStats::calculateMaxMp( getAsPlayer() );
|
||||||
|
|
||||||
m_baseStats.max_hp = Data::CalcBattle::calculateMaxHp( getAsPlayer() );
|
m_baseStats.max_hp = Math::CalcStats::calculateMaxHp( getAsPlayer() );
|
||||||
|
|
||||||
if( m_mp > m_baseStats.max_mp )
|
if( m_mp > m_baseStats.max_mp )
|
||||||
m_mp = m_baseStats.max_mp;
|
m_mp = m_baseStats.max_mp;
|
||||||
|
@ -271,7 +273,7 @@ bool Core::Entity::Player::isAutoattackOn() const
|
||||||
|
|
||||||
void Core::Entity::Player::sendStats()
|
void Core::Entity::Player::sendStats()
|
||||||
{
|
{
|
||||||
GamePacketNew< FFXIVIpcPlayerStats, ServerZoneIpcType > statPacket( getId() );
|
ZoneChannelPacket< FFXIVIpcPlayerStats > statPacket( getId() );
|
||||||
statPacket.data().strength = m_baseStats.str;
|
statPacket.data().strength = m_baseStats.str;
|
||||||
statPacket.data().dexterity = m_baseStats.dex;
|
statPacket.data().dexterity = m_baseStats.dex;
|
||||||
statPacket.data().vitality = m_baseStats.vit;
|
statPacket.data().vitality = m_baseStats.vit;
|
||||||
|
@ -388,7 +390,7 @@ void Core::Entity::Player::setZone( uint32_t zoneId )
|
||||||
m_pCurrentZone = pZone;
|
m_pCurrentZone = pZone;
|
||||||
m_pCurrentZone->pushActor( shared_from_this() );
|
m_pCurrentZone->pushActor( shared_from_this() );
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcInit, ServerZoneIpcType > initPacket( getId() );
|
ZoneChannelPacket< FFXIVIpcInit > initPacket( getId() );
|
||||||
initPacket.data().charId = getId();
|
initPacket.data().charId = getId();
|
||||||
queuePacket( initPacket );
|
queuePacket( initPacket );
|
||||||
|
|
||||||
|
@ -409,7 +411,7 @@ void Core::Entity::Player::setZone( uint32_t zoneId )
|
||||||
// only initialize the UI if the player in fact just logged in.
|
// only initialize the UI if the player in fact just logged in.
|
||||||
if( isLogin() )
|
if( isLogin() )
|
||||||
{
|
{
|
||||||
GamePacketNew< FFXIVIpcCFAvailableContents, ServerZoneIpcType > contentFinderList( getId() );
|
ZoneChannelPacket< FFXIVIpcCFAvailableContents > contentFinderList( getId() );
|
||||||
for( auto i = 0; i < sizeof( contentFinderList.data().contents ); i++ )
|
for( auto i = 0; i < sizeof( contentFinderList.data().contents ); i++ )
|
||||||
{
|
{
|
||||||
// unlock all contents for now
|
// unlock all contents for now
|
||||||
|
@ -420,14 +422,14 @@ void Core::Entity::Player::setZone( uint32_t zoneId )
|
||||||
Server::InitUIPacket initUIPacket( pPlayer );
|
Server::InitUIPacket initUIPacket( pPlayer );
|
||||||
queuePacket( initUIPacket );
|
queuePacket( initUIPacket );
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcPlayerClassInfo, ServerZoneIpcType > classInfoPacket( getId() );
|
ZoneChannelPacket< FFXIVIpcPlayerClassInfo > classInfoPacket( getId() );
|
||||||
classInfoPacket.data().classId = static_cast< uint8_t >( getClass() );
|
classInfoPacket.data().classId = static_cast< uint8_t >( getClass() );
|
||||||
classInfoPacket.data().unknown = 1;
|
classInfoPacket.data().unknown = 1;
|
||||||
classInfoPacket.data().level = getLevel();
|
classInfoPacket.data().level = getLevel();
|
||||||
classInfoPacket.data().level1 = getLevel();
|
classInfoPacket.data().level1 = getLevel();
|
||||||
queuePacket( classInfoPacket );
|
queuePacket( classInfoPacket );
|
||||||
|
|
||||||
GamePacketNew< FFXIVGCAffiliation, ServerZoneIpcType > gcAffPacket( getId() );
|
ZoneChannelPacket< FFXIVGCAffiliation > gcAffPacket( getId() );
|
||||||
gcAffPacket.data().gcId = m_gc;
|
gcAffPacket.data().gcId = m_gc;
|
||||||
gcAffPacket.data().gcRank[0] = m_gcRank[0];
|
gcAffPacket.data().gcRank[0] = m_gcRank[0];
|
||||||
gcAffPacket.data().gcRank[1] = m_gcRank[1];
|
gcAffPacket.data().gcRank[1] = m_gcRank[1];
|
||||||
|
@ -435,7 +437,7 @@ void Core::Entity::Player::setZone( uint32_t zoneId )
|
||||||
queuePacket( gcAffPacket );
|
queuePacket( gcAffPacket );
|
||||||
}
|
}
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcInitZone, ServerZoneIpcType > initZonePacket( getId() );
|
ZoneChannelPacket< FFXIVIpcInitZone > initZonePacket( getId() );
|
||||||
initZonePacket.data().zoneId = getCurrentZone()->getLayoutId();
|
initZonePacket.data().zoneId = getCurrentZone()->getLayoutId();
|
||||||
initZonePacket.data().weatherId = static_cast< uint8_t >( getCurrentZone()->getCurrentWeather() );
|
initZonePacket.data().weatherId = static_cast< uint8_t >( getCurrentZone()->getCurrentWeather() );
|
||||||
initZonePacket.data().bitmask = 0x1;
|
initZonePacket.data().bitmask = 0x1;
|
||||||
|
@ -447,10 +449,10 @@ void Core::Entity::Player::setZone( uint32_t zoneId )
|
||||||
|
|
||||||
if( isLogin() )
|
if( isLogin() )
|
||||||
{
|
{
|
||||||
GamePacketNew< FFXIVARR_IPC_UNK322, ServerZoneIpcType > unk322( getId() );
|
ZoneChannelPacket< FFXIVARR_IPC_UNK322 > unk322( getId() );
|
||||||
queuePacket( unk322 );
|
queuePacket( unk322 );
|
||||||
|
|
||||||
GamePacketNew< FFXIVARR_IPC_UNK320, ServerZoneIpcType > unk320( getId() );
|
ZoneChannelPacket< FFXIVARR_IPC_UNK320 > unk320( getId() );
|
||||||
queuePacket( unk320 );
|
queuePacket( unk320 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -675,7 +677,7 @@ void Core::Entity::Player::gainLevel()
|
||||||
m_hp = getMaxHp();
|
m_hp = getMaxHp();
|
||||||
m_mp = getMaxMp();
|
m_mp = getMaxMp();
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcStatusEffectList, ServerZoneIpcType > effectListPacket( getId() );
|
ZoneChannelPacket< FFXIVIpcStatusEffectList > effectListPacket( getId() );
|
||||||
effectListPacket.data().classId = static_cast< uint8_t > ( getClass() );
|
effectListPacket.data().classId = static_cast< uint8_t > ( getClass() );
|
||||||
effectListPacket.data().classId1 = static_cast< uint8_t > ( getClass() );
|
effectListPacket.data().classId1 = static_cast< uint8_t > ( getClass() );
|
||||||
effectListPacket.data().level = getLevel();
|
effectListPacket.data().level = getLevel();
|
||||||
|
@ -690,7 +692,7 @@ void Core::Entity::Player::gainLevel()
|
||||||
getLevel(), getLevel() - 1 ), true );
|
getLevel(), getLevel() - 1 ), true );
|
||||||
|
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcUpdateClassInfo, ServerZoneIpcType > classInfoPacket( getId() );
|
ZoneChannelPacket< FFXIVIpcUpdateClassInfo > classInfoPacket( getId() );
|
||||||
classInfoPacket.data().classId = static_cast< uint8_t > ( getClass() );
|
classInfoPacket.data().classId = static_cast< uint8_t > ( getClass() );
|
||||||
classInfoPacket.data().classId1 = static_cast< uint8_t > ( getClass() );
|
classInfoPacket.data().classId1 = static_cast< uint8_t > ( getClass() );
|
||||||
classInfoPacket.data().level = getLevel();
|
classInfoPacket.data().level = getLevel();
|
||||||
|
@ -780,7 +782,7 @@ void Core::Entity::Player::setClassJob( Core::Common::ClassJob classJob )
|
||||||
|
|
||||||
m_tp = 0;
|
m_tp = 0;
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcPlayerClassInfo, ServerZoneIpcType > classInfoPacket( getId() );
|
ZoneChannelPacket< FFXIVIpcPlayerClassInfo > classInfoPacket( getId() );
|
||||||
classInfoPacket.data().classId = static_cast< uint8_t >( getClass() );
|
classInfoPacket.data().classId = static_cast< uint8_t >( getClass() );
|
||||||
classInfoPacket.data().level = getLevel();
|
classInfoPacket.data().level = getLevel();
|
||||||
queuePacket( classInfoPacket );
|
queuePacket( classInfoPacket );
|
||||||
|
@ -919,7 +921,7 @@ void Core::Entity::Player::setGc( uint8_t gc )
|
||||||
{
|
{
|
||||||
m_gc = gc;
|
m_gc = gc;
|
||||||
|
|
||||||
GamePacketNew< FFXIVGCAffiliation, ServerZoneIpcType > gcAffPacket( getId() );
|
ZoneChannelPacket< FFXIVGCAffiliation > gcAffPacket( getId() );
|
||||||
gcAffPacket.data().gcId = m_gc;
|
gcAffPacket.data().gcId = m_gc;
|
||||||
gcAffPacket.data().gcRank[0] = m_gcRank[0];
|
gcAffPacket.data().gcRank[0] = m_gcRank[0];
|
||||||
gcAffPacket.data().gcRank[1] = m_gcRank[1];
|
gcAffPacket.data().gcRank[1] = m_gcRank[1];
|
||||||
|
@ -931,7 +933,7 @@ void Core::Entity::Player::setGcRankAt( uint8_t index, uint8_t rank )
|
||||||
{
|
{
|
||||||
m_gcRank[index] = rank;
|
m_gcRank[index] = rank;
|
||||||
|
|
||||||
GamePacketNew< FFXIVGCAffiliation, ServerZoneIpcType > gcAffPacket( getId() );
|
ZoneChannelPacket< FFXIVGCAffiliation > gcAffPacket( getId() );
|
||||||
gcAffPacket.data().gcId = m_gc;
|
gcAffPacket.data().gcId = m_gc;
|
||||||
gcAffPacket.data().gcRank[0] = m_gcRank[0];
|
gcAffPacket.data().gcRank[0] = m_gcRank[0];
|
||||||
gcAffPacket.data().gcRank[1] = m_gcRank[1];
|
gcAffPacket.data().gcRank[1] = m_gcRank[1];
|
||||||
|
@ -1026,7 +1028,7 @@ void Core::Entity::Player::update( int64_t currTime )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GamePacketNew< FFXIVIpcActorSetPos, ServerZoneIpcType > setActorPosPacket( getId() );
|
ZoneChannelPacket< FFXIVIpcActorSetPos > setActorPosPacket( getId() );
|
||||||
setActorPosPacket.data().r16 = Math::Util::floatToUInt16Rot( m_queuedZoneing->m_targetRotation );
|
setActorPosPacket.data().r16 = Math::Util::floatToUInt16Rot( m_queuedZoneing->m_targetRotation );
|
||||||
setActorPosPacket.data().waitForLoad = 0x04;
|
setActorPosPacket.data().waitForLoad = 0x04;
|
||||||
setActorPosPacket.data().x = targetPos.x;
|
setActorPosPacket.data().x = targetPos.x;
|
||||||
|
@ -1107,7 +1109,7 @@ void Core::Entity::Player::freePlayerSpawnId( uint32_t actorId )
|
||||||
m_playerIdToSpawnIdMap.erase( actorId );
|
m_playerIdToSpawnIdMap.erase( actorId );
|
||||||
m_freeSpawnIdQueue.push( spawnId );
|
m_freeSpawnIdQueue.push( spawnId );
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcActorFreeSpawn, ServerZoneIpcType > freeActorSpawnPacket( getId() );
|
ZoneChannelPacket< FFXIVIpcActorFreeSpawn > freeActorSpawnPacket( getId() );
|
||||||
freeActorSpawnPacket.data().actorId = actorId;
|
freeActorSpawnPacket.data().actorId = actorId;
|
||||||
freeActorSpawnPacket.data().spawnId = spawnId;
|
freeActorSpawnPacket.data().spawnId = spawnId;
|
||||||
queuePacket( freeActorSpawnPacket );
|
queuePacket( freeActorSpawnPacket );
|
||||||
|
@ -1378,7 +1380,7 @@ void Core::Entity::Player::initHateSlotQueue()
|
||||||
|
|
||||||
void Core::Entity::Player::sendHateList()
|
void Core::Entity::Player::sendHateList()
|
||||||
{
|
{
|
||||||
GamePacketNew< FFXIVIpcHateList, ServerZoneIpcType > hateListPacket( getId() );
|
ZoneChannelPacket< FFXIVIpcHateList > hateListPacket( getId() );
|
||||||
hateListPacket.data().numEntries = m_actorIdTohateSlotMap.size();
|
hateListPacket.data().numEntries = m_actorIdTohateSlotMap.size();
|
||||||
auto it = m_actorIdTohateSlotMap.begin();
|
auto it = m_actorIdTohateSlotMap.begin();
|
||||||
for( int32_t i = 0; it != m_actorIdTohateSlotMap.end(); ++it, i++ )
|
for( int32_t i = 0; it != m_actorIdTohateSlotMap.end(); ++it, i++ )
|
||||||
|
@ -1435,7 +1437,7 @@ void Core::Entity::Player::setTitle( uint16_t titleId )
|
||||||
void Core::Entity::Player::setEquipDisplayFlags( uint8_t state )
|
void Core::Entity::Player::setEquipDisplayFlags( uint8_t state )
|
||||||
{
|
{
|
||||||
m_equipDisplayFlags = state;
|
m_equipDisplayFlags = state;
|
||||||
GamePacketNew< FFXIVIpcEquipDisplayFlags, ServerZoneIpcType > paramPacket( getId() );
|
ZoneChannelPacket< FFXIVIpcEquipDisplayFlags > paramPacket( getId() );
|
||||||
paramPacket.data().bitmask = m_equipDisplayFlags;
|
paramPacket.data().bitmask = m_equipDisplayFlags;
|
||||||
sendToInRangeSet( paramPacket, true );
|
sendToInRangeSet( paramPacket, true );
|
||||||
}
|
}
|
||||||
|
@ -1447,29 +1449,25 @@ uint8_t Core::Entity::Player::getEquipDisplayFlags() const
|
||||||
|
|
||||||
void Core::Entity::Player::mount( uint32_t id )
|
void Core::Entity::Player::mount( uint32_t id )
|
||||||
{
|
{
|
||||||
// TODO: Fix me for SQL rewrite
|
m_mount = id;
|
||||||
/* m_mount = id;
|
|
||||||
sendToInRangeSet( ActorControlPacket142( getId(), ActorControlType::SetStatus, static_cast< uint8_t >( Entity::Actor::ActorStatus::Mounted )), true );
|
sendToInRangeSet( ActorControlPacket142( getId(), ActorControlType::SetStatus, static_cast< uint8_t >( Entity::Actor::ActorStatus::Mounted )), true );
|
||||||
sendToInRangeSet( ActorControlPacket143( getId(), 0x39e, 12 ), true ); //?
|
sendToInRangeSet( ActorControlPacket143( getId(), 0x39e, 12 ), true ); //?
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcMount, ServerZoneIpcType > mountPacket( getId() );
|
ZoneChannelPacket< FFXIVIpcMount > mountPacket( getId() );
|
||||||
mountPacket.data().id = m_mount;
|
mountPacket.data().id = id;
|
||||||
sendToInRangeSet( mountPacket, true );*/
|
sendToInRangeSet( mountPacket, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Core::Entity::Player::dismount()
|
void Core::Entity::Player::dismount()
|
||||||
{
|
{
|
||||||
// TODO: Fix me for SQL rewrite
|
sendToInRangeSet( ActorControlPacket142( getId(), ActorControlType::SetStatus, static_cast< uint8_t >( Entity::Actor::ActorStatus::Idle )), true );
|
||||||
/* sendToInRangeSet( ActorControlPacket142( getId(), ActorControlType::SetStatus, static_cast< uint8_t >( Entity::Actor::ActorStatus::Idle )), true );
|
|
||||||
sendToInRangeSet( ActorControlPacket143( getId(), ActorControlType::Dismount, 1 ), true );
|
sendToInRangeSet( ActorControlPacket143( getId(), ActorControlType::Dismount, 1 ), true );
|
||||||
m_mount = 0;*/
|
m_mount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t Core::Entity::Player::getCurrentMount() const
|
uint8_t Core::Entity::Player::getCurrentMount() const
|
||||||
{
|
{
|
||||||
// TODO: Fix me for SQL rewrite
|
return m_mount;
|
||||||
// return m_mount;
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Core::Entity::Player::autoAttack( ActorPtr pTarget )
|
void Core::Entity::Player::autoAttack( ActorPtr pTarget )
|
||||||
|
@ -1488,7 +1486,7 @@ void Core::Entity::Player::autoAttack( ActorPtr pTarget )
|
||||||
getClass() == ClassJob::Bard ||
|
getClass() == ClassJob::Bard ||
|
||||||
getClass() == ClassJob::Archer )
|
getClass() == ClassJob::Archer )
|
||||||
{
|
{
|
||||||
GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket(getId());
|
ZoneChannelPacket< FFXIVIpcEffect > effectPacket(getId());
|
||||||
effectPacket.data().targetId = pTarget->getId();
|
effectPacket.data().targetId = pTarget->getId();
|
||||||
effectPacket.data().actionAnimationId = 8;
|
effectPacket.data().actionAnimationId = 8;
|
||||||
// effectPacket.data().unknown_2 = variation;
|
// effectPacket.data().unknown_2 = variation;
|
||||||
|
@ -1509,7 +1507,7 @@ void Core::Entity::Player::autoAttack( ActorPtr pTarget )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket(getId());
|
ZoneChannelPacket< FFXIVIpcEffect > effectPacket(getId());
|
||||||
effectPacket.data().targetId = pTarget->getId();
|
effectPacket.data().targetId = pTarget->getId();
|
||||||
effectPacket.data().actionAnimationId = 7;
|
effectPacket.data().actionAnimationId = 7;
|
||||||
// effectPacket.data().unknown_2 = variation;
|
// effectPacket.data().unknown_2 = variation;
|
||||||
|
@ -1578,7 +1576,7 @@ void Core::Entity::Player::setOpeningSequence( uint8_t seq )
|
||||||
void Core::Entity::Player::setEorzeaTimeOffset( uint64_t timestamp )
|
void Core::Entity::Player::setEorzeaTimeOffset( uint64_t timestamp )
|
||||||
{
|
{
|
||||||
// TODO: maybe change to persistent?
|
// TODO: maybe change to persistent?
|
||||||
GamePacketNew< FFXIVIpcEorzeaTimeOffset, ServerZoneIpcType > packet ( getId() );
|
ZoneChannelPacket< FFXIVIpcEorzeaTimeOffset > packet ( getId() );
|
||||||
packet.data().timestamp = timestamp;
|
packet.data().timestamp = timestamp;
|
||||||
|
|
||||||
// Send to single player
|
// Send to single player
|
||||||
|
|
|
@ -629,6 +629,8 @@ private:
|
||||||
|
|
||||||
// content finder info
|
// content finder info
|
||||||
uint32_t m_cfPenaltyUntil; // unix time
|
uint32_t m_cfPenaltyUntil; // unix time
|
||||||
|
|
||||||
|
uint8_t m_mount;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,7 +130,7 @@ void Core::Entity::Player::addCurrency( uint8_t type, uint32_t amount )
|
||||||
if( !m_pInventory->addCurrency( static_cast< Inventory::CurrencyType >( type ), amount ) )
|
if( !m_pInventory->addCurrency( static_cast< Inventory::CurrencyType >( type ), amount ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcUpdateInventorySlot, ServerZoneIpcType > invUpPacket( getId() );
|
ZoneChannelPacket< FFXIVIpcUpdateInventorySlot > invUpPacket( getId() );
|
||||||
invUpPacket.data().containerId = Inventory::InventoryType::Currency;
|
invUpPacket.data().containerId = Inventory::InventoryType::Currency;
|
||||||
invUpPacket.data().catalogId = 1;
|
invUpPacket.data().catalogId = 1;
|
||||||
invUpPacket.data().quantity = m_pInventory->getCurrency( static_cast< Inventory::CurrencyType >( type ) );
|
invUpPacket.data().quantity = m_pInventory->getCurrency( static_cast< Inventory::CurrencyType >( type ) );
|
||||||
|
@ -144,7 +144,7 @@ void Core::Entity::Player::removeCurrency( uint8_t type, uint32_t amount )
|
||||||
if( !m_pInventory->removeCurrency( static_cast< Inventory::CurrencyType >( type ), amount ) )
|
if( !m_pInventory->removeCurrency( static_cast< Inventory::CurrencyType >( type ), amount ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcUpdateInventorySlot, ServerZoneIpcType > invUpPacket( getId() );
|
ZoneChannelPacket< FFXIVIpcUpdateInventorySlot > invUpPacket( getId() );
|
||||||
invUpPacket.data().containerId = Inventory::InventoryType::Currency;
|
invUpPacket.data().containerId = Inventory::InventoryType::Currency;
|
||||||
invUpPacket.data().catalogId = 1;
|
invUpPacket.data().catalogId = 1;
|
||||||
invUpPacket.data().quantity = m_pInventory->getCurrency( static_cast< Inventory::CurrencyType >( type ) );
|
invUpPacket.data().quantity = m_pInventory->getCurrency( static_cast< Inventory::CurrencyType >( type ) );
|
||||||
|
@ -164,7 +164,7 @@ void Core::Entity::Player::addCrystal( uint8_t type, uint32_t amount )
|
||||||
if( !m_pInventory->addCrystal( static_cast< Inventory::CrystalType >( type ), amount ) )
|
if( !m_pInventory->addCrystal( static_cast< Inventory::CrystalType >( type ), amount ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcUpdateInventorySlot, ServerZoneIpcType > invUpPacket( getId() );
|
ZoneChannelPacket< FFXIVIpcUpdateInventorySlot > invUpPacket( getId() );
|
||||||
invUpPacket.data().containerId = Inventory::InventoryType::Crystal;
|
invUpPacket.data().containerId = Inventory::InventoryType::Crystal;
|
||||||
invUpPacket.data().catalogId = static_cast< uint8_t >( type ) + 1;
|
invUpPacket.data().catalogId = static_cast< uint8_t >( type ) + 1;
|
||||||
invUpPacket.data().quantity = m_pInventory->getCrystal( static_cast< Inventory::CrystalType >( type ) );
|
invUpPacket.data().quantity = m_pInventory->getCrystal( static_cast< Inventory::CrystalType >( type ) );
|
||||||
|
@ -180,7 +180,7 @@ void Core::Entity::Player::removeCrystal( uint8_t type, uint32_t amount )
|
||||||
if( !m_pInventory->removeCrystal( static_cast< Inventory::CrystalType >( type ), amount ) )
|
if( !m_pInventory->removeCrystal( static_cast< Inventory::CrystalType >( type ), amount ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcUpdateInventorySlot, ServerZoneIpcType > invUpPacket( getId() );
|
ZoneChannelPacket< FFXIVIpcUpdateInventorySlot > invUpPacket( getId() );
|
||||||
invUpPacket.data().containerId = Inventory::InventoryType::Crystal;
|
invUpPacket.data().containerId = Inventory::InventoryType::Crystal;
|
||||||
invUpPacket.data().catalogId = static_cast< uint8_t >( type ) + 1;
|
invUpPacket.data().catalogId = static_cast< uint8_t >( type ) + 1;
|
||||||
invUpPacket.data().quantity = m_pInventory->getCrystal( static_cast< Inventory::CrystalType >( type ) );
|
invUpPacket.data().quantity = m_pInventory->getCrystal( static_cast< Inventory::CrystalType >( type ) );
|
||||||
|
|
|
@ -44,13 +44,13 @@ void Core::Entity::Player::removeQuest( uint16_t questId )
|
||||||
if( ( idx != -1 ) && ( m_activeQuests[idx] != nullptr ) )
|
if( ( idx != -1 ) && ( m_activeQuests[idx] != nullptr ) )
|
||||||
{
|
{
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcQuestUpdate, ServerZoneIpcType > questUpdatePacket( getId() );
|
ZoneChannelPacket< FFXIVIpcQuestUpdate > questUpdatePacket( getId() );
|
||||||
questUpdatePacket.data().slot = idx;
|
questUpdatePacket.data().slot = idx;
|
||||||
questUpdatePacket.data().questInfo.c.questId = 0;
|
questUpdatePacket.data().questInfo.c.questId = 0;
|
||||||
questUpdatePacket.data().questInfo.c.sequence = 0xFF;
|
questUpdatePacket.data().questInfo.c.sequence = 0xFF;
|
||||||
queuePacket( questUpdatePacket );
|
queuePacket( questUpdatePacket );
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcQuestFinish, ServerZoneIpcType > questFinishPacket( getId() );
|
ZoneChannelPacket< FFXIVIpcQuestFinish > questFinishPacket( getId() );
|
||||||
questFinishPacket.data().questId = questId;
|
questFinishPacket.data().questId = questId;
|
||||||
questFinishPacket.data().flag1 = 1;
|
questFinishPacket.data().flag1 = 1;
|
||||||
questFinishPacket.data().flag2 = 1;
|
questFinishPacket.data().flag2 = 1;
|
||||||
|
@ -865,7 +865,7 @@ void Core::Entity::Player::updateQuest( uint16_t questId, uint8_t sequence )
|
||||||
{
|
{
|
||||||
uint8_t index = getQuestIndex( questId );
|
uint8_t index = getQuestIndex( questId );
|
||||||
auto pNewQuest = m_activeQuests[index];
|
auto pNewQuest = m_activeQuests[index];
|
||||||
GamePacketNew< FFXIVIpcQuestUpdate, ServerZoneIpcType > pe_qa( getId() );
|
ZoneChannelPacket< FFXIVIpcQuestUpdate > pe_qa( getId() );
|
||||||
pNewQuest->c.sequence = sequence;
|
pNewQuest->c.sequence = sequence;
|
||||||
pe_qa.data().slot = index;
|
pe_qa.data().slot = index;
|
||||||
pe_qa.data().questInfo = *pNewQuest;
|
pe_qa.data().questInfo = *pNewQuest;
|
||||||
|
@ -895,7 +895,7 @@ void Core::Entity::Player::updateQuest( uint16_t questId, uint8_t sequence )
|
||||||
m_questIdToQuestIdx[questId] = idx;
|
m_questIdToQuestIdx[questId] = idx;
|
||||||
m_questIdxToQuestId[idx] = questId;
|
m_questIdxToQuestId[idx] = questId;
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcQuestUpdate, ServerZoneIpcType > pe_qa( getId() );
|
ZoneChannelPacket< FFXIVIpcQuestUpdate > pe_qa( getId() );
|
||||||
pe_qa.data().slot = idx;
|
pe_qa.data().slot = idx;
|
||||||
pe_qa.data().questInfo = *pNewQuest;
|
pe_qa.data().questInfo = *pNewQuest;
|
||||||
queuePacket( pe_qa );
|
queuePacket( pe_qa );
|
||||||
|
@ -917,7 +917,7 @@ void Core::Entity::Player::updateQuest( uint16_t questId, uint8_t sequence )
|
||||||
|
|
||||||
void Core::Entity::Player::sendQuestTracker()
|
void Core::Entity::Player::sendQuestTracker()
|
||||||
{
|
{
|
||||||
GamePacketNew< FFXIVIpcQuestTracker, ServerZoneIpcType > trackerPacket( getId() );
|
ZoneChannelPacket< FFXIVIpcQuestTracker > trackerPacket( getId() );
|
||||||
|
|
||||||
for( int32_t ii = 0; ii < 5; ii++ )
|
for( int32_t ii = 0; ii < 5; ii++ )
|
||||||
{
|
{
|
||||||
|
@ -962,7 +962,7 @@ void Core::Entity::Player::setQuestTracker( uint16_t index, int16_t flag )
|
||||||
|
|
||||||
void Core::Entity::Player::sendQuestInfo()
|
void Core::Entity::Player::sendQuestInfo()
|
||||||
{
|
{
|
||||||
GamePacketNew< FFXIVIpcQuestActiveList, ServerZoneIpcType > pe_qa( getId() );
|
ZoneChannelPacket< FFXIVIpcQuestActiveList > pe_qa( getId() );
|
||||||
|
|
||||||
for( int32_t i = 0; i < 30; i++ )
|
for( int32_t i = 0; i < 30; i++ )
|
||||||
{
|
{
|
||||||
|
@ -978,7 +978,7 @@ void Core::Entity::Player::sendQuestInfo()
|
||||||
|
|
||||||
queuePacket( pe_qa );
|
queuePacket( pe_qa );
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcQuestCompleteList, ServerZoneIpcType > pe_qc( getId() );
|
ZoneChannelPacket< FFXIVIpcQuestCompleteList > pe_qc( getId() );
|
||||||
memcpy( pe_qc.data().questCompleteMask, m_questCompleteFlags, 200 );
|
memcpy( pe_qc.data().questCompleteMask, m_questCompleteFlags, 200 );
|
||||||
queuePacket( pe_qc );
|
queuePacket( pe_qc );
|
||||||
|
|
||||||
|
|
|
@ -166,6 +166,8 @@ bool Core::Entity::Player::load( uint32_t charId, Core::SessionPtr pSession )
|
||||||
m_maxHp = getMaxHp();
|
m_maxHp = getMaxHp();
|
||||||
m_maxMp = getMaxMp();
|
m_maxMp = getMaxMp();
|
||||||
|
|
||||||
|
m_mount = res->getUInt8( "Mount" );
|
||||||
|
|
||||||
m_modelSubWeapon = 0;
|
m_modelSubWeapon = 0;
|
||||||
m_lastTickTime = 0;
|
m_lastTickTime = 0;
|
||||||
|
|
||||||
|
@ -305,7 +307,7 @@ void Core::Entity::Player::updateSql()
|
||||||
stmt->setInt( 3, 0 ); // TP
|
stmt->setInt( 3, 0 ); // TP
|
||||||
stmt->setInt( 4, 0 ); // GP
|
stmt->setInt( 4, 0 ); // GP
|
||||||
stmt->setInt( 5, 0 ); // Mode
|
stmt->setInt( 5, 0 ); // Mode
|
||||||
stmt->setInt( 6, 0 ); // Mount
|
stmt->setInt( 6, m_mount ); // Mount
|
||||||
stmt->setInt( 7, 0 ); // InvicibleGM
|
stmt->setInt( 7, 0 ); // InvicibleGM
|
||||||
stmt->setInt( 8, m_voice );
|
stmt->setInt( 8, m_voice );
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ file(GLOB SERVER_PUBLIC_INCLUDE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
Event/*.h
|
Event/*.h
|
||||||
Inventory/*.h
|
Inventory/*.h
|
||||||
Linkshell/*.h
|
Linkshell/*.h
|
||||||
|
Math/*.h
|
||||||
Network/*.h
|
Network/*.h
|
||||||
Network/Handlers/*.h
|
Network/Handlers/*.h
|
||||||
Network/PacketWrappers/*.h
|
Network/PacketWrappers/*.h
|
||||||
|
@ -31,6 +32,7 @@ file(GLOB SERVER_SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
Event/*.c*
|
Event/*.c*
|
||||||
Inventory/*.c*
|
Inventory/*.c*
|
||||||
Linkshell/*.c*
|
Linkshell/*.c*
|
||||||
|
Math/*.c*
|
||||||
Network/*.c*
|
Network/*.c*
|
||||||
Network/Handlers/*.c*
|
Network/Handlers/*.c*
|
||||||
Network/PacketWrappers/*.c*
|
Network/PacketWrappers/*.c*
|
||||||
|
|
|
@ -183,7 +183,7 @@ void Core::DebugCommandHandler::set( char * data, Core::Entity::PlayerPtr pPlaye
|
||||||
pPlayer->getPos().y + static_cast< float >( posY ),
|
pPlayer->getPos().y + static_cast< float >( posY ),
|
||||||
pPlayer->getPos().z + static_cast< float >( posZ ) );
|
pPlayer->getPos().z + static_cast< float >( posZ ) );
|
||||||
|
|
||||||
Network::Packets::GamePacketNew< Network::Packets::Server::FFXIVIpcActorSetPos, Network::Packets::ServerZoneIpcType >
|
Network::Packets::ZoneChannelPacket< Network::Packets::Server::FFXIVIpcActorSetPos >
|
||||||
setActorPosPacket( pPlayer->getId() );
|
setActorPosPacket( pPlayer->getId() );
|
||||||
setActorPosPacket.data().x = pPlayer->getPos().x;
|
setActorPosPacket.data().x = pPlayer->getPos().x;
|
||||||
setActorPosPacket.data().y = pPlayer->getPos().y;
|
setActorPosPacket.data().y = pPlayer->getPos().y;
|
||||||
|
@ -204,7 +204,7 @@ void Core::DebugCommandHandler::set( char * data, Core::Entity::PlayerPtr pPlaye
|
||||||
int32_t discover_id;
|
int32_t discover_id;
|
||||||
sscanf( params.c_str(), "%i %i", &map_id, &discover_id );
|
sscanf( params.c_str(), "%i %i", &map_id, &discover_id );
|
||||||
|
|
||||||
Network::Packets::GamePacketNew< Network::Packets::Server::FFXIVIpcDiscovery, Network::Packets::ServerZoneIpcType > discoveryPacket( pPlayer->getId() );
|
Network::Packets::ZoneChannelPacket< Network::Packets::Server::FFXIVIpcDiscovery > discoveryPacket( pPlayer->getId() );
|
||||||
discoveryPacket.data().map_id = map_id;
|
discoveryPacket.data().map_id = map_id;
|
||||||
discoveryPacket.data().map_part_id = discover_id;
|
discoveryPacket.data().map_part_id = discover_id;
|
||||||
pPlayer->queuePacket( discoveryPacket );
|
pPlayer->queuePacket( discoveryPacket );
|
||||||
|
@ -375,7 +375,7 @@ void Core::DebugCommandHandler::add( char * data, Core::Entity::PlayerPtr pPlaye
|
||||||
|
|
||||||
pPlayer->sendNotice( "Injecting ACTOR_CONTROL " + std::to_string( opcode ) );
|
pPlayer->sendNotice( "Injecting ACTOR_CONTROL " + std::to_string( opcode ) );
|
||||||
|
|
||||||
Network::Packets::GamePacketNew< Network::Packets::Server::FFXIVIpcActorControl143, Network::Packets::ServerZoneIpcType > actorControl( playerId, pPlayer->getId() );
|
Network::Packets::ZoneChannelPacket< Network::Packets::Server::FFXIVIpcActorControl143 > actorControl( playerId, pPlayer->getId() );
|
||||||
actorControl.data().category = opcode;
|
actorControl.data().category = opcode;
|
||||||
actorControl.data().param1 = param1;
|
actorControl.data().param1 = param1;
|
||||||
actorControl.data().param2 = param2;
|
actorControl.data().param2 = param2;
|
||||||
|
@ -501,7 +501,7 @@ void Core::DebugCommandHandler::nudge( char * data, Entity::PlayerPtr pPlayer, b
|
||||||
}
|
}
|
||||||
if( offset != 0 )
|
if( offset != 0 )
|
||||||
{
|
{
|
||||||
Network::Packets::GamePacketNew< Network::Packets::Server::FFXIVIpcActorSetPos, Network::Packets::ServerZoneIpcType >
|
Network::Packets::ZoneChannelPacket< Network::Packets::Server::FFXIVIpcActorSetPos >
|
||||||
setActorPosPacket( pPlayer->getId() );
|
setActorPosPacket( pPlayer->getId() );
|
||||||
setActorPosPacket.data().x = pPlayer->getPos().x;
|
setActorPosPacket.data().x = pPlayer->getPos().x;
|
||||||
setActorPosPacket.data().y = pPlayer->getPos().y;
|
setActorPosPacket.data().y = pPlayer->getPos().y;
|
||||||
|
|
|
@ -484,7 +484,7 @@ int16_t Core::Inventory::addItem( uint16_t inventoryId, int8_t slotId, uint32_t
|
||||||
" WHERE storageId = " + std::to_string( inventoryId ) +
|
" WHERE storageId = " + std::to_string( inventoryId ) +
|
||||||
" AND CharacterId = " + std::to_string( m_pOwner->getId() ) );
|
" AND CharacterId = " + std::to_string( m_pOwner->getId() ) );
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcUpdateInventorySlot, ServerZoneIpcType > invUpPacket( m_pOwner->getId() );
|
ZoneChannelPacket< FFXIVIpcUpdateInventorySlot > invUpPacket( m_pOwner->getId() );
|
||||||
invUpPacket.data().containerId = inventoryId;
|
invUpPacket.data().containerId = inventoryId;
|
||||||
invUpPacket.data().catalogId = catalogId;
|
invUpPacket.data().catalogId = catalogId;
|
||||||
invUpPacket.data().quantity = item->getStackSize();
|
invUpPacket.data().quantity = item->getStackSize();
|
||||||
|
@ -605,7 +605,7 @@ void Core::Inventory::discardItem( uint16_t fromInventoryId, uint8_t fromSlotId
|
||||||
m_inventoryMap[fromInventoryId]->removeItem( fromSlotId );
|
m_inventoryMap[fromInventoryId]->removeItem( fromSlotId );
|
||||||
updateContainer( fromInventoryId, fromSlotId, nullptr );
|
updateContainer( fromInventoryId, fromSlotId, nullptr );
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcInventoryTransaction, ServerZoneIpcType > invTransPacket( m_pOwner->getId() );
|
ZoneChannelPacket< FFXIVIpcInventoryTransaction > invTransPacket( m_pOwner->getId() );
|
||||||
invTransPacket.data().transactionId = transactionId;
|
invTransPacket.data().transactionId = transactionId;
|
||||||
invTransPacket.data().ownerId = m_pOwner->getId();
|
invTransPacket.data().ownerId = m_pOwner->getId();
|
||||||
invTransPacket.data().storageId = fromInventoryId;
|
invTransPacket.data().storageId = fromInventoryId;
|
||||||
|
@ -615,7 +615,7 @@ void Core::Inventory::discardItem( uint16_t fromInventoryId, uint8_t fromSlotId
|
||||||
invTransPacket.data().type = 7;
|
invTransPacket.data().type = 7;
|
||||||
m_pOwner->queuePacket( invTransPacket );
|
m_pOwner->queuePacket( invTransPacket );
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcInventoryTransactionFinish, ServerZoneIpcType > invTransFinPacket( m_pOwner->getId() );
|
ZoneChannelPacket< FFXIVIpcInventoryTransactionFinish > invTransFinPacket( m_pOwner->getId() );
|
||||||
invTransFinPacket.data().transactionId = transactionId;
|
invTransFinPacket.data().transactionId = transactionId;
|
||||||
invTransFinPacket.data().transactionId1 = transactionId;
|
invTransFinPacket.data().transactionId1 = transactionId;
|
||||||
m_pOwner->queuePacket( invTransFinPacket );
|
m_pOwner->queuePacket( invTransFinPacket );
|
||||||
|
@ -793,7 +793,7 @@ void Core::Inventory::send()
|
||||||
|
|
||||||
if( it->second->getId() == InventoryType::Currency || it->second->getId() == InventoryType::Crystal )
|
if( it->second->getId() == InventoryType::Currency || it->second->getId() == InventoryType::Crystal )
|
||||||
{
|
{
|
||||||
GamePacketNew< FFXIVIpcCurrencyCrystalInfo, ServerZoneIpcType > currencyInfoPacket( m_pOwner->getId() );
|
ZoneChannelPacket< FFXIVIpcCurrencyCrystalInfo > currencyInfoPacket( m_pOwner->getId() );
|
||||||
currencyInfoPacket.data().sequence = count;
|
currencyInfoPacket.data().sequence = count;
|
||||||
currencyInfoPacket.data().catalogId = itM->second->getId();
|
currencyInfoPacket.data().catalogId = itM->second->getId();
|
||||||
currencyInfoPacket.data().unknown = 1;
|
currencyInfoPacket.data().unknown = 1;
|
||||||
|
@ -804,7 +804,7 @@ void Core::Inventory::send()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GamePacketNew< FFXIVIpcItemInfo, ServerZoneIpcType > itemInfoPacket( m_pOwner->getId() );
|
ZoneChannelPacket< FFXIVIpcItemInfo > itemInfoPacket( m_pOwner->getId() );
|
||||||
itemInfoPacket.data().sequence = count;
|
itemInfoPacket.data().sequence = count;
|
||||||
itemInfoPacket.data().containerId = it->second->getId();
|
itemInfoPacket.data().containerId = it->second->getId();
|
||||||
itemInfoPacket.data().slot = itM->first;
|
itemInfoPacket.data().slot = itM->first;
|
||||||
|
@ -817,7 +817,7 @@ void Core::Inventory::send()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcContainerInfo, ServerZoneIpcType > containerInfoPacket( m_pOwner->getId() );
|
ZoneChannelPacket< FFXIVIpcContainerInfo > containerInfoPacket( m_pOwner->getId() );
|
||||||
containerInfoPacket.data().sequence = count;
|
containerInfoPacket.data().sequence = count;
|
||||||
containerInfoPacket.data().numItems = it->second->getEntryCount();
|
containerInfoPacket.data().numItems = it->second->getEntryCount();
|
||||||
containerInfoPacket.data().containerId = it->second->getId();
|
containerInfoPacket.data().containerId = it->second->getId();
|
||||||
|
|
45
src/servers/Server_Zone/Math/CalcBattle.cpp
Normal file
45
src/servers/Server_Zone/Math/CalcBattle.cpp
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
|
#include <Server_Common/Exd/ExdData.h>
|
||||||
|
#include <Server_Common/Common.h>
|
||||||
|
#include <Server_Zone/Actor/Actor.h>
|
||||||
|
#include <Server_Zone/Actor/Player.h>
|
||||||
|
|
||||||
|
#include "CalcBattle.h"
|
||||||
|
|
||||||
|
|
||||||
|
using namespace Core::Math;
|
||||||
|
using namespace Core::Entity;
|
||||||
|
|
||||||
|
extern Core::Data::ExdData g_exdData;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Class used for battle-related formulas and calculations.
|
||||||
|
Big thanks to the Theoryjerks group!
|
||||||
|
|
||||||
|
NOTE:
|
||||||
|
Formulas here shouldn't be considered final. It's possible that the formula it was based on is correct but
|
||||||
|
wasn't implemented correctly here, or approximated things due to limited knowledge of how things work in retail.
|
||||||
|
It's also possible that we're using formulas that were correct for previous patches, but not the current version.
|
||||||
|
|
||||||
|
TODO:
|
||||||
|
|
||||||
|
Damage outgoing calculations. This includes auto-attacks, etc.
|
||||||
|
More formulas in general. Most of it was moved to another class, but work can be done in this area as well already.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
uint32_t CalcBattle::calculateHealValue( PlayerPtr pPlayer, uint32_t potency )
|
||||||
|
{
|
||||||
|
auto classInfoIt = g_exdData.m_classJobInfoMap.find( static_cast< uint8_t >( pPlayer->getClass() ) );
|
||||||
|
auto paramGrowthInfoIt = g_exdData.m_paramGrowthInfoMap.find( pPlayer->getLevel() );
|
||||||
|
|
||||||
|
if ( classInfoIt == g_exdData.m_classJobInfoMap.end() ||
|
||||||
|
paramGrowthInfoIt == g_exdData.m_paramGrowthInfoMap.end())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
auto jobModVal = classInfoIt->second;
|
||||||
|
|
||||||
|
// consider 3% variation
|
||||||
|
return potency / 10;
|
||||||
|
}
|
24
src/servers/Server_Zone/Math/CalcBattle.h
Normal file
24
src/servers/Server_Zone/Math/CalcBattle.h
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
#ifndef _CALCBATTLE_H
|
||||||
|
#define _CALCBATTLE_H
|
||||||
|
|
||||||
|
#include <Server_Common/Common.h>
|
||||||
|
#include <Server_Zone/Actor/Actor.h>
|
||||||
|
|
||||||
|
using namespace Core::Entity;
|
||||||
|
|
||||||
|
namespace Core {
|
||||||
|
namespace Math {
|
||||||
|
|
||||||
|
class CalcBattle
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static uint32_t calculateHealValue( PlayerPtr pPlayer, uint32_t potency );
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -1,11 +1,14 @@
|
||||||
#include <src/servers/Server_Common/Exd/ExdData.h>
|
|
||||||
|
|
||||||
#include "CalcBattle.h"
|
|
||||||
#include "Actor.h"
|
|
||||||
#include "Player.h"
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
using namespace Core::Data;
|
#include <Server_Common/Exd/ExdData.h>
|
||||||
|
#include <Server_Common/Common.h>
|
||||||
|
#include <Server_Zone/Actor/Actor.h>
|
||||||
|
#include <Server_Zone/Actor/Player.h>
|
||||||
|
|
||||||
|
#include "CalcStats.h"
|
||||||
|
|
||||||
|
|
||||||
|
using namespace Core::Math;
|
||||||
using namespace Core::Entity;
|
using namespace Core::Entity;
|
||||||
|
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdData g_exdData;
|
||||||
|
@ -22,15 +25,14 @@ extern Core::Data::ExdData g_exdData;
|
||||||
TODO:
|
TODO:
|
||||||
|
|
||||||
Base HP val modifier. I can only find values for levels 50~70.
|
Base HP val modifier. I can only find values for levels 50~70.
|
||||||
Attack power (and healing power). Needs more research on this.
|
Dereferencing the actor (Player right now) for stats seem meh, perhaps consider a structure purely for stats?
|
||||||
Damage outgoing calculations. This includes auto-attacks, etc.
|
Reduce repeated code (more specifically the data we pull from exd)
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// 3 Versions. SB and HW are linear, ARR is polynomial.
|
// 3 Versions. SB and HW are linear, ARR is polynomial.
|
||||||
// Originally from Player.cpp, calculateStats().
|
// Originally from Player.cpp, calculateStats().
|
||||||
|
|
||||||
float CalcBattle::calculateBaseStat( PlayerPtr pPlayer )
|
float CalcStats::calculateBaseStat( PlayerPtr pPlayer )
|
||||||
{
|
{
|
||||||
float base = 0.0f;
|
float base = 0.0f;
|
||||||
uint8_t level = pPlayer->getLevel();
|
uint8_t level = pPlayer->getLevel();
|
||||||
|
@ -53,10 +55,10 @@ float CalcBattle::calculateBaseStat( PlayerPtr pPlayer )
|
||||||
// Leggerless' HP Formula
|
// Leggerless' HP Formula
|
||||||
// ROUNDDOWN(JobModHP * (BaseHP / 100)) + ROUNDDOWN(VitHPMod / 100 * (VIT - BaseDET))
|
// ROUNDDOWN(JobModHP * (BaseHP / 100)) + ROUNDDOWN(VitHPMod / 100 * (VIT - BaseDET))
|
||||||
|
|
||||||
uint32_t CalcBattle::calculateMaxHp( PlayerPtr pPlayer )
|
uint32_t CalcStats::calculateMaxHp( PlayerPtr pPlayer )
|
||||||
{
|
{
|
||||||
// TODO: Replace ApproxBaseHP with something that can get us an accurate BaseHP.
|
// TODO: Replace ApproxBaseHP with something that can get us an accurate BaseHP.
|
||||||
// Is there any way to pull BaseHP without having to manually use a pet for every level, and using the values from a table?
|
// Is there any way to pull reliable BaseHP without having to manually use a pet for every level, and using the values from a table?
|
||||||
// More info here: https://docs.google.com/spreadsheets/d/1de06KGT0cNRUvyiXNmjNgcNvzBCCQku7jte5QxEQRbs/edit?usp=sharing
|
// More info here: https://docs.google.com/spreadsheets/d/1de06KGT0cNRUvyiXNmjNgcNvzBCCQku7jte5QxEQRbs/edit?usp=sharing
|
||||||
|
|
||||||
auto classInfoIt = g_exdData.m_classJobInfoMap.find( static_cast< uint8_t >( pPlayer->getClass() ) );
|
auto classInfoIt = g_exdData.m_classJobInfoMap.find( static_cast< uint8_t >( pPlayer->getClass() ) );
|
||||||
|
@ -91,7 +93,7 @@ uint32_t CalcBattle::calculateMaxHp( PlayerPtr pPlayer )
|
||||||
// Leggerless' MP Formula
|
// Leggerless' MP Formula
|
||||||
// ROUNDDOWN(((ROUNDDOWN(((PIE - BaseDET) * PieMPMod/100),0) + BaseMP) * JobModMP / 100),0)
|
// ROUNDDOWN(((ROUNDDOWN(((PIE - BaseDET) * PieMPMod/100),0) + BaseMP) * JobModMP / 100),0)
|
||||||
|
|
||||||
uint32_t CalcBattle::calculateMaxMp( PlayerPtr pPlayer )
|
uint32_t CalcStats::calculateMaxMp( PlayerPtr pPlayer )
|
||||||
{
|
{
|
||||||
auto classInfoIt = g_exdData.m_classJobInfoMap.find( static_cast< uint8_t >( pPlayer->getClass() ) );
|
auto classInfoIt = g_exdData.m_classJobInfoMap.find( static_cast< uint8_t >( pPlayer->getClass() ) );
|
||||||
auto paramGrowthInfoIt = g_exdData.m_paramGrowthInfoMap.find( pPlayer->getLevel() );
|
auto paramGrowthInfoIt = g_exdData.m_paramGrowthInfoMap.find( pPlayer->getLevel() );
|
||||||
|
@ -110,18 +112,3 @@ uint32_t CalcBattle::calculateMaxMp( PlayerPtr pPlayer )
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t CalcBattle::calculateHealValue( PlayerPtr pPlayer, uint32_t potency )
|
|
||||||
{
|
|
||||||
auto classInfoIt = g_exdData.m_classJobInfoMap.find( static_cast< uint8_t >( pPlayer->getClass() ) );
|
|
||||||
auto paramGrowthInfoIt = g_exdData.m_paramGrowthInfoMap.find( pPlayer->getLevel() );
|
|
||||||
|
|
||||||
if ( classInfoIt == g_exdData.m_classJobInfoMap.end() ||
|
|
||||||
paramGrowthInfoIt == g_exdData.m_paramGrowthInfoMap.end())
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
auto jobModVal = classInfoIt->second;
|
|
||||||
|
|
||||||
// consider 3% variation
|
|
||||||
return potency / 10;
|
|
||||||
}
|
|
|
@ -1,23 +1,20 @@
|
||||||
#ifndef _CALCBATTLE_H
|
#ifndef _CALCSTATS_H
|
||||||
#define _CALCBATTLE_H
|
#define _CALCSTATS_H
|
||||||
|
|
||||||
#include <src/servers/Server_Common/Common.h>
|
#include <Server_Common/Common.h>
|
||||||
|
#include <Server_Zone/Actor/Actor.h>
|
||||||
#include "Actor.h"
|
|
||||||
|
|
||||||
using namespace Core::Entity;
|
using namespace Core::Entity;
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
namespace Data {
|
namespace Math {
|
||||||
|
|
||||||
class CalcBattle
|
class CalcStats
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static float calculateBaseStat( PlayerPtr pPlayer );
|
static float calculateBaseStat( PlayerPtr pPlayer );
|
||||||
static uint32_t calculateMaxMp( PlayerPtr pPlayer );
|
static uint32_t calculateMaxMp( PlayerPtr pPlayer );
|
||||||
static uint32_t calculateMaxHp( PlayerPtr pPlayer );
|
static uint32_t calculateMaxHp( PlayerPtr pPlayer );
|
||||||
static uint32_t calculateHealValue( PlayerPtr pPlayer, uint32_t potency );
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -126,7 +126,7 @@ void Core::Network::GameConnection::actionHandler( const Packets::GamePacket& in
|
||||||
}
|
}
|
||||||
case 0x12F: // Get title list
|
case 0x12F: // Get title list
|
||||||
{
|
{
|
||||||
GamePacketNew< FFXIVIpcPlayerTitleList, ServerZoneIpcType > titleListPacket( pPlayer->getId() );
|
ZoneChannelPacket< FFXIVIpcPlayerTitleList > titleListPacket( pPlayer->getId() );
|
||||||
memcpy( titleListPacket.data().titleList, pPlayer->getTitleList(), sizeof( titleListPacket.data().titleList ) );
|
memcpy( titleListPacket.data().titleList, pPlayer->getTitleList(), sizeof( titleListPacket.data().titleList ) );
|
||||||
|
|
||||||
pPlayer->queuePacket( titleListPacket );
|
pPlayer->queuePacket( titleListPacket );
|
||||||
|
|
|
@ -27,7 +27,7 @@ using namespace Core::Network::Packets::Server;
|
||||||
void Core::Network::GameConnection::cfDutyInfoRequest( const Packets::GamePacket& inPacket,
|
void Core::Network::GameConnection::cfDutyInfoRequest( const Packets::GamePacket& inPacket,
|
||||||
Entity::PlayerPtr pPlayer )
|
Entity::PlayerPtr pPlayer )
|
||||||
{
|
{
|
||||||
GamePacketNew< FFXIVIpcCFDutyInfo, ServerZoneIpcType > dutyInfoPacket( pPlayer->getId() );
|
ZoneChannelPacket< FFXIVIpcCFDutyInfo > dutyInfoPacket( pPlayer->getId() );
|
||||||
|
|
||||||
auto penaltyMinutes = pPlayer->getCFPenaltyMinutes();
|
auto penaltyMinutes = pPlayer->getCFPenaltyMinutes();
|
||||||
if (penaltyMinutes > 255)
|
if (penaltyMinutes > 255)
|
||||||
|
@ -39,7 +39,7 @@ void Core::Network::GameConnection::cfDutyInfoRequest( const Packets::GamePacket
|
||||||
|
|
||||||
queueOutPacket( dutyInfoPacket );
|
queueOutPacket( dutyInfoPacket );
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcCFPlayerInNeed, ServerZoneIpcType > inNeedsPacket( pPlayer->getId() );
|
ZoneChannelPacket< FFXIVIpcCFPlayerInNeed > inNeedsPacket( pPlayer->getId() );
|
||||||
queueOutPacket( inNeedsPacket );
|
queueOutPacket( inNeedsPacket );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ void Core::Network::GameConnection::cfRegisterDuty( const Packets::GamePacket& i
|
||||||
pPlayer->sendDebug("ContentId5" + std::to_string(contentId5));
|
pPlayer->sendDebug("ContentId5" + std::to_string(contentId5));
|
||||||
|
|
||||||
// let's cancel it because otherwise you can't register it again
|
// let's cancel it because otherwise you can't register it again
|
||||||
GamePacketNew< FFXIVIpcCFNotify, ServerZoneIpcType > cfCancelPacket( pPlayer->getId() );
|
ZoneChannelPacket< FFXIVIpcCFNotify > cfCancelPacket( pPlayer->getId() );
|
||||||
cfCancelPacket.data().state1 = 3;
|
cfCancelPacket.data().state1 = 3;
|
||||||
cfCancelPacket.data().state2 = 1; // Your registration is withdrawn.
|
cfCancelPacket.data().state2 = 1; // Your registration is withdrawn.
|
||||||
queueOutPacket( cfCancelPacket );
|
queueOutPacket( cfCancelPacket );
|
||||||
|
|
|
@ -139,7 +139,7 @@ void Core::Network::GameConnection::eventHandler( const Packets::GamePacket& inP
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcEventLinkshell, ServerZoneIpcType > linkshellEvent( pPlayer->getId() );
|
ZoneChannelPacket< FFXIVIpcEventLinkshell > linkshellEvent( pPlayer->getId() );
|
||||||
linkshellEvent.data().eventId = eventId;
|
linkshellEvent.data().eventId = eventId;
|
||||||
linkshellEvent.data().scene = static_cast< uint8_t >(subEvent);
|
linkshellEvent.data().scene = static_cast< uint8_t >(subEvent);
|
||||||
linkshellEvent.data().param3 = 1;
|
linkshellEvent.data().param3 = 1;
|
||||||
|
|
|
@ -86,10 +86,12 @@ enum GmCommand
|
||||||
GCRank = 0x0155,
|
GCRank = 0x0155,
|
||||||
Aetheryte = 0x015E,
|
Aetheryte = 0x015E,
|
||||||
Teri = 0x0258,
|
Teri = 0x0258,
|
||||||
|
Kick = 0x025C,
|
||||||
TeriInfo = 0x025D,
|
TeriInfo = 0x025D,
|
||||||
Jump = 0x025E,
|
Jump = 0x025E,
|
||||||
JumpNpc = 0x025F,
|
JumpNpc = 0x025F,
|
||||||
};
|
};
|
||||||
|
|
||||||
void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPacket, Entity::PlayerPtr pPlayer )
|
void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPacket, Entity::PlayerPtr pPlayer )
|
||||||
{
|
{
|
||||||
if( pPlayer->getGmRank() <= 0 )
|
if( pPlayer->getGmRank() <= 0 )
|
||||||
|
@ -126,92 +128,12 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
||||||
|
|
||||||
switch( commandId )
|
switch( commandId )
|
||||||
{
|
{
|
||||||
case GmCommand::Kill:
|
|
||||||
{
|
|
||||||
targetActor->takeDamage( 9999999 );
|
|
||||||
pPlayer->sendNotice( "Killed " + std::to_string( targetActor->getId() ) );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GmCommand::QuestSequence:
|
|
||||||
{
|
|
||||||
targetPlayer->updateQuest( param1, param2 );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GmCommand::QuestComplete:
|
|
||||||
{
|
|
||||||
targetPlayer->finishQuest( param1 );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GmCommand::QuestAccept:
|
|
||||||
{
|
|
||||||
targetPlayer->updateQuest( param1, 1 );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GmCommand::QuestCancel:
|
|
||||||
{
|
|
||||||
targetPlayer->removeQuest( param1 );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GmCommand::QuestIncomplete:
|
|
||||||
{
|
|
||||||
targetPlayer->unfinishQuest( param1 );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GmCommand::Speed:
|
|
||||||
{
|
|
||||||
targetPlayer->queuePacket( ActorControlPacket143( pPlayer->getId(), Flee, param1 ) );
|
|
||||||
pPlayer->sendNotice( "Speed for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GmCommand::Gil:
|
|
||||||
{
|
|
||||||
targetPlayer->addCurrency( 1, param1 );
|
|
||||||
pPlayer->sendNotice( "Added " + std::to_string( param1 ) + " Gil for " + targetPlayer->getName() );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GmCommand::Lv:
|
case GmCommand::Lv:
|
||||||
{
|
{
|
||||||
targetPlayer->setLevel( param1 );
|
targetPlayer->setLevel( param1 );
|
||||||
pPlayer->sendNotice( "Level for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
pPlayer->sendNotice( "Level for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GmCommand::Hp:
|
|
||||||
{
|
|
||||||
targetPlayer->setHp( param1 );
|
|
||||||
pPlayer->sendNotice( "Hp for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GmCommand::Mp:
|
|
||||||
{
|
|
||||||
targetPlayer->setMp( param1 );
|
|
||||||
pPlayer->sendNotice( "Mp for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GmCommand::Gp:
|
|
||||||
{
|
|
||||||
targetPlayer->setHp( param1 );
|
|
||||||
pPlayer->sendNotice( "Gp for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GmCommand::Exp:
|
|
||||||
{
|
|
||||||
targetPlayer->gainExp( param1 );
|
|
||||||
pPlayer->sendNotice( std::to_string( param1 ) + " Exp was added to " + targetPlayer->getName() );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GmCommand::Sex:
|
|
||||||
{
|
|
||||||
targetPlayer->setLookAt( CharaLook::Gender, param1 );
|
|
||||||
pPlayer->sendNotice( "Sex for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
|
||||||
targetPlayer->spawn( targetPlayer );
|
|
||||||
auto inRange = targetActor->getInRangeActors();
|
|
||||||
for( auto actor : inRange )
|
|
||||||
{
|
|
||||||
targetPlayer->despawn( actor->getAsPlayer() );
|
|
||||||
targetPlayer->spawn( actor->getAsPlayer() );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GmCommand::Race:
|
case GmCommand::Race:
|
||||||
{
|
{
|
||||||
targetPlayer->setLookAt( CharaLook::Race, param1 );
|
targetPlayer->setLookAt( CharaLook::Race, param1 );
|
||||||
|
@ -238,21 +160,17 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GmCommand::Item:
|
case GmCommand::Sex:
|
||||||
{
|
{
|
||||||
if( param2 < 1 || param2 > 99 )
|
targetPlayer->setLookAt( CharaLook::Gender, param1 );
|
||||||
|
pPlayer->sendNotice( "Sex for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
||||||
|
targetPlayer->spawn( targetPlayer );
|
||||||
|
auto inRange = targetActor->getInRangeActors();
|
||||||
|
for ( auto actor : inRange )
|
||||||
{
|
{
|
||||||
param2 = 1;
|
targetPlayer->despawn( actor->getAsPlayer() );
|
||||||
|
targetPlayer->spawn( actor->getAsPlayer() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( param1 == 0xcccccccc ) )
|
|
||||||
{
|
|
||||||
pPlayer->sendUrgent( "Syntaxerror." );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !targetPlayer->addItem( -1, param1, param2 ) )
|
|
||||||
pPlayer->sendUrgent( "Item " + std::to_string( param1 ) + " not found..." );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GmCommand::Time:
|
case GmCommand::Time:
|
||||||
|
@ -268,69 +186,50 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
||||||
targetPlayer->getName() + " set in range." );
|
targetPlayer->getName() + " set in range." );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GmCommand::TeriInfo:
|
case GmCommand::Call:
|
||||||
{
|
|
||||||
pPlayer->sendNotice( "ZoneId: " + std::to_string( pPlayer->getZoneId() ) + "\nName: " +
|
|
||||||
pPlayer->getCurrentZone()->getName() + "\nInternalName: " +
|
|
||||||
pPlayer->getCurrentZone()->getInternalName() + "\nPopCount: " +
|
|
||||||
std::to_string( pPlayer->getCurrentZone()->getPopCount() ) +
|
|
||||||
"\nCurrentWeather:" + std::to_string( pPlayer->getCurrentZone()->getCurrentWeather() ) +
|
|
||||||
"\nNextWeather:" + std::to_string( pPlayer->getCurrentZone()->getNextWeather() ) );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GmCommand::Teri:
|
|
||||||
{
|
|
||||||
auto zoneInfo = g_zoneMgr.getZone( param1 );
|
|
||||||
if ( !zoneInfo )
|
|
||||||
{
|
|
||||||
pPlayer->sendUrgent( "Invalid zone " + std::to_string( param1 ) );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
targetPlayer->setPosition( targetPlayer->getPos() );
|
|
||||||
targetPlayer->performZoning( param1, targetPlayer->getPos(), 0 );
|
|
||||||
pPlayer->sendNotice( targetPlayer->getName() + " was warped to zone " + std::to_string( param1 ) + " (" + zoneInfo->getName( ) + ")" );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GmCommand::Jump:
|
|
||||||
{
|
{
|
||||||
|
if ( targetPlayer->getZoneId() != pPlayer->getZoneId() )
|
||||||
|
targetPlayer->setZone( pPlayer->getZoneId() );
|
||||||
|
|
||||||
auto inRange = pPlayer->getInRangeActors();
|
targetPlayer->changePosition( pPlayer->getPos().x, pPlayer->getPos().y, pPlayer->getPos().z,
|
||||||
for( auto actor : inRange )
|
pPlayer->getRotation() );
|
||||||
{
|
pPlayer->sendNotice( "Calling " + targetPlayer->getName() );
|
||||||
pPlayer->changePosition( targetActor->getPos().x, targetActor->getPos().y, targetActor->getPos().z,
|
|
||||||
targetActor->getRotation() );
|
|
||||||
}
|
|
||||||
pPlayer->sendNotice( "Jumping to " + targetPlayer->getName() + " in range." );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GmCommand::Collect:
|
case GmCommand::Inspect:
|
||||||
{
|
{
|
||||||
uint32_t gil = targetPlayer->getCurrency( 1 );
|
pPlayer->sendNotice( "Name: " + targetPlayer->getName() +
|
||||||
|
"\nGil: " + std::to_string( targetPlayer->getCurrency( 1 ) ) +
|
||||||
if( gil < param1 )
|
"\nZone: " + targetPlayer->getCurrentZone()->getName() +
|
||||||
{
|
"(" + std::to_string( targetPlayer->getZoneId() ) + ")" +
|
||||||
pPlayer->sendUrgent( "Player does not have enough Gil(" + std::to_string( gil ) + ")" );
|
"\nClass: " + std::to_string( static_cast< uint8_t >( targetPlayer->getClass() ) ) +
|
||||||
|
"\nLevel: " + std::to_string( targetPlayer->getLevel() ) +
|
||||||
|
"\nExp: " + std::to_string( targetPlayer->getExp() ) +
|
||||||
|
"\nSearchMessage: " + targetPlayer->getSearchMessage() +
|
||||||
|
"\nPlayTime: " + std::to_string( targetPlayer->getPlayTime() ) );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
case GmCommand::Speed:
|
||||||
{
|
{
|
||||||
targetPlayer->removeCurrency( 1, param1 );
|
targetPlayer->queuePacket( ActorControlPacket143( pPlayer->getId(), Flee, param1 ) );
|
||||||
pPlayer->sendNotice( "Removed " + std::to_string( param1 ) +
|
pPlayer->sendNotice( "Speed for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
||||||
" Gil from " + targetPlayer->getName() +
|
break;
|
||||||
"(" + std::to_string( gil ) + " before)" );
|
|
||||||
}
|
}
|
||||||
|
case GmCommand::Kill:
|
||||||
|
{
|
||||||
|
targetActor->takeDamage( 9999999 );
|
||||||
|
pPlayer->sendNotice( "Killed " + std::to_string( targetActor->getId() ) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GmCommand::Icon:
|
case GmCommand::Icon:
|
||||||
{
|
{
|
||||||
targetPlayer->setOnlineStatusMask( param1 );
|
targetPlayer->setOnlineStatusMask( param1 );
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcSetOnlineStatus, ServerZoneIpcType > statusPacket( targetPlayer->getId() );
|
ZoneChannelPacket< FFXIVIpcSetOnlineStatus > statusPacket( targetPlayer->getId() );
|
||||||
statusPacket.data().onlineStatusFlags = param1;
|
statusPacket.data().onlineStatusFlags = param1;
|
||||||
queueOutPacket( statusPacket );
|
queueOutPacket( statusPacket );
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcSetSearchInfo, ServerZoneIpcType > searchInfoPacket( targetPlayer->getId() );
|
ZoneChannelPacket< FFXIVIpcSetSearchInfo > searchInfoPacket( targetPlayer->getId() );
|
||||||
searchInfoPacket.data().onlineStatusFlags = param1;
|
searchInfoPacket.data().onlineStatusFlags = param1;
|
||||||
searchInfoPacket.data().selectRegion = targetPlayer->getSearchSelectRegion();
|
searchInfoPacket.data().selectRegion = targetPlayer->getSearchSelectRegion();
|
||||||
strcpy( searchInfoPacket.data().searchMessage, targetPlayer->getSearchMessage() );
|
strcpy( searchInfoPacket.data().searchMessage, targetPlayer->getSearchMessage() );
|
||||||
|
@ -342,19 +241,28 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
||||||
pPlayer->sendNotice( "Icon for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
pPlayer->sendNotice( "Icon for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GmCommand::GC:
|
case GmCommand::Hp:
|
||||||
{
|
{
|
||||||
targetPlayer->setGc( param1 );
|
targetPlayer->setHp( param1 );
|
||||||
pPlayer->sendNotice( "GC for " + targetPlayer->getName() +
|
pPlayer->sendNotice( "Hp for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
||||||
" was set to " + std::to_string( targetPlayer->getGc() ) );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GmCommand::GCRank:
|
case GmCommand::Mp:
|
||||||
{
|
{
|
||||||
targetPlayer->setGcRankAt( targetPlayer->getGc() - 1, param1 );
|
targetPlayer->setMp( param1 );
|
||||||
pPlayer->sendNotice( "GC Rank for " + targetPlayer->getName() +
|
pPlayer->sendNotice( "Mp for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
||||||
" for GC " + std::to_string( targetPlayer->getGc() ) +
|
break;
|
||||||
" was set to " + std::to_string( targetPlayer->getGcRankArray()[targetPlayer->getGc() - 1] ) );
|
}
|
||||||
|
case GmCommand::Gp:
|
||||||
|
{
|
||||||
|
targetPlayer->setHp( param1 );
|
||||||
|
pPlayer->sendNotice( "Gp for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GmCommand::Exp:
|
||||||
|
{
|
||||||
|
targetPlayer->gainExp( param1 );
|
||||||
|
pPlayer->sendNotice( std::to_string( param1 ) + " Exp was added to " + targetPlayer->getName() );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GmCommand::Inv:
|
case GmCommand::Inv:
|
||||||
|
@ -368,29 +276,6 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
||||||
" was switched." );
|
" was switched." );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GmCommand::Aetheryte:
|
|
||||||
{
|
|
||||||
if( param1 == 0 )
|
|
||||||
{
|
|
||||||
if( param2 == 0 )
|
|
||||||
{
|
|
||||||
for( uint8_t i = 0; i < 255; i++ )
|
|
||||||
targetActor->getAsPlayer()->registerAetheryte( i );
|
|
||||||
|
|
||||||
pPlayer->sendNotice( "All Aetherytes for " + targetPlayer->getName() +
|
|
||||||
" were turned on." );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
targetActor->getAsPlayer()->registerAetheryte( param2 );
|
|
||||||
pPlayer->sendNotice( "Aetheryte " + std::to_string( param2 ) + " for " + targetPlayer->getName() +
|
|
||||||
" was turned on." );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GmCommand::Orchestrion:
|
case GmCommand::Orchestrion:
|
||||||
{
|
{
|
||||||
if ( param1 == 1 )
|
if ( param1 == 1 )
|
||||||
|
@ -411,7 +296,145 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GmCommand::Item:
|
||||||
|
{
|
||||||
|
if( param2 < 1 || param2 > 99 )
|
||||||
|
{
|
||||||
|
param2 = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ( param1 == 0xcccccccc ) )
|
||||||
|
{
|
||||||
|
pPlayer->sendUrgent( "Syntaxerror." );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !targetPlayer->addItem( -1, param1, param2 ) )
|
||||||
|
pPlayer->sendUrgent( "Item " + std::to_string( param1 ) + " not found..." );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GmCommand::Gil:
|
||||||
|
{
|
||||||
|
targetPlayer->addCurrency( 1, param1 );
|
||||||
|
pPlayer->sendNotice( "Added " + std::to_string( param1 ) + " Gil for " + targetPlayer->getName() );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GmCommand::Collect:
|
||||||
|
{
|
||||||
|
uint32_t gil = targetPlayer->getCurrency( 1 );
|
||||||
|
|
||||||
|
if ( gil < param1 )
|
||||||
|
{
|
||||||
|
pPlayer->sendUrgent( "Player does not have enough Gil(" + std::to_string( gil ) + ")" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
targetPlayer->removeCurrency( 1, param1 );
|
||||||
|
pPlayer->sendNotice( "Removed " + std::to_string( param1 ) +
|
||||||
|
" Gil from " + targetPlayer->getName() +
|
||||||
|
"(" + std::to_string( gil ) + " before)" );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GmCommand::QuestAccept:
|
||||||
|
{
|
||||||
|
targetPlayer->updateQuest( param1, 1 );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GmCommand::QuestCancel:
|
||||||
|
{
|
||||||
|
targetPlayer->removeQuest( param1 );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GmCommand::QuestComplete:
|
||||||
|
{
|
||||||
|
targetPlayer->finishQuest( param1 );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GmCommand::QuestIncomplete:
|
||||||
|
{
|
||||||
|
targetPlayer->unfinishQuest( param1 );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GmCommand::QuestSequence:
|
||||||
|
{
|
||||||
|
targetPlayer->updateQuest( param1, param2 );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GmCommand::GC:
|
||||||
|
{
|
||||||
|
targetPlayer->setGc( param1 );
|
||||||
|
pPlayer->sendNotice( "GC for " + targetPlayer->getName() +
|
||||||
|
" was set to " + std::to_string( targetPlayer->getGc() ) );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GmCommand::GCRank:
|
||||||
|
{
|
||||||
|
targetPlayer->setGcRankAt( targetPlayer->getGc() - 1, param1 );
|
||||||
|
pPlayer->sendNotice( "GC Rank for " + targetPlayer->getName() +
|
||||||
|
" for GC " + std::to_string( targetPlayer->getGc() ) +
|
||||||
|
" was set to " + std::to_string( targetPlayer->getGcRankArray()[targetPlayer->getGc() - 1] ) );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GmCommand::Aetheryte:
|
||||||
|
{
|
||||||
|
if ( param1 == 0 )
|
||||||
|
{
|
||||||
|
if ( param2 == 0 )
|
||||||
|
{
|
||||||
|
for ( uint8_t i = 0; i < 255; i++ )
|
||||||
|
targetActor->getAsPlayer()->registerAetheryte( i );
|
||||||
|
|
||||||
|
pPlayer->sendNotice( "All Aetherytes for " + targetPlayer->getName() +
|
||||||
|
" were turned on." );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
targetActor->getAsPlayer()->registerAetheryte( param2 );
|
||||||
|
pPlayer->sendNotice( "Aetheryte " + std::to_string( param2 ) + " for " + targetPlayer->getName() +
|
||||||
|
" was turned on." );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GmCommand::Teri:
|
||||||
|
{
|
||||||
|
auto zoneInfo = g_zoneMgr.getZone( param1 );
|
||||||
|
if ( !zoneInfo )
|
||||||
|
{
|
||||||
|
pPlayer->sendUrgent( "Invalid zone " + std::to_string( param1 ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
targetPlayer->setPosition( targetPlayer->getPos() );
|
||||||
|
targetPlayer->performZoning( param1, targetPlayer->getPos(), 0 );
|
||||||
|
pPlayer->sendNotice( targetPlayer->getName() + " was warped to zone " + std::to_string( param1 ) + " (" + zoneInfo->getName( ) + ")" );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GmCommand::TeriInfo:
|
||||||
|
{
|
||||||
|
pPlayer->sendNotice( "ZoneId: " + std::to_string( pPlayer->getZoneId() ) + "\nName: " +
|
||||||
|
pPlayer->getCurrentZone()->getName() + "\nInternalName: " +
|
||||||
|
pPlayer->getCurrentZone()->getInternalName() + "\nPopCount: " +
|
||||||
|
std::to_string( pPlayer->getCurrentZone()->getPopCount() ) +
|
||||||
|
"\nCurrentWeather:" + std::to_string( pPlayer->getCurrentZone()->getCurrentWeather() ) +
|
||||||
|
"\nNextWeather:" + std::to_string( pPlayer->getCurrentZone()->getNextWeather() ) );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GmCommand::Jump:
|
||||||
|
{
|
||||||
|
|
||||||
|
auto inRange = pPlayer->getInRangeActors();
|
||||||
|
for( auto actor : inRange )
|
||||||
|
{
|
||||||
|
pPlayer->changePosition( targetActor->getPos().x, targetActor->getPos().y, targetActor->getPos().z,
|
||||||
|
targetActor->getRotation() );
|
||||||
|
}
|
||||||
|
pPlayer->sendNotice( "Jumping to " + targetPlayer->getName() + " in range." );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -454,6 +477,7 @@ void Core::Network::GameConnection::gm2Handler( const Packets::GamePacket& inPac
|
||||||
|
|
||||||
if( !targetActor )
|
if( !targetActor )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto targetPlayer = targetActor->getAsPlayer();
|
auto targetPlayer = targetActor->getAsPlayer();
|
||||||
|
|
||||||
switch( commandId )
|
switch( commandId )
|
||||||
|
@ -481,30 +505,6 @@ void Core::Network::GameConnection::gm2Handler( const Packets::GamePacket& inPac
|
||||||
pPlayer->sendNotice( "Jumping to " + targetPlayer->getName() );
|
pPlayer->sendNotice( "Jumping to " + targetPlayer->getName() );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GmCommand::Call:
|
|
||||||
{
|
|
||||||
if( targetPlayer->getZoneId() != pPlayer->getZoneId() )
|
|
||||||
targetPlayer->setZone( pPlayer->getZoneId() );
|
|
||||||
|
|
||||||
targetPlayer->changePosition( pPlayer->getPos().x, pPlayer->getPos().y, pPlayer->getPos().z,
|
|
||||||
pPlayer->getRotation() );
|
|
||||||
pPlayer->sendNotice( "Calling " + targetPlayer->getName() );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GmCommand::Inspect:
|
|
||||||
{
|
|
||||||
pPlayer->sendNotice( "Name: " + targetPlayer->getName() +
|
|
||||||
"\nGil: " + std::to_string( targetPlayer->getCurrency( 1 ) ) +
|
|
||||||
"\nZone: " + targetPlayer->getCurrentZone()->getName() +
|
|
||||||
"(" + std::to_string( targetPlayer->getZoneId() ) + ")" +
|
|
||||||
"\nClass: " + std::to_string( static_cast< uint8_t >( targetPlayer->getClass() ) ) +
|
|
||||||
"\nLevel: " + std::to_string( targetPlayer->getLevel() ) +
|
|
||||||
"\nExp: " + std::to_string( targetPlayer->getExp() ) +
|
|
||||||
"\nSearchMessage: " + targetPlayer->getSearchMessage() +
|
|
||||||
"\nPlayTime: " + std::to_string( targetPlayer->getPlayTime() ) );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
pPlayer->sendUrgent( "GM2 Command not implemented: " + std::to_string( commandId ) );
|
pPlayer->sendUrgent( "GM2 Command not implemented: " + std::to_string( commandId ) );
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -46,7 +46,7 @@ void Core::Network::GameConnection::inventoryModifyHandler( const Packets::GameP
|
||||||
uint16_t fromContainer = inPacket.getValAt< uint16_t >( 0x2C );
|
uint16_t fromContainer = inPacket.getValAt< uint16_t >( 0x2C );
|
||||||
uint16_t toContainer = inPacket.getValAt< uint16_t >( 0x40 );
|
uint16_t toContainer = inPacket.getValAt< uint16_t >( 0x40 );
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcInventoryActionAck, ServerZoneIpcType > ackPacket( pPlayer->getId() );
|
ZoneChannelPacket< FFXIVIpcInventoryActionAck > ackPacket( pPlayer->getId() );
|
||||||
ackPacket.data().sequence = seq;
|
ackPacket.data().sequence = seq;
|
||||||
ackPacket.data().type = 7;
|
ackPacket.data().type = 7;
|
||||||
pPlayer->queuePacket( ackPacket );
|
pPlayer->queuePacket( ackPacket );
|
||||||
|
|
|
@ -77,11 +77,11 @@ void Core::Network::GameConnection::setSearchInfoHandler( const Packets::GamePac
|
||||||
// mark player as new adventurer
|
// mark player as new adventurer
|
||||||
pPlayer->setNewAdventurer( true );
|
pPlayer->setNewAdventurer( true );
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcSetOnlineStatus, ServerZoneIpcType > statusPacket( pPlayer->getId() );
|
ZoneChannelPacket< FFXIVIpcSetOnlineStatus > statusPacket( pPlayer->getId() );
|
||||||
statusPacket.data().onlineStatusFlags = status;
|
statusPacket.data().onlineStatusFlags = status;
|
||||||
queueOutPacket( statusPacket );
|
queueOutPacket( statusPacket );
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcSetSearchInfo, ServerZoneIpcType > searchInfoPacket( pPlayer->getId() );
|
ZoneChannelPacket< FFXIVIpcSetSearchInfo > searchInfoPacket( pPlayer->getId() );
|
||||||
searchInfoPacket.data().onlineStatusFlags = status;
|
searchInfoPacket.data().onlineStatusFlags = status;
|
||||||
searchInfoPacket.data().selectRegion = pPlayer->getSearchSelectRegion();
|
searchInfoPacket.data().selectRegion = pPlayer->getSearchSelectRegion();
|
||||||
strcpy( searchInfoPacket.data().searchMessage, pPlayer->getSearchMessage() );
|
strcpy( searchInfoPacket.data().searchMessage, pPlayer->getSearchMessage() );
|
||||||
|
@ -95,7 +95,7 @@ void Core::Network::GameConnection::setSearchInfoHandler( const Packets::GamePac
|
||||||
void Core::Network::GameConnection::reqSearchInfoHandler( const Packets::GamePacket& inPacket,
|
void Core::Network::GameConnection::reqSearchInfoHandler( const Packets::GamePacket& inPacket,
|
||||||
Entity::PlayerPtr pPlayer )
|
Entity::PlayerPtr pPlayer )
|
||||||
{
|
{
|
||||||
GamePacketNew< FFXIVIpcInitSearchInfo, ServerZoneIpcType > searchInfoPacket( pPlayer->getId() );
|
ZoneChannelPacket< FFXIVIpcInitSearchInfo > searchInfoPacket( pPlayer->getId() );
|
||||||
searchInfoPacket.data().onlineStatusFlags = pPlayer->getOnlineStatusMask();
|
searchInfoPacket.data().onlineStatusFlags = pPlayer->getOnlineStatusMask();
|
||||||
searchInfoPacket.data().selectRegion = pPlayer->getSearchSelectRegion();
|
searchInfoPacket.data().selectRegion = pPlayer->getSearchSelectRegion();
|
||||||
strcpy( searchInfoPacket.data().searchMessage, pPlayer->getSearchMessage() );
|
strcpy( searchInfoPacket.data().searchMessage, pPlayer->getSearchMessage() );
|
||||||
|
@ -105,7 +105,7 @@ void Core::Network::GameConnection::reqSearchInfoHandler( const Packets::GamePac
|
||||||
void Core::Network::GameConnection::linkshellListHandler( const Packets::GamePacket& inPacket,
|
void Core::Network::GameConnection::linkshellListHandler( const Packets::GamePacket& inPacket,
|
||||||
Entity::PlayerPtr pPlayer )
|
Entity::PlayerPtr pPlayer )
|
||||||
{
|
{
|
||||||
GamePacketNew< FFXIVIpcLinkshellList, ServerZoneIpcType > linkshellListPacket( pPlayer->getId() );
|
ZoneChannelPacket< FFXIVIpcLinkshellList > linkshellListPacket( pPlayer->getId() );
|
||||||
queueOutPacket( linkshellListPacket );
|
queueOutPacket( linkshellListPacket );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,7 +311,7 @@ void Core::Network::GameConnection::zoneLineHandler( const Packets::GamePacket&
|
||||||
targetZone = pLine->getTargetZoneId();
|
targetZone = pLine->getTargetZoneId();
|
||||||
rotation = pLine->getTargetRotation();
|
rotation = pLine->getTargetRotation();
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcPrepareZoning, ServerZoneIpcType > preparePacket( pPlayer->getId() );
|
ZoneChannelPacket< FFXIVIpcPrepareZoning > preparePacket( pPlayer->getId() );
|
||||||
preparePacket.data().targetZone = targetZone;
|
preparePacket.data().targetZone = targetZone;
|
||||||
|
|
||||||
//ActorControlPacket143 controlPacket( pPlayer, ActorControlType::DespawnZoneScreenMsg,
|
//ActorControlPacket143 controlPacket( pPlayer, ActorControlType::DespawnZoneScreenMsg,
|
||||||
|
@ -347,7 +347,7 @@ void Core::Network::GameConnection::discoveryHandler( const Packets::GamePacket&
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcDiscovery, ServerZoneIpcType > discoveryPacket( pPlayer->getId() );
|
ZoneChannelPacket< FFXIVIpcDiscovery > discoveryPacket( pPlayer->getId() );
|
||||||
discoveryPacket.data().map_id = pQR->getUInt( 2 );
|
discoveryPacket.data().map_id = pQR->getUInt( 2 );
|
||||||
discoveryPacket.data().map_part_id = pQR->getUInt( 3 );
|
discoveryPacket.data().map_part_id = pQR->getUInt( 3 );
|
||||||
|
|
||||||
|
@ -362,7 +362,7 @@ void Core::Network::GameConnection::discoveryHandler( const Packets::GamePacket&
|
||||||
void Core::Network::GameConnection::playTimeHandler( const Packets::GamePacket& inPacket,
|
void Core::Network::GameConnection::playTimeHandler( const Packets::GamePacket& inPacket,
|
||||||
Entity::PlayerPtr pPlayer )
|
Entity::PlayerPtr pPlayer )
|
||||||
{
|
{
|
||||||
GamePacketNew< FFXIVIpcPlayTime, ServerZoneIpcType > playTimePacket( pPlayer->getId() );
|
ZoneChannelPacket< FFXIVIpcPlayTime > playTimePacket( pPlayer->getId() );
|
||||||
playTimePacket.data().playTimeInMinutes = pPlayer->getPlayTime() / 60;
|
playTimePacket.data().playTimeInMinutes = pPlayer->getPlayTime() / 60;
|
||||||
pPlayer->queuePacket( playTimePacket );
|
pPlayer->queuePacket( playTimePacket );
|
||||||
}
|
}
|
||||||
|
@ -383,7 +383,7 @@ void Core::Network::GameConnection::blackListHandler( const Packets::GamePacket&
|
||||||
{
|
{
|
||||||
uint8_t count = inPacket.getValAt< uint8_t >( 0x21 );
|
uint8_t count = inPacket.getValAt< uint8_t >( 0x21 );
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcBlackList, ServerZoneIpcType > blackListPacket( pPlayer->getId() );
|
ZoneChannelPacket< FFXIVIpcBlackList > blackListPacket( pPlayer->getId() );
|
||||||
blackListPacket.data().sequence = count;
|
blackListPacket.data().sequence = count;
|
||||||
// TODO: Fill with actual blacklist data
|
// TODO: Fill with actual blacklist data
|
||||||
//blackListPacket.data().entry[0].contentId = 1;
|
//blackListPacket.data().entry[0].contentId = 1;
|
||||||
|
@ -435,7 +435,7 @@ void Core::Network::GameConnection::socialListHandler( const Packets::GamePacket
|
||||||
if( type == 0x02 )
|
if( type == 0x02 )
|
||||||
{ // party list
|
{ // party list
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcSocialList, ServerZoneIpcType > listPacket( pPlayer->getId() );;
|
ZoneChannelPacket< FFXIVIpcSocialList > listPacket( pPlayer->getId() );;
|
||||||
|
|
||||||
listPacket.data().type = 2;
|
listPacket.data().type = 2;
|
||||||
listPacket.data().sequence = count;
|
listPacket.data().sequence = count;
|
||||||
|
@ -469,7 +469,7 @@ void Core::Network::GameConnection::socialListHandler( const Packets::GamePacket
|
||||||
else if( type == 0x0b )
|
else if( type == 0x0b )
|
||||||
{ // friend list
|
{ // friend list
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcSocialList, ServerZoneIpcType > listPacket( pPlayer->getId() );
|
ZoneChannelPacket< FFXIVIpcSocialList > listPacket( pPlayer->getId() );
|
||||||
listPacket.data().type = 0x0B;
|
listPacket.data().type = 0x0B;
|
||||||
listPacket.data().sequence = count;
|
listPacket.data().sequence = count;
|
||||||
memset( listPacket.data().entries, 0, sizeof( listPacket.data().entries ) );
|
memset( listPacket.data().entries, 0, sizeof( listPacket.data().entries ) );
|
||||||
|
@ -535,7 +535,7 @@ void Core::Network::GameConnection::chatHandler( const Packets::GamePacket& inPa
|
||||||
void Core::Network::GameConnection::logoutHandler( const Packets::GamePacket& inPacket,
|
void Core::Network::GameConnection::logoutHandler( const Packets::GamePacket& inPacket,
|
||||||
Entity::PlayerPtr pPlayer )
|
Entity::PlayerPtr pPlayer )
|
||||||
{
|
{
|
||||||
GamePacketNew< FFXIVIpcLogout, ServerZoneIpcType > logoutPacket( pPlayer->getId() );
|
ZoneChannelPacket< FFXIVIpcLogout > logoutPacket( pPlayer->getId() );
|
||||||
logoutPacket.data().flags1 = 0x02;
|
logoutPacket.data().flags1 = 0x02;
|
||||||
logoutPacket.data().flags2 = 0x2000;
|
logoutPacket.data().flags2 = 0x2000;
|
||||||
queueOutPacket( logoutPacket );
|
queueOutPacket( logoutPacket );
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace Server {
|
||||||
* @brief The Ping response packet.
|
* @brief The Ping response packet.
|
||||||
*/
|
*/
|
||||||
class ActorControlPacket142 :
|
class ActorControlPacket142 :
|
||||||
public GamePacketNew< FFXIVIpcActorControl142, ServerZoneIpcType >
|
public ZoneChannelPacket< FFXIVIpcActorControl142 >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ActorControlPacket142( uint32_t actorId,
|
ActorControlPacket142( uint32_t actorId,
|
||||||
|
@ -24,7 +24,7 @@ public:
|
||||||
uint32_t param3 = 0,
|
uint32_t param3 = 0,
|
||||||
uint32_t param4 = 0,
|
uint32_t param4 = 0,
|
||||||
uint32_t padding1 = 0 ) :
|
uint32_t padding1 = 0 ) :
|
||||||
GamePacketNew< FFXIVIpcActorControl142, ServerZoneIpcType >( actorId, actorId )
|
ZoneChannelPacket< FFXIVIpcActorControl142 >( actorId, actorId )
|
||||||
{
|
{
|
||||||
initialize( category, param1, param2, param3, param4 );
|
initialize( category, param1, param2, param3, param4 );
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace Server {
|
||||||
* @brief The Ping response packet.
|
* @brief The Ping response packet.
|
||||||
*/
|
*/
|
||||||
class ActorControlPacket143 :
|
class ActorControlPacket143 :
|
||||||
public GamePacketNew< FFXIVIpcActorControl143, ServerZoneIpcType >
|
public ZoneChannelPacket< FFXIVIpcActorControl143 >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ActorControlPacket143( uint32_t actorId,
|
ActorControlPacket143( uint32_t actorId,
|
||||||
|
@ -26,7 +26,7 @@ public:
|
||||||
uint32_t param4 = 0,
|
uint32_t param4 = 0,
|
||||||
uint32_t param5 = 0,
|
uint32_t param5 = 0,
|
||||||
uint32_t padding1 = 0 ) :
|
uint32_t padding1 = 0 ) :
|
||||||
GamePacketNew< FFXIVIpcActorControl143, ServerZoneIpcType >( actorId, actorId )
|
ZoneChannelPacket< FFXIVIpcActorControl143 >( actorId, actorId )
|
||||||
{
|
{
|
||||||
initialize( category, param1, param2, param3, param4, param5 );
|
initialize( category, param1, param2, param3, param4, param5 );
|
||||||
};
|
};
|
||||||
|
|
|
@ -13,7 +13,7 @@ namespace Server {
|
||||||
* @brief The Ping response packet.
|
* @brief The Ping response packet.
|
||||||
*/
|
*/
|
||||||
class ActorControlPacket144 :
|
class ActorControlPacket144 :
|
||||||
public GamePacketNew< FFXIVIpcActorControl144, ServerZoneIpcType >
|
public ZoneChannelPacket< FFXIVIpcActorControl144 >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ActorControlPacket144( uint32_t actorId,
|
ActorControlPacket144( uint32_t actorId,
|
||||||
|
@ -24,7 +24,7 @@ public:
|
||||||
uint32_t param4 = 0,
|
uint32_t param4 = 0,
|
||||||
uint64_t targetId = 0,
|
uint64_t targetId = 0,
|
||||||
uint32_t padding1 = 0 ) :
|
uint32_t padding1 = 0 ) :
|
||||||
GamePacketNew< FFXIVIpcActorControl144, ServerZoneIpcType >( actorId, actorId )
|
ZoneChannelPacket< FFXIVIpcActorControl144 >( actorId, actorId )
|
||||||
{
|
{
|
||||||
initialize( category, param1, param2, param3, param4, targetId );
|
initialize( category, param1, param2, param3, param4, targetId );
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,11 +15,11 @@ namespace Server {
|
||||||
* @brief The Chat packet.
|
* @brief The Chat packet.
|
||||||
*/
|
*/
|
||||||
class ChatPacket :
|
class ChatPacket :
|
||||||
public GamePacketNew< FFXIVIpcChat, ServerZoneIpcType >
|
public ZoneChannelPacket< FFXIVIpcChat >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ChatPacket( Entity::PlayerPtr player, Common::ChatType chatType, const std::string& msg ) :
|
ChatPacket( Entity::PlayerPtr player, Common::ChatType chatType, const std::string& msg ) :
|
||||||
GamePacketNew< FFXIVIpcChat, ServerZoneIpcType >( player->getId(), player->getId() )
|
ZoneChannelPacket< FFXIVIpcChat >( player->getId(), player->getId() )
|
||||||
{
|
{
|
||||||
initialize( player, chatType, msg );
|
initialize( player, chatType, msg );
|
||||||
};
|
};
|
||||||
|
|
|
@ -11,14 +11,14 @@ namespace Server {
|
||||||
/**
|
/**
|
||||||
* @brief The packet sent to finish an event.
|
* @brief The packet sent to finish an event.
|
||||||
*/
|
*/
|
||||||
class EventFinishPacket : public GamePacketNew< FFXIVIpcEventFinish, ServerZoneIpcType >
|
class EventFinishPacket : public ZoneChannelPacket< FFXIVIpcEventFinish >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EventFinishPacket( uint32_t playerId,
|
EventFinishPacket( uint32_t playerId,
|
||||||
uint32_t eventId,
|
uint32_t eventId,
|
||||||
uint8_t param1,
|
uint8_t param1,
|
||||||
uint32_t param3 ) :
|
uint32_t param3 ) :
|
||||||
GamePacketNew< FFXIVIpcEventFinish, ServerZoneIpcType >( playerId, playerId )
|
ZoneChannelPacket< FFXIVIpcEventFinish >( playerId, playerId )
|
||||||
{
|
{
|
||||||
initialize( eventId, param1, param3 );
|
initialize( eventId, param1, param3 );
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace Server {
|
||||||
/**
|
/**
|
||||||
* @brief The packet sent to play an event.
|
* @brief The packet sent to play an event.
|
||||||
*/
|
*/
|
||||||
class EventPlayPacket : public GamePacketNew< FFXIVIpcEventPlay, ServerZoneIpcType >
|
class EventPlayPacket : public ZoneChannelPacket< FFXIVIpcEventPlay >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EventPlayPacket( uint32_t playerId,
|
EventPlayPacket( uint32_t playerId,
|
||||||
|
@ -23,7 +23,7 @@ public:
|
||||||
uint8_t param3,
|
uint8_t param3,
|
||||||
uint32_t param4 = 0,
|
uint32_t param4 = 0,
|
||||||
uint32_t param5 = 0 ) :
|
uint32_t param5 = 0 ) :
|
||||||
GamePacketNew< FFXIVIpcEventPlay, ServerZoneIpcType >( playerId, playerId )
|
ZoneChannelPacket< FFXIVIpcEventPlay >( playerId, playerId )
|
||||||
{
|
{
|
||||||
initialize( actorId, eventId, scene, flags, param3, param4, param5 );
|
initialize( actorId, eventId, scene, flags, param3, param4, param5 );
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace Server {
|
||||||
/**
|
/**
|
||||||
* @brief The packet sent to start an event.
|
* @brief The packet sent to start an event.
|
||||||
*/
|
*/
|
||||||
class EventStartPacket : public GamePacketNew< FFXIVIpcEventStart, ServerZoneIpcType >
|
class EventStartPacket : public ZoneChannelPacket< FFXIVIpcEventStart >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EventStartPacket( uint32_t playerId,
|
EventStartPacket( uint32_t playerId,
|
||||||
|
@ -21,7 +21,7 @@ public:
|
||||||
uint8_t param1 = 0,
|
uint8_t param1 = 0,
|
||||||
uint8_t param2 = 0,
|
uint8_t param2 = 0,
|
||||||
uint32_t param3 = 0 ) :
|
uint32_t param3 = 0 ) :
|
||||||
GamePacketNew< FFXIVIpcEventStart, ServerZoneIpcType >( playerId, playerId )
|
ZoneChannelPacket< FFXIVIpcEventStart >( playerId, playerId )
|
||||||
{
|
{
|
||||||
initialize( actorId, eventId, param1, param2, param3 );
|
initialize( actorId, eventId, param1, param2, param3 );
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,11 +15,11 @@ namespace Server {
|
||||||
* @brief The Client UI Initialization packet. This must be sent to the client
|
* @brief The Client UI Initialization packet. This must be sent to the client
|
||||||
* once upon connection to configure the UI.
|
* once upon connection to configure the UI.
|
||||||
*/
|
*/
|
||||||
class InitUIPacket : public GamePacketNew< FFXIVIpcInitUI, ServerZoneIpcType >
|
class InitUIPacket : public ZoneChannelPacket< FFXIVIpcInitUI >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InitUIPacket( Entity::PlayerPtr player ) :
|
InitUIPacket( Entity::PlayerPtr player ) :
|
||||||
GamePacketNew< FFXIVIpcInitUI, ServerZoneIpcType >( player->getId(), player->getId() )
|
ZoneChannelPacket< FFXIVIpcInitUI >( player->getId(), player->getId() )
|
||||||
{
|
{
|
||||||
initialize( player );
|
initialize( player );
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,11 +14,11 @@ namespace Server {
|
||||||
* @brief The update model packet.
|
* @brief The update model packet.
|
||||||
*/
|
*/
|
||||||
class ModelEquipPacket :
|
class ModelEquipPacket :
|
||||||
public GamePacketNew< FFXIVIpcModelEquip, ServerZoneIpcType >
|
public ZoneChannelPacket< FFXIVIpcModelEquip >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ModelEquipPacket( Entity::PlayerPtr player ) :
|
ModelEquipPacket( Entity::PlayerPtr player ) :
|
||||||
GamePacketNew< FFXIVIpcModelEquip, ServerZoneIpcType >( player->getId(), player->getId() )
|
ZoneChannelPacket< FFXIVIpcModelEquip >( player->getId(), player->getId() )
|
||||||
{
|
{
|
||||||
initialize( player );
|
initialize( player );
|
||||||
};
|
};
|
||||||
|
|
|
@ -18,11 +18,11 @@ namespace Server {
|
||||||
* once upon connection to configure the UI.
|
* once upon connection to configure the UI.
|
||||||
*/
|
*/
|
||||||
class MoveActorPacket :
|
class MoveActorPacket :
|
||||||
public GamePacketNew< FFXIVIpcActorMove, ServerZoneIpcType >
|
public ZoneChannelPacket< FFXIVIpcActorMove >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MoveActorPacket( Entity::ActorPtr actor, uint8_t unk1, uint8_t unk2, uint8_t unk3, uint16_t unk4 ) :
|
MoveActorPacket( Entity::ActorPtr actor, uint8_t unk1, uint8_t unk2, uint8_t unk3, uint16_t unk4 ) :
|
||||||
GamePacketNew< FFXIVIpcActorMove, ServerZoneIpcType >( actor->getId(), actor->getId() )
|
ZoneChannelPacket< FFXIVIpcActorMove >( actor->getId(), actor->getId() )
|
||||||
{
|
{
|
||||||
initialize( actor, unk1, unk2, unk3, unk4 );
|
initialize( actor, unk1, unk2, unk3, unk4 );
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,11 +14,11 @@ namespace Server {
|
||||||
* @brief The Ping response packet.
|
* @brief The Ping response packet.
|
||||||
*/
|
*/
|
||||||
class PingPacket :
|
class PingPacket :
|
||||||
public GamePacketNew< FFXIVIpcPing, ServerZoneIpcType >
|
public ZoneChannelPacket< FFXIVIpcPing >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PingPacket( Entity::PlayerPtr player, int32_t inVal ) :
|
PingPacket( Entity::PlayerPtr player, int32_t inVal ) :
|
||||||
GamePacketNew< FFXIVIpcPing, ServerZoneIpcType >( player->getId(), player->getId() )
|
ZoneChannelPacket< FFXIVIpcPing >( player->getId(), player->getId() )
|
||||||
{
|
{
|
||||||
initialize( player, inVal );
|
initialize( player, inVal );
|
||||||
};
|
};
|
||||||
|
|
|
@ -72,7 +72,7 @@ namespace Server {
|
||||||
|
|
||||||
m_data.title = pPlayer->getTitle();
|
m_data.title = pPlayer->getTitle();
|
||||||
m_data.voice = pPlayer->getVoiceId();
|
m_data.voice = pPlayer->getVoiceId();
|
||||||
m_data.currentMount = 0;
|
m_data.currentMount = pPlayer->getCurrentMount();
|
||||||
|
|
||||||
m_data.onlineStatus = static_cast< uint8_t >( pPlayer->getOnlineStatus() );
|
m_data.onlineStatus = static_cast< uint8_t >( pPlayer->getOnlineStatus() );
|
||||||
|
|
||||||
|
|
|
@ -14,17 +14,17 @@ namespace Server {
|
||||||
* @brief Packet sent to set a players state, this impacts which actions he can perform.
|
* @brief Packet sent to set a players state, this impacts which actions he can perform.
|
||||||
*/
|
*/
|
||||||
class PlayerStateFlagsPacket :
|
class PlayerStateFlagsPacket :
|
||||||
public GamePacketNew< FFXIVIpcPlayerStateFlags, ServerZoneIpcType >
|
public ZoneChannelPacket< FFXIVIpcPlayerStateFlags >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PlayerStateFlagsPacket( Entity::PlayerPtr pActor ) :
|
PlayerStateFlagsPacket( Entity::PlayerPtr pActor ) :
|
||||||
GamePacketNew< FFXIVIpcPlayerStateFlags, ServerZoneIpcType >( pActor->getId(), pActor->getId() )
|
ZoneChannelPacket< FFXIVIpcPlayerStateFlags >( pActor->getId(), pActor->getId() )
|
||||||
{
|
{
|
||||||
initialize( pActor->getStateFlags() );
|
initialize( pActor->getStateFlags() );
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerStateFlagsPacket( Entity::PlayerPtr pActor, std::vector< Common::PlayerStateFlag > flags ) :
|
PlayerStateFlagsPacket( Entity::PlayerPtr pActor, std::vector< Common::PlayerStateFlag > flags ) :
|
||||||
GamePacketNew< FFXIVIpcPlayerStateFlags, ServerZoneIpcType >( pActor->getId(), pActor->getId() )
|
ZoneChannelPacket< FFXIVIpcPlayerStateFlags >( pActor->getId(), pActor->getId() )
|
||||||
{
|
{
|
||||||
uint8_t newFlags[7];
|
uint8_t newFlags[7];
|
||||||
memset( newFlags, 0, 7 );
|
memset( newFlags, 0, 7 );
|
||||||
|
|
|
@ -14,12 +14,12 @@ namespace Server {
|
||||||
* @brief Packet to display a quest specific info message.
|
* @brief Packet to display a quest specific info message.
|
||||||
*/
|
*/
|
||||||
class QuestMessagePacket :
|
class QuestMessagePacket :
|
||||||
public GamePacketNew< FFXIVIpcQuestMessage, ServerZoneIpcType >
|
public ZoneChannelPacket< FFXIVIpcQuestMessage >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QuestMessagePacket( Entity::ActorPtr pActor, uint32_t questId, int8_t msgId,
|
QuestMessagePacket( Entity::ActorPtr pActor, uint32_t questId, int8_t msgId,
|
||||||
uint8_t type = 0, uint32_t var1 = 0, uint32_t var2 = 0 ) :
|
uint8_t type = 0, uint32_t var1 = 0, uint32_t var2 = 0 ) :
|
||||||
GamePacketNew< FFXIVIpcQuestMessage, ServerZoneIpcType >( pActor->getId(), pActor->getId() )
|
ZoneChannelPacket< FFXIVIpcQuestMessage >( pActor->getId(), pActor->getId() )
|
||||||
{
|
{
|
||||||
initialize( questId, msgId, type, var1, var2 );
|
initialize( questId, msgId, type, var1, var2 );
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,11 +14,11 @@ namespace Server {
|
||||||
* @brief The Ping response packet.
|
* @brief The Ping response packet.
|
||||||
*/
|
*/
|
||||||
class ServerNoticePacket :
|
class ServerNoticePacket :
|
||||||
public GamePacketNew<FFXIVIpcServerNotice, ServerZoneIpcType>
|
public ZoneChannelPacket< FFXIVIpcServerNotice >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ServerNoticePacket( uint32_t playerId, const std::string& message ) :
|
ServerNoticePacket( uint32_t playerId, const std::string& message ) :
|
||||||
GamePacketNew<FFXIVIpcServerNotice, ServerZoneIpcType>( playerId, playerId )
|
ZoneChannelPacket< FFXIVIpcServerNotice >( playerId, playerId )
|
||||||
{
|
{
|
||||||
initialize( message );
|
initialize( message );
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define _UPDATEHPMPTP_H
|
#define _UPDATEHPMPTP_H
|
||||||
|
|
||||||
#include <src/servers/Server_Common/Network/GamePacketNew.h>
|
#include <src/servers/Server_Common/Network/GamePacketNew.h>
|
||||||
|
#include <src/servers/Server_Zone/Actor/Actor.h>
|
||||||
#include "src/servers/Server_Zone/Forwards.h"
|
#include "src/servers/Server_Zone/Forwards.h"
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
@ -13,11 +14,11 @@ namespace Server {
|
||||||
* @brief The Ping response packet.
|
* @brief The Ping response packet.
|
||||||
*/
|
*/
|
||||||
class UpdateHpMpTpPacket :
|
class UpdateHpMpTpPacket :
|
||||||
public GamePacketNew< FFXIVIpcUpdateHpMpTp, ServerZoneIpcType >
|
public ZoneChannelPacket< FFXIVIpcUpdateHpMpTp >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
UpdateHpMpTpPacket( Entity::ActorPtr pActor ) :
|
UpdateHpMpTpPacket( Entity::ActorPtr pActor ) :
|
||||||
GamePacketNew< FFXIVIpcUpdateHpMpTp, ServerZoneIpcType >( pActor->getId(), pActor->getId() )
|
ZoneChannelPacket< FFXIVIpcUpdateHpMpTp >( pActor->getId(), pActor->getId() )
|
||||||
{
|
{
|
||||||
initialize( pActor );
|
initialize( pActor );
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,7 +44,8 @@ Core::Db::DbWorkerPool< Core::Db::CharaDbConnection > g_charaDb;
|
||||||
|
|
||||||
Core::ServerZone::ServerZone( const std::string& configPath )
|
Core::ServerZone::ServerZone( const std::string& configPath )
|
||||||
: m_configPath( configPath ),
|
: m_configPath( configPath ),
|
||||||
m_bRunning( true )
|
m_bRunning( true ),
|
||||||
|
m_lastDBPingTime( 0 )
|
||||||
{
|
{
|
||||||
m_pConfig = XMLConfigPtr( new XMLConfig );
|
m_pConfig = XMLConfigPtr( new XMLConfig );
|
||||||
}
|
}
|
||||||
|
@ -272,6 +273,12 @@ void Core::ServerZone::mainLoop()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( currTime - m_lastDBPingTime > 3 )
|
||||||
|
{
|
||||||
|
g_charaDb.keepAlive();
|
||||||
|
m_lastDBPingTime = currTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
auto it = this->m_sessionMap.begin();
|
auto it = this->m_sessionMap.begin();
|
||||||
for( ; it != this->m_sessionMap.end(); )
|
for( ; it != this->m_sessionMap.end(); )
|
||||||
|
|
|
@ -51,6 +51,7 @@ namespace Core {
|
||||||
|
|
||||||
uint16_t m_port;
|
uint16_t m_port;
|
||||||
std::string m_ip;
|
std::string m_ip;
|
||||||
|
uint32_t m_lastDBPingTime;
|
||||||
|
|
||||||
bool m_bRunning;
|
bool m_bRunning;
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ void Core::StatusEffect::StatusEffectContainer::addStatusEffect( StatusEffectPtr
|
||||||
pEffect->applyStatus();
|
pEffect->applyStatus();
|
||||||
m_effectMap[nextSlot] = pEffect;
|
m_effectMap[nextSlot] = pEffect;
|
||||||
|
|
||||||
GamePacketNew< Server::FFXIVIpcAddStatusEffect, ServerZoneIpcType > statusEffectAdd( m_pOwner->getId() );
|
ZoneChannelPacket< Server::FFXIVIpcAddStatusEffect > statusEffectAdd( m_pOwner->getId() );
|
||||||
statusEffectAdd.data().actor_id = pEffect->getTargetActorId();
|
statusEffectAdd.data().actor_id = pEffect->getTargetActorId();
|
||||||
statusEffectAdd.data().actor_id1 = pEffect->getSrcActorId();
|
statusEffectAdd.data().actor_id1 = pEffect->getSrcActorId();
|
||||||
statusEffectAdd.data().current_hp = m_pOwner->getHp();
|
statusEffectAdd.data().current_hp = m_pOwner->getHp();
|
||||||
|
@ -117,7 +117,7 @@ void Core::StatusEffect::StatusEffectContainer::sendUpdate()
|
||||||
{
|
{
|
||||||
uint64_t currentTimeMs = Util::getTimeMs();
|
uint64_t currentTimeMs = Util::getTimeMs();
|
||||||
|
|
||||||
GamePacketNew< Server::FFXIVIpcStatusEffectList, ServerZoneIpcType > statusEffectList( m_pOwner->getId() );
|
ZoneChannelPacket< Server::FFXIVIpcStatusEffectList > statusEffectList( m_pOwner->getId() );
|
||||||
|
|
||||||
statusEffectList.data().current_hp = m_pOwner->getHp();
|
statusEffectList.data().current_hp = m_pOwner->getHp();
|
||||||
statusEffectList.data().current_mp = m_pOwner->getMp();
|
statusEffectList.data().current_mp = m_pOwner->getMp();
|
||||||
|
|
|
@ -517,8 +517,7 @@ bool Zone::runZoneLogic()
|
||||||
|
|
||||||
if( changedWeather )
|
if( changedWeather )
|
||||||
{
|
{
|
||||||
Network::Packets::GamePacketNew< Network::Packets::Server::FFXIVIpcWeatherChange,
|
Network::Packets::ZoneChannelPacket< Network::Packets::Server::FFXIVIpcWeatherChange >
|
||||||
Network::Packets::ServerZoneIpcType >
|
|
||||||
weatherChangePacket( pSession->getPlayer()->getId() );
|
weatherChangePacket( pSession->getPlayer()->getId() );
|
||||||
weatherChangePacket.data().weatherId = m_currentWeather;
|
weatherChangePacket.data().weatherId = m_currentWeather;
|
||||||
weatherChangePacket.data().delay = 5.0f;
|
weatherChangePacket.data().delay = 5.0f;
|
||||||
|
|
Loading…
Add table
Reference in a new issue