mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-28 15:17:46 +00:00
Merge remote-tracking branch 'SapphireServer/develop' into develop
This commit is contained in:
commit
eddb0bf07c
11 changed files with 54 additions and 30 deletions
|
@ -185,7 +185,7 @@ enum ActorControlType : uint16_t
|
||||||
LogMsg = 0x205, // LogMessage?
|
LogMsg = 0x205, // LogMessage?
|
||||||
AchievementMsg = 0x206,
|
AchievementMsg = 0x206,
|
||||||
|
|
||||||
SetItemLevel = 0x207, //updated 4.5 ( 0x209 before )
|
SetItemLevel = 0x209,
|
||||||
|
|
||||||
ChallengeEntryCompleteMsg = 0x20B,
|
ChallengeEntryCompleteMsg = 0x20B,
|
||||||
ChallengeEntryUnlockMsg = 0x20C,
|
ChallengeEntryUnlockMsg = 0x20C,
|
||||||
|
|
|
@ -13,25 +13,20 @@ namespace Server {
|
||||||
* Structural representation of the packet sent by the server as response
|
* Structural representation of the packet sent by the server as response
|
||||||
* to a tell request
|
* to a tell request
|
||||||
*/
|
*/
|
||||||
struct FFXIVIpcTell :
|
struct FFXIVIpcTell : FFXIVIpcBasePacket< Tell >
|
||||||
FFXIVIpcBasePacket< Tell >
|
|
||||||
{
|
{
|
||||||
uint32_t u1;
|
uint64_t contentId;
|
||||||
uint16_t u2a;
|
uint16_t worldId;
|
||||||
uint16_t u2b;
|
|
||||||
uint8_t preName;
|
uint8_t preName;
|
||||||
uint8_t u3a;
|
|
||||||
bool isGm;
|
|
||||||
char receipientName[32];
|
char receipientName[32];
|
||||||
char msg[1031];
|
char msg[1029];
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Structural representation of the packet sent by the server as response
|
* Structural representation of the packet sent by the server as response
|
||||||
* to a failed tell because of unavailable target player
|
* to a failed tell because of unavailable target player
|
||||||
*/
|
*/
|
||||||
struct FFXIVIpcTellErrNotFound :
|
struct FFXIVIpcTellErrNotFound : FFXIVIpcBasePacket< TellErrNotFound >
|
||||||
FFXIVIpcBasePacket< TellErrNotFound >
|
|
||||||
{
|
{
|
||||||
char receipientName[32];
|
char receipientName[32];
|
||||||
};
|
};
|
||||||
|
|
|
@ -138,10 +138,10 @@ namespace Sapphire::Network::Packets
|
||||||
ActorOwner = 0x0187, // updated 4.5
|
ActorOwner = 0x0187, // updated 4.5
|
||||||
PlayerStateFlags = 0x0188, // updated 4.5
|
PlayerStateFlags = 0x0188, // updated 4.5
|
||||||
PlayerClassInfo = 0x0189, // updated 4.5
|
PlayerClassInfo = 0x0189, // updated 4.5
|
||||||
ModelEquip = 0x018A, // updated 4.5
|
ModelEquip = 0x018B, // updated 4.5
|
||||||
Examine = 0x018B, // updated 4.5
|
Examine = 0x018C, // updated 4.5
|
||||||
CharaNameReq = 0x018D, // updated 4.5
|
CharaNameReq = 0x018D, // updated 4.5
|
||||||
SetLevelSync = 0x0186, // not updated for 4.4, not sure what it is anymore
|
SetLevelSync = 0x1186, // not updated for 4.4, not sure what it is anymore
|
||||||
|
|
||||||
ItemInfo = 0x0196, // updated 4.5
|
ItemInfo = 0x0196, // updated 4.5
|
||||||
ContainerInfo = 0x0197, // updated 4.5
|
ContainerInfo = 0x0197, // updated 4.5
|
||||||
|
|
|
@ -147,12 +147,16 @@ struct FFXIVIpcSetSearchInfo :
|
||||||
/* 0012 */ char searchComment[193];
|
/* 0012 */ char searchComment[193];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FFXIVIpcTellHandler :
|
struct FFXIVIpcTellHandler : FFXIVIpcBasePacket< TellReq >
|
||||||
FFXIVIpcBasePacket< TellReq >
|
|
||||||
{
|
{
|
||||||
/* 0000 */ char pad_0000[4];
|
uint64_t contentId;
|
||||||
|
uint16_t worldId;
|
||||||
|
uint16_t u0A;
|
||||||
|
uint32_t u0C;
|
||||||
|
uint16_t worldId1;
|
||||||
|
uint8_t preName;
|
||||||
/* 0004 */ char targetPCName[32];
|
/* 0004 */ char targetPCName[32];
|
||||||
/* 0024 */ char message[1012];
|
/* 0024 */ char message[1029];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FFXIVIpcChatHandler :
|
struct FFXIVIpcChatHandler :
|
||||||
|
|
|
@ -853,7 +853,8 @@ struct FFXIVIpcInitUI : FFXIVIpcBasePacket< InitUI >
|
||||||
unsigned char companionDefRank;
|
unsigned char companionDefRank;
|
||||||
unsigned char companionAttRank;
|
unsigned char companionAttRank;
|
||||||
unsigned char companionHealRank;
|
unsigned char companionHealRank;
|
||||||
unsigned char unknown21A[19];
|
unsigned char u19[2];
|
||||||
|
unsigned char mountGuideMask[17];
|
||||||
char name[32];
|
char name[32];
|
||||||
unsigned char unknownOword[16];
|
unsigned char unknownOword[16];
|
||||||
unsigned char unknownOw;
|
unsigned char unknownOw;
|
||||||
|
@ -906,7 +907,6 @@ struct FFXIVIpcInitUI : FFXIVIpcBasePacket< InitUI >
|
||||||
unsigned char clearedGuildhests[10];
|
unsigned char clearedGuildhests[10];
|
||||||
unsigned char clearedTrials[8];
|
unsigned char clearedTrials[8];
|
||||||
unsigned char clearedPvp[5];
|
unsigned char clearedPvp[5];
|
||||||
unsigned char mountGuideMask[17];
|
|
||||||
unsigned short fishingRecordsFishWeight[26];
|
unsigned short fishingRecordsFishWeight[26];
|
||||||
unsigned int exploratoryMissionNextTimestamp;
|
unsigned int exploratoryMissionNextTimestamp;
|
||||||
unsigned char pvpLevel;
|
unsigned char pvpLevel;
|
||||||
|
@ -917,8 +917,7 @@ struct FFXIVIpcInitUI : FFXIVIpcBasePacket< InitUI >
|
||||||
* Structural representation of the packet sent by the server
|
* Structural representation of the packet sent by the server
|
||||||
* to set a players stats
|
* to set a players stats
|
||||||
*/
|
*/
|
||||||
struct FFXIVIpcPlayerStats :
|
struct FFXIVIpcPlayerStats : FFXIVIpcBasePacket< PlayerStats >
|
||||||
FFXIVIpcBasePacket< PlayerStats >
|
|
||||||
{
|
{
|
||||||
uint32_t strength;
|
uint32_t strength;
|
||||||
uint32_t dexterity;
|
uint32_t dexterity;
|
||||||
|
|
|
@ -40,10 +40,11 @@ Sapphire::Entity::BNpc::BNpc( FrameworkPtr pFw ) :
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Sapphire::Entity::BNpc::BNpc( BNpcTemplatePtr pTemplate, float posX, float posY, float posZ,
|
Sapphire::Entity::BNpc::BNpc( uint32_t id, BNpcTemplatePtr pTemplate, float posX, float posY, float posZ, float rot,
|
||||||
uint8_t level, uint32_t maxHp, FrameworkPtr pFw ) :
|
uint8_t level, uint32_t maxHp, FrameworkPtr pFw ) :
|
||||||
Npc( ObjKind::BattleNpc, pFw )
|
Npc( ObjKind::BattleNpc, pFw )
|
||||||
{
|
{
|
||||||
|
m_id = id;
|
||||||
m_modelChara = pTemplate->getModelChara();
|
m_modelChara = pTemplate->getModelChara();
|
||||||
m_displayFlags = pTemplate->getDisplayFlags();
|
m_displayFlags = pTemplate->getDisplayFlags();
|
||||||
m_pose = pTemplate->getPose();
|
m_pose = pTemplate->getPose();
|
||||||
|
@ -56,6 +57,7 @@ Sapphire::Entity::BNpc::BNpc( BNpcTemplatePtr pTemplate, float posX, float posY,
|
||||||
m_pos.x = posX;
|
m_pos.x = posX;
|
||||||
m_pos.y = posY;
|
m_pos.y = posY;
|
||||||
m_pos.z = posZ;
|
m_pos.z = posZ;
|
||||||
|
m_rot = rot;
|
||||||
m_level = level;
|
m_level = level;
|
||||||
|
|
||||||
m_maxHp = maxHp;
|
m_maxHp = maxHp;
|
||||||
|
|
|
@ -23,7 +23,8 @@ namespace Sapphire::Entity
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BNpc( FrameworkPtr pFw );
|
BNpc( FrameworkPtr pFw );
|
||||||
BNpc( BNpcTemplatePtr pTemplate, float posX, float posY, float posZ, uint8_t level, uint32_t maxHp, FrameworkPtr pFw );
|
BNpc( uint32_t id, BNpcTemplatePtr pTemplate, float posX, float posY, float posZ, float rot,
|
||||||
|
uint8_t level, uint32_t maxHp, FrameworkPtr pFw );
|
||||||
|
|
||||||
virtual ~BNpc() override;
|
virtual ~BNpc() override;
|
||||||
|
|
||||||
|
|
|
@ -432,13 +432,16 @@ void Sapphire::World::Manager::DebugCommandMgr::add( char* data, Entity::Player&
|
||||||
player.sendNotice( "Template {0} not found in cache!", params );
|
player.sendNotice( "Template {0} not found in cache!", params );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto pBNpc = std::make_shared< Entity::BNpc >( bNpcTemplate,
|
auto playerZone = player.getCurrentZone();
|
||||||
|
auto pBNpc = std::make_shared< Entity::BNpc >( playerZone->getNextActorId(),
|
||||||
|
bNpcTemplate,
|
||||||
player.getPos().x,
|
player.getPos().x,
|
||||||
player.getPos().y,
|
player.getPos().y,
|
||||||
player.getPos().z,
|
player.getPos().z,
|
||||||
|
player.getRot(),
|
||||||
1, 1000, framework() );
|
1, 1000, framework() );
|
||||||
|
|
||||||
auto playerZone = player.getCurrentZone();
|
|
||||||
|
|
||||||
//pBNpc->setCurrentZone( playerZone );
|
//pBNpc->setCurrentZone( playerZone );
|
||||||
//pBNpc->setPos( player.getPos().x, player.getPos().y, player.getPos().z );
|
//pBNpc->setPos( player.getPos().x, player.getPos().y, player.getPos().z );
|
||||||
|
|
|
@ -652,13 +652,16 @@ void Sapphire::Network::GameConnection::tellHandler( FrameworkPtr pFw,
|
||||||
auto tellPacket = makeChatPacket< FFXIVIpcTell >( player.getId() );
|
auto tellPacket = makeChatPacket< FFXIVIpcTell >( player.getId() );
|
||||||
strcpy( tellPacket->data().msg, packet.data().message );
|
strcpy( tellPacket->data().msg, packet.data().message );
|
||||||
strcpy( tellPacket->data().receipientName, player.getName().c_str() );
|
strcpy( tellPacket->data().receipientName, player.getName().c_str() );
|
||||||
|
// TODO: world id from server
|
||||||
|
tellPacket->data().contentId = player.getContentId();
|
||||||
|
tellPacket->data().worldId = 67;
|
||||||
// TODO: do these have a meaning?
|
// TODO: do these have a meaning?
|
||||||
//tellPacket.data().u1 = 0x92CD7337;
|
//tellPacket.data().u1 = 0x92CD7337;
|
||||||
//tellPacket.data().u2a = 0x2E;
|
//tellPacket.data().u2a = 0x2E;
|
||||||
//tellPacket.data().u2b = 0x40;
|
//tellPacket.data().u2b = 0x40;
|
||||||
if( player.isActingAsGm() )
|
if( player.isActingAsGm() )
|
||||||
{
|
{
|
||||||
tellPacket->data().isGm = true;
|
//tellPacket->data().isGm = true;
|
||||||
}
|
}
|
||||||
pTargetPlayer->queueChatPacket( tellPacket );
|
pTargetPlayer->queueChatPacket( tellPacket );
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <random>
|
||||||
|
|
||||||
#include <Logging/Logger.h>
|
#include <Logging/Logger.h>
|
||||||
#include <Util/Util.h>
|
#include <Util/Util.h>
|
||||||
|
@ -53,7 +54,8 @@ Sapphire::Zone::Zone() :
|
||||||
m_currentWeather( Weather::FairSkies ),
|
m_currentWeather( Weather::FairSkies ),
|
||||||
m_weatherOverride( Weather::None ),
|
m_weatherOverride( Weather::None ),
|
||||||
m_lastMobUpdate( 0 ),
|
m_lastMobUpdate( 0 ),
|
||||||
m_nextEObjId( 0x400D0000 )
|
m_nextEObjId( 0x400D0000 ),
|
||||||
|
m_nextActorId( 0x500D0000 )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -741,6 +743,12 @@ uint32_t Sapphire::Zone::getNextEObjId()
|
||||||
return ++m_nextEObjId;
|
return ++m_nextEObjId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t Sapphire::Zone::getNextActorId()
|
||||||
|
{
|
||||||
|
return ++m_nextActorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Sapphire::Entity::EventObjectPtr Sapphire::Zone::registerEObj( const std::string& name, uint32_t objectId, uint32_t mapLink,
|
Sapphire::Entity::EventObjectPtr Sapphire::Zone::registerEObj( const std::string& name, uint32_t objectId, uint32_t mapLink,
|
||||||
uint8_t state, FFXIVARR_POSITION3 pos, float scale,
|
uint8_t state, FFXIVARR_POSITION3 pos, float scale,
|
||||||
float rotation )
|
float rotation )
|
||||||
|
@ -804,6 +812,10 @@ bool Sapphire::Zone::loadSpawnGroups()
|
||||||
|
|
||||||
void Sapphire::Zone::updateSpawnPoints()
|
void Sapphire::Zone::updateSpawnPoints()
|
||||||
{
|
{
|
||||||
|
std::random_device rd;
|
||||||
|
std::mt19937 mt( rd() );
|
||||||
|
std::uniform_real_distribution< float > dist( 0.0, PI * 2 );
|
||||||
|
|
||||||
for( auto& group : m_spawnGroups )
|
for( auto& group : m_spawnGroups )
|
||||||
{
|
{
|
||||||
for( auto& point : group.getSpawnPointList() )
|
for( auto& point : group.getSpawnPointList() )
|
||||||
|
@ -820,12 +832,14 @@ void Sapphire::Zone::updateSpawnPoints()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Logger::error( "No template found for templateId#{0}", group.getTemplateId() );
|
uint32_t random = rand() % 20;
|
||||||
|
|
||||||
auto pBNpc = std::make_shared< Entity::BNpc >( bNpcTemplate,
|
auto pBNpc = std::make_shared< Entity::BNpc >( getNextActorId(),
|
||||||
|
bNpcTemplate,
|
||||||
point->getPosX(),
|
point->getPosX(),
|
||||||
point->getPosY(),
|
point->getPosY(),
|
||||||
point->getPosZ(),
|
point->getPosZ(),
|
||||||
|
dist( mt ),
|
||||||
group.getLevel(),
|
group.getLevel(),
|
||||||
group.getMaxHp(), m_pFw );
|
group.getMaxHp(), m_pFw );
|
||||||
point->setLinkedBNpc( pBNpc );
|
point->setLinkedBNpc( pBNpc );
|
||||||
|
|
|
@ -57,6 +57,7 @@ namespace Sapphire
|
||||||
std::map< uint8_t, int32_t > m_weatherRateMap;
|
std::map< uint8_t, int32_t > m_weatherRateMap;
|
||||||
|
|
||||||
uint32_t m_nextEObjId;
|
uint32_t m_nextEObjId;
|
||||||
|
uint32_t m_nextActorId;
|
||||||
FrameworkPtr m_pFw;
|
FrameworkPtr m_pFw;
|
||||||
|
|
||||||
std::vector< Entity::SpawnGroup > m_spawnGroups;
|
std::vector< Entity::SpawnGroup > m_spawnGroups;
|
||||||
|
@ -128,6 +129,8 @@ namespace Sapphire
|
||||||
|
|
||||||
uint32_t getNextEObjId();
|
uint32_t getNextEObjId();
|
||||||
|
|
||||||
|
uint32_t getNextActorId();
|
||||||
|
|
||||||
const std::string& getName() const;
|
const std::string& getName() const;
|
||||||
|
|
||||||
const std::string& getInternalName() const;
|
const std::string& getInternalName() const;
|
||||||
|
|
Loading…
Add table
Reference in a new issue