Fixed a couple of merc memory leaks and removed some commented out DumpPacket calls.

This commit is contained in:
Derision
2013-03-17 13:52:43 +00:00
parent 8eef122cec
commit 981cabe857
7 changed files with 11 additions and 56 deletions
+2 -44
View File
@@ -3540,13 +3540,11 @@ void Client::Handle_OP_WearChange(const EQApplicationPacket *app)
{
if (app->size != sizeof(WearChange_Struct)) {
cout << "Wrong size: OP_WearChange, size=" << app->size << ", expected " << sizeof(WearChange_Struct) << endl;
//DumpPacket(app);
DumpPacket(app);
return;
}
WearChange_Struct* wc=(WearChange_Struct*)app->pBuffer;
//printf("Wearchange:\n");
//DumpPacket(app);
if(wc->spawn_id != GetID())
return;
@@ -3597,7 +3595,7 @@ void Client::Handle_OP_WhoAllRequest(const EQApplicationPacket *app)
{
if (app->size != sizeof(Who_All_Struct)) {
cout << "Wrong size on OP_WhoAll. Got: " << app->size << ", Expected: " << sizeof(Who_All_Struct) << endl;
//DumpPacket(app);
DumpPacket(app);
return;
}
Who_All_Struct* whoall = (Who_All_Struct*) app->pBuffer;
@@ -3696,7 +3694,6 @@ void Client::Handle_OP_EndLootRequest(const EQApplicationPacket *app)
Entity* entity = entity_list.GetID(*((uint16*)app->pBuffer));
if (entity == 0) {
//DumpPacket(app);
Message(13, "Error: OP_EndLootRequest: Corpse not found (ent = 0)");
if(GetClientVersion() >= EQClientSoD)
Corpse::SendEndLootErrorPacket(this);
@@ -7388,27 +7385,6 @@ void Client::Handle_OP_Emote(const EQApplicationPacket *app)
memcpy(out->message, name, len_name);
memcpy(&out->message[len_name], in->message, len_msg);
//cout << "######### Outgoing emote packet" << endl;
//DumpPacket(outapp);
/*
if (target && target->IsClient()) {
entity_list.QueueCloseClients(this, outapp, false, 100, target);
cptr = outapp->pBuffer + 2;
// not sure if live does this or not. thought it was a nice feature, but would take a lot to
// clean up grammatical and other errors. Maybe with a regex parser...
replacestr((char *)cptr, target->GetName(), "you");
replacestr((char *)cptr, " he", " you");
replacestr((char *)cptr, " she", " you");
replacestr((char *)cptr, " him", " you");
replacestr((char *)cptr, " her", " you");
target->CastToClient()->QueuePacket(outapp);
}
else
*/
entity_list.QueueCloseClients(this, outapp, true, 100,0,true,FilterSocials);
safe_delete(outapp);
@@ -7429,7 +7405,6 @@ void Client::Handle_OP_Animation(const EQApplicationPacket *app)
//might verify spawn ID, but it wouldent affect anything
// an emote (i.e., waving arm to say hello)
DoAnim(s->action, s->value);
return;
@@ -7853,7 +7828,6 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app)
if(Buyer) {
Trader_EndTrader();
Message(13, "You cannot be a Trader and Buyer at the same time.");
DumpPacket(app);
return;
}
@@ -7892,7 +7866,6 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app)
if(!TradeItemsValid) {
Trader_EndTrader();
DumpPacket(app);
return;
}
@@ -7948,7 +7921,6 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app)
return;
}
DumpPacket(app);
return;
}
@@ -8127,8 +8099,6 @@ void Client::Handle_OP_ClientError(const EQApplicationPacket *app)
ClientError_Struct* error = (ClientError_Struct*)app->pBuffer;
LogFile->write(EQEMuLog::Error, "Client error: %s", error->character_name);
LogFile->write(EQEMuLog::Error, "Error message:%s", error->message);
//if (EQDEBUG>=5)
// DumpPacket(app);
return;
}
@@ -13611,8 +13581,6 @@ void Client::Handle_OP_MercenaryHire(const EQApplicationPacket *app)
uint32 merc_unk1 = mmrq->MercUnk01;
uint32 merc_unk2 = mmrq->MercUnk02;
//DumpPacket(app);
if(MERC_DEBUG > 0)
Message(7, "Mercenary Debug: Template ID (%i), Merchant ID (%i), Unknown1 (%i), Unknown2 (%i)", merc_template_id, merchant_id, merc_unk1, merc_unk2);
@@ -13674,8 +13642,6 @@ void Client::Handle_OP_MercenarySuspendRequest(const EQApplicationPacket *app)
SuspendMercenary_Struct* sm = (SuspendMercenary_Struct*) app->pBuffer;
uint32 merc_suspend = sm->SuspendMerc; // Seen 30 for suspending or unsuspending
//DumpPacket(app);
if(MERC_DEBUG > 0)
Message(7, "Mercenary Debug: Suspend ( %i ) received.", merc_suspend);
@@ -13700,8 +13666,6 @@ void Client::Handle_OP_MercenaryCommand(const EQApplicationPacket *app)
uint32 merc_command = mc->MercCommand; // Seen 0 (zone in with no merc or suspended), 1 (dismiss merc), 5 (normal state), 20 (unknown), 36 (zone in with merc)
int32 option = mc->Option; // Seen -1 (zone in with no merc), 0 (setting to passive stance), 1 (normal or setting to balanced stance)
//DumpPacket(app);
if(MERC_DEBUG > 0)
Message(7, "Mercenary Debug: Command %i, Option %i received.", merc_command, option);
@@ -13754,8 +13718,6 @@ void Client::Handle_OP_MercenaryDataUpdateRequest(const EQApplicationPacket *app
return;
}
//DumpPacket(app);
if(MERC_DEBUG > 0)
Message(7, "Mercenary Debug: Data Update Request Received.");
@@ -13776,8 +13738,6 @@ void Client::Handle_OP_MercenaryDismiss(const EQApplicationPacket *app)
return;
}
//DumpPacket(app);
uint8 Command = 0;
if(app->size > 0)
{
@@ -13811,8 +13771,6 @@ void Client::Handle_OP_MercenaryTimerRequest(const EQApplicationPacket *app)
return;
}
//DumpPacket(app);
if(MERC_DEBUG > 0)
Message(7, "Mercenary Debug: Timer Request received.");