mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-01 16:37:45 +00:00
start of marketboard implementation
This commit is contained in:
parent
72261e465b
commit
6ce9d9557e
8 changed files with 86 additions and 2 deletions
|
@ -267,7 +267,7 @@ namespace Sapphire::Network::Packets
|
|||
MarketBoardRequestItemInformation = 0x00FE, // updated 4.4
|
||||
MarketBoardRequestItemListings = 0x00FF, // updated 4.4
|
||||
|
||||
SearchMarketboard = 0x0103, // updated 4.3
|
||||
SearchMarketboard = 0x0103, // updated 4.4
|
||||
ReqExamineFcInfo = 0x010F, // updated 4.1
|
||||
|
||||
FcInfoReqHandler = 0x011A, // updated 4.2
|
||||
|
|
|
@ -270,6 +270,19 @@ struct FFXIVIpcHousingUpdateObjectPosition :
|
|||
/* 001C */ uint32_t padding;
|
||||
};
|
||||
|
||||
struct FFXIVIpcSearchMarketboard :
|
||||
FFXIVIpcBasePacket< SearchMarketboard >
|
||||
{
|
||||
/* 0000 */ uint32_t unk;
|
||||
/* 0004 */ uint8_t unk2[2];
|
||||
/* 0006 */ uint8_t itemSearchCategory;
|
||||
/* 0007 */ uint8_t shouldCheckClassJobId; // wat? seems only 1 there at least...
|
||||
/* 0008 */ uint8_t maxEquipLevel;
|
||||
/* 0009 */ uint8_t classJobId;
|
||||
/* 000A */ char searchStr[40];
|
||||
/* 0032 */ uint16_t unk4[43];
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
19
src/world/Manager/MarketMgr.cpp
Normal file
19
src/world/Manager/MarketMgr.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
#include "MarketMgr.h"
|
||||
|
||||
Sapphire::World::Manager::MarketMgr::MarketMgr( Sapphire::FrameworkPtr pFw ) :
|
||||
BaseManager( pFw )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool Sapphire::World::Manager::MarketMgr::init()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Sapphire::World::Manager::MarketMgr::searchMarketboard( Entity::Player& player,
|
||||
uint8_t itemSearchCategory, uint8_t maxEquipLevel,
|
||||
uint8_t classJob )
|
||||
{
|
||||
|
||||
}
|
22
src/world/Manager/MarketMgr.h
Normal file
22
src/world/Manager/MarketMgr.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
#ifndef SAPPHIRE_MARKETMGR_H
|
||||
#define SAPPHIRE_MARKETMGR_H
|
||||
|
||||
#include "ForwardsZone.h"
|
||||
#include "BaseManager.h"
|
||||
|
||||
namespace Sapphire::World::Manager
|
||||
{
|
||||
class MarketMgr : public Manager::BaseManager
|
||||
{
|
||||
public:
|
||||
explicit MarketMgr( FrameworkPtr pFw );
|
||||
|
||||
bool init();
|
||||
|
||||
void searchMarketboard( Entity::Player& player, uint8_t itemSearchCategory, uint8_t maxEquipLevel, uint8_t classJob );
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif //SAPPHIRE_MARKETMGR_H
|
|
@ -1,3 +1,6 @@
|
|||
#ifndef SAPPHIRE_PLAYERMGR_H
|
||||
#define SAPPHIRE_PLAYERMGR_H
|
||||
|
||||
#include "ForwardsZone.h"
|
||||
#include "BaseManager.h"
|
||||
|
||||
|
@ -10,4 +13,6 @@ class PlayerMgr : public Manager::BaseManager
|
|||
|
||||
void movePlayerToLandDestination( Sapphire::Entity::Player& player, uint32_t landId, uint16_t param = 0 );
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // SAPPHIRE_PLAYERMGR_H
|
|
@ -176,6 +176,8 @@ namespace Sapphire::Network
|
|||
|
||||
DECLARE_HANDLER( reqMoveHousingItem );
|
||||
|
||||
DECLARE_HANDLER( searchMarketboard );
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
|
||||
#include "Manager/DebugCommandMgr.h"
|
||||
#include "Manager/EventMgr.h"
|
||||
#include "Manager/MarketMgr.h"
|
||||
|
||||
#include "Action/Action.h"
|
||||
#include "Action/ActionTeleport.h"
|
||||
|
@ -752,4 +753,16 @@ void Sapphire::Network::GameConnection::reqMoveHousingItem( FrameworkPtr pFw,
|
|||
|
||||
housingMgr->reqMoveHousingItem( player, data.ident, data.slot, data.pos, data.rotation );
|
||||
|
||||
}
|
||||
|
||||
void Sapphire::Network::GameConnection::searchMarketboard( FrameworkPtr pFw,
|
||||
const Sapphire::Network::Packets::FFXIVARR_PACKET_RAW& inPacket,
|
||||
Entity::Player& player )
|
||||
{
|
||||
auto marketMgr = pFw->get< MarketMgr >();
|
||||
|
||||
const auto packet = ZoneChannelPacket< Client::FFXIVIpcSearchMarketboard >( inPacket );
|
||||
const auto& data = packet.data();
|
||||
|
||||
marketMgr->searchMarketboard( player, data.itemSearchCategory, data.maxEquipLevel, data.classJobId );
|
||||
}
|
|
@ -39,6 +39,7 @@
|
|||
#include "Manager/InventoryMgr.h"
|
||||
#include "Manager/EventMgr.h"
|
||||
#include "Manager/ItemMgr.h"
|
||||
#include "Manager/MarketMgr.h"
|
||||
|
||||
using namespace Sapphire::World::Manager;
|
||||
|
||||
|
@ -160,6 +161,15 @@ void Sapphire::World::ServerMgr::run( int32_t argc, char* argv[] )
|
|||
return;
|
||||
}
|
||||
|
||||
auto pMarketMgr = std::make_shared< Manager::MarketMgr >( framework() );
|
||||
framework()->set< Manager::MarketMgr >( pMarketMgr );
|
||||
|
||||
if( !pMarketMgr->init() )
|
||||
{
|
||||
Logger::fatal( "Failed to setup market manager!" );
|
||||
return;
|
||||
}
|
||||
|
||||
loadBNpcTemplates();
|
||||
|
||||
Network::HivePtr hive( new Network::Hive() );
|
||||
|
|
Loading…
Add table
Reference in a new issue