mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 18:24:12 +00:00
Updated vendor component
Fixed a few issues in VendorComponent. - Corrected serialization to only happen on construction. - Added functionality to refresh the vendor based on info from the vendor component table - some whitespaceing inconsistencies. - Sorted includes. Tested the vendor in Nimbus Station and when the player re-enters the world, the vendor inventory refreshes, as opposed to previously where the world would need to reset in order to refresh the inventory.
This commit is contained in:
@@ -1252,8 +1252,7 @@ void GameMessages::SendVendorOpenWindow(Entity* entity, const SystemAddress& sys
|
||||
SEND_PACKET
|
||||
}
|
||||
|
||||
// ah yes, impl code in a send function, beautiful!
|
||||
void GameMessages::SendVendorStatusUpdate(Entity* entity, const SystemAddress& sysAddr) {
|
||||
void GameMessages::SendVendorStatusUpdate(Entity* entity, const SystemAddress& sysAddr, bool bUpdateOnly) {
|
||||
CBITSTREAM
|
||||
CMSGHEADER
|
||||
|
||||
@@ -1265,7 +1264,7 @@ void GameMessages::SendVendorStatusUpdate(Entity* entity, const SystemAddress& s
|
||||
bitStream.Write(entity->GetObjectID());
|
||||
bitStream.Write(GAME_MSG::GAME_MSG_VENDOR_STATUS_UPDATE);
|
||||
|
||||
bitStream.Write(false);
|
||||
bitStream.Write(bUpdateOnly);
|
||||
bitStream.Write(static_cast<uint32_t>(vendorItems.size()));
|
||||
|
||||
for (std::pair<LOT, int> item : vendorItems) {
|
||||
@@ -1273,6 +1272,7 @@ void GameMessages::SendVendorStatusUpdate(Entity* entity, const SystemAddress& s
|
||||
bitStream.Write(static_cast<int>(item.second));
|
||||
}
|
||||
|
||||
if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST
|
||||
SEND_PACKET
|
||||
}
|
||||
|
||||
|
@@ -109,7 +109,7 @@ namespace GameMessages {
|
||||
void SendModularBuildEnd(Entity* entity);
|
||||
|
||||
void SendVendorOpenWindow(Entity* entity, const SystemAddress& sysAddr);
|
||||
void SendVendorStatusUpdate(Entity* entity, const SystemAddress& sysAddr);
|
||||
void SendVendorStatusUpdate(Entity* entity, const SystemAddress& sysAddr, bool bUpdateOnly = false);
|
||||
void SendVendorTransactionResult(Entity* entity, const SystemAddress& sysAddr);
|
||||
|
||||
void SendRemoveItemFromInventory(Entity* entity, const SystemAddress& sysAddr, LWOOBJID iObjID, LOT templateID, int inventoryType, uint32_t stackCount, uint32_t stackRemaining);
|
||||
|
Reference in New Issue
Block a user