I think this should be the basic handling for those 2 new opcodes:
client_packet.h
Code:
void Handle_OP_MercenaryDismiss(const EQApplicationPacket *app);
void Handle_OP_MercenaryTimerRequest(const EQApplicationPacket *app);
client_packet.cpp
Code:
ConnectedOpcodes[OP_MercenaryDismiss] = &Client::Handle_OP_MercenaryDismiss;
ConnectedOpcodes[OP_MercenaryTimerRequest] = &Client::Handle_OP_MercenaryTimerRequest;
Code:
void Client::Handle_OP_MercenaryDismiss(const EQApplicationPacket *app)
{
// The payload is 0 bytes.
if(app->size != 0)
{
Message(13, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size);
LogFile->write(EQEMuLog::Debug, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size);
DumpPacket(app);
return;
}
DumpPacket(app);
Message(7, "Mercenary Debug: Dismiss Request Recieved.");
// Handle the dismiss here...
// Unsure if there is a server response to this packet
}
void Client::Handle_OP_MercenaryTimerRequest(const EQApplicationPacket *app)
{
// The payload is 0 bytes.
if(app->size != 0)
{
Message(13, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size);
LogFile->write(EQEMuLog::Debug, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size);
DumpPacket(app);
return;
}
DumpPacket(app);
Message(7, "Mercenary Debug: Timer Request received.");
// To Do: Load Mercenary Timer Data to properly populate this reply packet
// All hard set values for now
// Send Mercenary Status/Timer packet
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenaryTimer, sizeof(MercenaryStatus_Struct));
MercenaryStatus_Struct* mss = (MercenaryStatus_Struct*)outapp->pBuffer;
mss->MercEntityID = 1; // Seen 0 (no merc spawned) or 615843841 and 22779137
mss->UpdateInterval = 900000; // Seen 900000 - Matches from 0x6537 packet (15 minutes in ms?)
mss->MercUnk01 = 180000; // Seen 180000 - 3 minutes in milleseconds? Maybe next update interval?
mss->MercState = 5; // Seen 5 (normal) or 1 (suspended)
mss->SuspendedTime = 0; // Seen 0 (not suspended) or c9 c2 64 4f (suspended on Sat Mar 17 11:58:49 2012) - Unix Timestamp
DumpPacket(outapp);
FastQueuePacket(&outapp);
}