diff --git a/src/servers/Scripts/common/GilShop.cpp b/src/servers/Scripts/common/GilShop.cpp index 6554ca72..d2d8cd5b 100644 --- a/src/servers/Scripts/common/GilShop.cpp +++ b/src/servers/Scripts/common/GilShop.cpp @@ -37,11 +37,10 @@ private: } // sell - else if( result.param2 == 2 ) + // can't sell if the vendor is yourself (eg, housing permit shop) + else if( result.param2 == 2 && result.actorId != player.getId() ) { - // so apparently shops will always show a sell window - // BUT won't always let you sell stuff (eg, housing permit menu) - // there doesn't seem to be anything in gilshop exd for that, so maybe it's some shitty server hack? + } player.playGilShop( result.eventId, SCENE_FLAGS, std::bind( &GilShop::shopInteractionCallback, this, std::placeholders::_1, std::placeholders::_2 ) ); diff --git a/src/servers/sapphire_zone/Event/EventHandler.h b/src/servers/sapphire_zone/Event/EventHandler.h index c9008964..77735623 100644 --- a/src/servers/sapphire_zone/Event/EventHandler.h +++ b/src/servers/sapphire_zone/Event/EventHandler.h @@ -8,6 +8,7 @@ namespace Core::Event struct SceneResult { + uint64_t actorId; uint32_t eventId; uint16_t param1; uint16_t param2; diff --git a/src/servers/sapphire_zone/Network/GameConnection.cpp b/src/servers/sapphire_zone/Network/GameConnection.cpp index cb960315..bfeda82f 100644 --- a/src/servers/sapphire_zone/Network/GameConnection.cpp +++ b/src/servers/sapphire_zone/Network/GameConnection.cpp @@ -321,6 +321,10 @@ void Core::Network::GameConnection::processOutQueue() pRP.addPacket( pPacket ); totalSize += pPacket->getSize(); + + // todo: figure out a good max set size and make it configurable + if( totalSize > 15000 ) + break; } if( totalSize > 0 ) diff --git a/src/servers/sapphire_zone/Network/Handlers/EventHandlers.cpp b/src/servers/sapphire_zone/Network/Handlers/EventHandlers.cpp index becbcdc5..ffb3124a 100644 --- a/src/servers/sapphire_zone/Network/Handlers/EventHandlers.cpp +++ b/src/servers/sapphire_zone/Network/Handlers/EventHandlers.cpp @@ -221,6 +221,7 @@ void Core::Network::GameConnection::eventHandlerReturn( const Packets::FFXIVARR_ if( eventCallback ) { Event::SceneResult result; + result.actorId = pEvent->getActorId(); result.eventId = eventId; result.param1 = param1; result.param2 = param2; diff --git a/src/servers/sapphire_zone/Zone/Land.cpp b/src/servers/sapphire_zone/Zone/Land.cpp index 3fbcd3ae..26335d5a 100644 --- a/src/servers/sapphire_zone/Zone/Land.cpp +++ b/src/servers/sapphire_zone/Zone/Land.cpp @@ -37,7 +37,7 @@ Core::Land::Land( uint16_t territoryTypeId, uint8_t wardNum, uint8_t landId, uin m_ownerPlayerId( 0 ), m_landSetId( landSetId ), m_landInfo( info ), - m_type( Common::LandType::Private ), + m_type( Common::LandType::none ), m_fcIcon( 0 ), m_fcIconColor( 0 ), m_fcId( 0 ), @@ -60,11 +60,11 @@ void Core::Land::load() "AND LandId = " + std::to_string( m_landId ) ); if( !res->next() ) { - pDb->directExecute( "INSERT INTO land ( landsetid, landid, type, size, status, landprice ) " + pDb->directExecute( "INSERT INTO land ( landsetid, landid, type, size, status, landprice, UpdateTime, OwnerId, HouseId ) " "VALUES ( " + std::to_string( m_landSetId ) + "," + std::to_string( m_landId ) + "," + std::to_string( static_cast< uint8_t >( m_type ) ) + "," + std::to_string( m_landInfo->plotSize[ m_landId ] ) + "," - + " 1, " + std::to_string( m_landInfo->initialPrice[ m_landId ] ) + " );" ); + + " 1, " + std::to_string( m_landInfo->initialPrice[ m_landId ] ) + ", 0, 0, 0 );" ); m_currentPrice = m_landInfo->initialPrice[ m_landId ]; m_minPrice = m_landInfo->minPrice[ m_landId ];