mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-12 21:47:45 +00:00
Send linkshell action result after creation of linkshells.
This commit is contained in:
parent
c2826ddc21
commit
3023a78533
5 changed files with 54 additions and 5 deletions
|
@ -121,6 +121,18 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
|
||||||
int16_t ResultCount;
|
int16_t ResultCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct FFXIVIpcLinkshellResult : FFXIVIpcBasePacket< LinkshellResult >
|
||||||
|
{
|
||||||
|
uint64_t LinkshellID;
|
||||||
|
uint64_t TargetCharacterID;
|
||||||
|
uint32_t UpPacketNo;
|
||||||
|
uint32_t Result;
|
||||||
|
uint8_t UpdateStatus;
|
||||||
|
uint8_t Identity;
|
||||||
|
char LinkshellName[32];
|
||||||
|
char TargetName[32];
|
||||||
|
};
|
||||||
|
|
||||||
struct FFXIVIpcInviteResult : FFXIVIpcBasePacket< InviteResult >
|
struct FFXIVIpcInviteResult : FFXIVIpcBasePacket< InviteResult >
|
||||||
{
|
{
|
||||||
uint32_t Result;
|
uint32_t Result;
|
||||||
|
|
|
@ -36,7 +36,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
eventMgr().playScene( player, getId(), 1, 0, callback );
|
eventMgr().playScene( player, getId(), 1, HIDE_HOTBAR | NO_DEFAULT_CAMERA, callback );
|
||||||
}
|
}
|
||||||
|
|
||||||
// create linkshell
|
// create linkshell
|
||||||
|
@ -46,24 +46,31 @@ public:
|
||||||
{
|
{
|
||||||
auto ls = linkshellMgr().createLinkshell( result.resultString, player );
|
auto ls = linkshellMgr().createLinkshell( result.resultString, player );
|
||||||
if( !ls )
|
if( !ls )
|
||||||
|
{
|
||||||
eventMgr().resumeScene( player, result.eventId, result.sceneId, { 0x15a } );
|
eventMgr().resumeScene( player, result.eventId, result.sceneId, { 0x15a } );
|
||||||
|
linkshellMgr().finishLinkshellCreation( result.resultString, 0x15a, player );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
eventMgr().resumeScene( player, result.eventId, result.sceneId, { 0 } );
|
eventMgr().resumeScene( player, result.eventId, result.sceneId, { 0 } );
|
||||||
|
linkshellMgr().finishLinkshellCreation( result.resultString, 0, player );
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
eventMgr().playScene( player, getId(), 2, 0, callback );
|
eventMgr().playScene( player, getId(), 2, HIDE_HOTBAR, callback );
|
||||||
}
|
}
|
||||||
|
|
||||||
// rename linkshell
|
// rename linkshell
|
||||||
void Scene00003( Entity::Player& player )
|
void Scene00003( Entity::Player& player )
|
||||||
{
|
{
|
||||||
eventMgr().playScene( player, getId(), 3, 0 );
|
eventMgr().playScene( player, getId(), 3, HIDE_HOTBAR );
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove linkshell
|
// remove linkshell
|
||||||
void Scene00004( Entity::Player& player )
|
void Scene00004( Entity::Player& player )
|
||||||
{
|
{
|
||||||
eventMgr().playScene( player, getId(), 4, 0 );
|
eventMgr().playScene( player, getId(), 4, HIDE_HOTBAR );
|
||||||
}
|
}
|
||||||
|
|
||||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||||
|
|
|
@ -548,7 +548,6 @@ void EventMgr::resumeScene( Entity::Player& player, uint32_t eventId, uint32_t s
|
||||||
if( !pEvent )
|
if( !pEvent )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pEvent->setPlayedScene( false );
|
|
||||||
pEvent->setEventReturnCallback( nullptr );
|
pEvent->setEventReturnCallback( nullptr );
|
||||||
auto resumeEvent = makeZonePacket< FFXIVIpcResumeEventScene2 >( player.getId() );
|
auto resumeEvent = makeZonePacket< FFXIVIpcResumeEventScene2 >( player.getId() );
|
||||||
resumeEvent->data().handlerId = eventId;
|
resumeEvent->data().handlerId = eventId;
|
||||||
|
|
|
@ -1,16 +1,33 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|
||||||
|
#include <Common.h>
|
||||||
|
#include <Exd/ExdData.h>
|
||||||
|
#include <Util/Util.h>
|
||||||
|
#include <Service.h>
|
||||||
|
|
||||||
#include <Logging/Logger.h>
|
#include <Logging/Logger.h>
|
||||||
#include <Database/DatabaseDef.h>
|
#include <Database/DatabaseDef.h>
|
||||||
#include <Service.h>
|
#include <Service.h>
|
||||||
#include <Manager/ChatChannelMgr.h>
|
#include <Manager/ChatChannelMgr.h>
|
||||||
|
#include <Network/GamePacket.h>
|
||||||
|
|
||||||
#include "Linkshell/Linkshell.h"
|
#include "Linkshell/Linkshell.h"
|
||||||
#include "LinkshellMgr.h"
|
#include "LinkshellMgr.h"
|
||||||
|
|
||||||
#include "Actor/Player.h"
|
#include "Actor/Player.h"
|
||||||
|
|
||||||
|
#include "WorldServer.h"
|
||||||
|
|
||||||
|
#include <Network/GameConnection.h>
|
||||||
|
#include <Network/GamePacket.h>
|
||||||
|
#include <Network/PacketDef/Zone/ServerZoneDef.h>
|
||||||
|
|
||||||
|
using namespace Sapphire::Common;
|
||||||
|
using namespace Sapphire::Network::Packets;
|
||||||
|
using namespace Sapphire::Network::Packets::WorldPackets::Server;
|
||||||
|
using namespace Sapphire::World::Manager;
|
||||||
|
|
||||||
bool Sapphire::World::Manager::LinkshellMgr::loadLinkshells()
|
bool Sapphire::World::Manager::LinkshellMgr::loadLinkshells()
|
||||||
{
|
{
|
||||||
auto& db = Common::Service< Db::DbWorkerPool< Db::ZoneDbConnection > >::ref();
|
auto& db = Common::Service< Db::DbWorkerPool< Db::ZoneDbConnection > >::ref();
|
||||||
|
@ -154,6 +171,18 @@ Sapphire::LinkshellPtr Sapphire::World::Manager::LinkshellMgr::createLinkshell(
|
||||||
|
|
||||||
return lsPtr;
|
return lsPtr;
|
||||||
}
|
}
|
||||||
|
void Sapphire::World::Manager::LinkshellMgr::finishLinkshellCreation( const std::string& name, uint32_t result, Entity::Player& player )
|
||||||
|
{
|
||||||
|
auto& server = Common::Service< World::WorldServer >::ref();
|
||||||
|
|
||||||
|
auto linkshellResult = makeZonePacket< FFXIVIpcLinkshellResult >( player.getId() );
|
||||||
|
linkshellResult->data().Result = result;
|
||||||
|
linkshellResult->data().UpPacketNo = 1;
|
||||||
|
linkshellResult->data().Identity = 0xFF;
|
||||||
|
strcpy( linkshellResult->data().LinkshellName, name.c_str() );
|
||||||
|
server.queueForPlayer( player.getCharacterId(), linkshellResult );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
const std::vector< Sapphire::LinkshellPtr > Sapphire::World::Manager::LinkshellMgr::getPlayerLinkshells( Entity::Player& player ) const
|
const std::vector< Sapphire::LinkshellPtr > Sapphire::World::Manager::LinkshellMgr::getPlayerLinkshells( Entity::Player& player ) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,6 +25,8 @@ namespace Sapphire::World::Manager
|
||||||
// create new linkshell entry and insert into db
|
// create new linkshell entry and insert into db
|
||||||
LinkshellPtr createLinkshell( const std::string& name, Entity::Player& player );
|
LinkshellPtr createLinkshell( const std::string& name, Entity::Player& player );
|
||||||
|
|
||||||
|
void finishLinkshellCreation( const std::string& name, uint32_t result, Entity::Player& player );
|
||||||
|
|
||||||
// get all linkshells associated with player
|
// get all linkshells associated with player
|
||||||
const std::vector< LinkshellPtr > getPlayerLinkshells( Entity::Player& player ) const;
|
const std::vector< LinkshellPtr > getPlayerLinkshells( Entity::Player& player ) const;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue