mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 02:31:03 +00:00
[Feature] Add Parcel Feature for RoF2 Clients (#4198)
* Add Parcel Feature Add the parcel system for RoF2 client * Fixed a duplicate define * Reformat reformating and review changes * Further Formatting * Memory Mgmt Updates Refactored to using unique_ptr/make_unique/etc to avoid manual memory mgmt. Other format changes * Refactor db structure Refactor for db structure of parcels to character_parcels Removal of parcel_merchants Addition of npc_types.is_parcel_merchant Cleanup as a result * Refactor to use item id 99990 for money transfers. Removed the money string function as a result, though simplified the messaging related to money. Other updates based on feedback. * Move prune routine out of scheduler and into a world process. Removed RuleI from #define * Update * Update database.cpp * Update database_update_manifest.cpp * Update main.cpp * Update client_process.cpp * Update parcels.cpp * Remove parcel merchant content to optional sql instead of manifest. --------- Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
@@ -3859,6 +3859,51 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ServerOP_ParcelDelivery: {
|
||||
auto in = (Parcel_Struct *) pack->pBuffer;
|
||||
|
||||
if (strlen(in->send_to) == 0) {
|
||||
LogError(
|
||||
"ServerOP_ParcelDelivery pack received with incorrect character_name of {}.",
|
||||
in->send_to
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto const &c: entity_list.GetClientList()) {
|
||||
if (strcasecmp(c.second->GetCleanName(), in->send_to) == 0) {
|
||||
c.second->MessageString(
|
||||
Chat::Yellow,
|
||||
PARCEL_DELIVERY_ARRIVED
|
||||
);
|
||||
c.second->SendParcelStatus();
|
||||
if (c.second->GetEngagedWithParcelMerchant()) {
|
||||
c.second->SendParcel(*in);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ServerOP_ParcelPrune: {
|
||||
for (auto const &c: entity_list.GetClientList()) {
|
||||
if (c.second->GetEngagedWithParcelMerchant()) {
|
||||
c.second->Message(
|
||||
Chat::Red,
|
||||
"Parcel data has been updated. Please re-open the Merchant Window."
|
||||
);
|
||||
c.second->SetEngagedWithParcelMerchant(false);
|
||||
c.second->DoParcelCancel();
|
||||
|
||||
auto out = new EQApplicationPacket(OP_ShopEndConfirm);
|
||||
c.second->QueuePacket(out);
|
||||
safe_delete(out);
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
LogInfo("Unknown ZS Opcode [{}] size [{}]", (int)pack->opcode, pack->size);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user