mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-13 23:28:21 +00:00
Merge branch 'master' of https://github.com/af4t/Server into infuriate
This commit is contained in:
@@ -1578,9 +1578,9 @@ uint32 ZoneDatabase::UpdatePlayerCorpse(uint32 dbid, uint32 charid, const char*
|
||||
}
|
||||
if(rezzed){
|
||||
if (!RunQuery(query, MakeAnyLenString(&query, "update player_corpses set rezzed = 1 WHERE id=%d",dbid), errbuf)) {
|
||||
safe_delete_array(query);
|
||||
cerr << "Error in UpdatePlayerCorpse/Rezzed query: " << errbuf << endl;
|
||||
}
|
||||
safe_delete_array(query);
|
||||
}
|
||||
return dbid;
|
||||
}
|
||||
|
||||
+77
-49
@@ -1476,7 +1476,6 @@ void Client::SendSound(){//Makes a sound.
|
||||
memset(&x[64],0xffffffff,sizeof(uint32));
|
||||
memcpy(outapp->pBuffer,x,outapp->size);
|
||||
QueuePacket(outapp);
|
||||
DumpPacket(outapp);
|
||||
safe_delete(outapp);
|
||||
|
||||
}
|
||||
@@ -7141,73 +7140,91 @@ void Client::SendMercPersonalInfo()
|
||||
|
||||
if (GetClientVersion() >= EQClientRoF)
|
||||
{
|
||||
MercenaryDataUpdate_Struct* mdus = new MercenaryDataUpdate_Struct;
|
||||
|
||||
MercTemplate *mercData = &zone->merc_templates[GetMercInfo().MercTemplateID];
|
||||
|
||||
if (mercData)
|
||||
{
|
||||
int i = 0;
|
||||
int stancecount = 0;
|
||||
stancecount += zone->merc_stance_list[GetMercInfo().MercTemplateID].size();
|
||||
|
||||
if(stancecount > MAX_MERC_STANCES || mercCount > MAX_MERC || mercTypeCount > MAX_MERC_GRADES)
|
||||
{
|
||||
SendMercMerchantResponsePacket(0);
|
||||
return;
|
||||
}
|
||||
if (mercCount > 0 && mercCount)
|
||||
{
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenaryDataUpdate, sizeof(MercenaryDataUpdate_Struct));
|
||||
MercenaryDataUpdate_Struct* mdus = (MercenaryDataUpdate_Struct*)outapp->pBuffer;
|
||||
mdus->MercStatus = 0;
|
||||
mdus->MercCount = mercCount;
|
||||
if (mercCount > 0)
|
||||
mdus->MercData[i].MercID = mercData->MercTemplateID;
|
||||
mdus->MercData[i].MercType = mercData->MercType;
|
||||
mdus->MercData[i].MercSubType = mercData->MercSubType;
|
||||
mdus->MercData[i].PurchaseCost = Merc::CalcPurchaseCost(mercData->MercTemplateID, GetLevel(), 0);
|
||||
mdus->MercData[i].UpkeepCost = Merc::CalcUpkeepCost(mercData->MercTemplateID, GetLevel(), 0);
|
||||
mdus->MercData[i].Status = 0;
|
||||
mdus->MercData[i].AltCurrencyCost = Merc::CalcPurchaseCost(mercData->MercTemplateID, GetLevel(), altCurrentType);
|
||||
mdus->MercData[i].AltCurrencyUpkeep = Merc::CalcPurchaseCost(mercData->MercTemplateID, GetLevel(), altCurrentType);
|
||||
mdus->MercData[i].AltCurrencyType = altCurrentType;
|
||||
mdus->MercData[i].MercUnk01 = 0;
|
||||
mdus->MercData[i].TimeLeft = GetMercInfo().MercTimerRemaining; //GetMercTimer().GetRemainingTime();
|
||||
mdus->MercData[i].MerchantSlot = i + 1;
|
||||
mdus->MercData[i].MercUnk02 = 1;
|
||||
mdus->MercData[i].StanceCount = zone->merc_stance_list[mercData->MercTemplateID].size();
|
||||
mdus->MercData[i].MercUnk03 = 0;
|
||||
mdus->MercData[i].MercUnk04 = 1;
|
||||
strn0cpy(mdus->MercData[i].MercName, GetMercInfo().merc_name , sizeof(mdus->MercData[i].MercName));
|
||||
uint32 stanceindex = 0;
|
||||
if (mdus->MercData[i].StanceCount != 0)
|
||||
{
|
||||
mdus->MercData = new MercenaryData_Struct[mercCount];
|
||||
mdus->MercData[i].MercID = mercData->MercTemplateID;
|
||||
mdus->MercData[i].MercType = mercData->MercType;
|
||||
mdus->MercData[i].MercSubType = mercData->MercSubType;
|
||||
mdus->MercData[i].PurchaseCost = Merc::CalcPurchaseCost(mercData->MercTemplateID, GetLevel(), 0);
|
||||
mdus->MercData[i].UpkeepCost = Merc::CalcUpkeepCost(mercData->MercTemplateID, GetLevel(), 0);
|
||||
mdus->MercData[i].Status = 0;
|
||||
mdus->MercData[i].AltCurrencyCost = Merc::CalcPurchaseCost(mercData->MercTemplateID, GetLevel(), altCurrentType);
|
||||
mdus->MercData[i].AltCurrencyUpkeep = Merc::CalcPurchaseCost(mercData->MercTemplateID, GetLevel(), altCurrentType);
|
||||
mdus->MercData[i].AltCurrencyType = altCurrentType;
|
||||
mdus->MercData[i].MercUnk01 = 0;
|
||||
mdus->MercData[i].TimeLeft = GetMercInfo().MercTimerRemaining; //GetMercTimer().GetRemainingTime();
|
||||
mdus->MercData[i].MerchantSlot = i + 1;
|
||||
mdus->MercData[i].MercUnk02 = 1;
|
||||
mdus->MercData[i].StanceCount = zone->merc_stance_list[mercData->MercTemplateID].size();
|
||||
mdus->MercData[i].MercUnk03 = 0;
|
||||
mdus->MercData[i].MercUnk04 = 1;
|
||||
strn0cpy(mdus->MercData[i].MercName, GetMercInfo().merc_name , sizeof(mdus->MercData[i].MercName));
|
||||
uint32 stanceindex = 0;
|
||||
if (mdus->MercData[i].StanceCount != 0)
|
||||
list<MercStanceInfo>::iterator iter = zone->merc_stance_list[mercData->MercTemplateID].begin();
|
||||
while(iter != zone->merc_stance_list[mercData->MercTemplateID].end())
|
||||
{
|
||||
mdus->MercData[i].Stances = new MercenaryStance_Struct[mdus->MercData[i].StanceCount];
|
||||
list<MercStanceInfo>::iterator iter = zone->merc_stance_list[mercData->MercTemplateID].begin();
|
||||
while(iter != zone->merc_stance_list[mercData->MercTemplateID].end())
|
||||
{
|
||||
mdus->MercData[i].Stances[stanceindex].StanceIndex = stanceindex;
|
||||
mdus->MercData[i].Stances[stanceindex].Stance = (iter->StanceID);
|
||||
stanceindex++;
|
||||
iter++;
|
||||
}
|
||||
mdus->MercData[i].Stances[stanceindex].StanceIndex = stanceindex;
|
||||
mdus->MercData[i].Stances[stanceindex].Stance = (iter->StanceID);
|
||||
stanceindex++;
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
|
||||
mdus->MercData[i].MercUnk05 = 1;
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenaryDataUpdate, 1); //Packet sizes are handled by the encoder.
|
||||
outapp->pBuffer = (unsigned char*)mdus;
|
||||
//DumpPacket(outapp);
|
||||
FastQueuePacket(&outapp);
|
||||
mdus->MercData[i].MercUnk05 = 1;
|
||||
FastQueuePacket(&outapp);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MercenaryMerchantList_Struct* mml = new MercenaryMerchantList_Struct;
|
||||
int stancecount = 0;
|
||||
stancecount += zone->merc_stance_list[GetMercInfo().MercTemplateID].size();
|
||||
|
||||
if(mercCount > MAX_MERC || mercTypeCount > MAX_MERC_GRADES)
|
||||
{
|
||||
if (GetClientVersion() == EQClientSoD)
|
||||
{
|
||||
SendMercMerchantResponsePacket(0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenaryDataResponse, sizeof(MercenaryMerchantList_Struct));
|
||||
MercenaryMerchantList_Struct* mml = (MercenaryMerchantList_Struct*)outapp->pBuffer;
|
||||
MercTemplate *mercData = &zone->merc_templates[GetMercInfo().MercTemplateID];
|
||||
|
||||
|
||||
if(mercData)
|
||||
{
|
||||
if(mercTypeCount > 0)
|
||||
{
|
||||
mml->MercTypeCount = mercTypeCount; //We only should have one merc entry.
|
||||
mml->MercGrades = new MercenaryGrade_Struct[mercTypeCount]; // DBStringID for Type
|
||||
mml->MercGrades[i] = 1;
|
||||
}
|
||||
mml->MercCount = mercCount;
|
||||
if(mercCount > 0)
|
||||
{
|
||||
mml->Mercs = new MercenaryListEntry_Struct[mercCount];
|
||||
|
||||
mml->Mercs[i].MercID = mercData->MercTemplateID;
|
||||
mml->Mercs[i].MercType = mercData->MercType;
|
||||
mml->Mercs[i].MercSubType = mercData->MercSubType;
|
||||
@@ -7228,7 +7245,6 @@ void Client::SendMercPersonalInfo()
|
||||
int stanceindex = 0;
|
||||
if(mml->Mercs[i].StanceCount != 0)
|
||||
{
|
||||
mml->Mercs[i].Stances = new MercenaryStance_Struct[mml->Mercs[i].StanceCount];
|
||||
list<MercStanceInfo>::iterator iter = zone->merc_stance_list[mercData->MercTemplateID].begin();
|
||||
while(iter != zone->merc_stance_list[mercData->MercTemplateID].end())
|
||||
{
|
||||
@@ -7238,17 +7254,31 @@ void Client::SendMercPersonalInfo()
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenaryDataResponse, 1); //Packet sizes are handled by the encoder.
|
||||
outapp->pBuffer = (unsigned char*)mml;
|
||||
// DumpPacket(outapp);
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
else
|
||||
{
|
||||
safe_delete(outapp);
|
||||
if (GetClientVersion() == EQClientSoD)
|
||||
{
|
||||
SendMercMerchantResponsePacket(0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (GetClientVersion() == EQClientSoD)
|
||||
{
|
||||
SendMercMerchantResponsePacket(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
safe_delete(outapp);
|
||||
if (GetClientVersion() == EQClientSoD)
|
||||
{
|
||||
SendMercMerchantResponsePacket(0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7259,8 +7289,6 @@ void Client::SendClearMercInfo()
|
||||
nmhs->MercStatus = -1;
|
||||
nmhs->MercCount = 0;
|
||||
nmhs->MercID = 1;
|
||||
|
||||
DumpPacket(outapp);
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
|
||||
+42
-78
@@ -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);
|
||||
@@ -4768,10 +4765,8 @@ void Client::Handle_OP_InstillDoubt(const EQApplicationPacket *app)
|
||||
|
||||
void Client::Handle_OP_RezzAnswer(const EQApplicationPacket *app)
|
||||
{
|
||||
if (app->size != sizeof(Resurrect_Struct)) {
|
||||
LogFile->write(EQEMuLog::Error, "Wrong size: OP_RezzAnswer, size=%i, expected %i", app->size, sizeof(Resurrect_Struct));
|
||||
return;
|
||||
}
|
||||
VERIFY_PACKET_LENGTH(OP_RezzAnswer, app, Resurrect_Struct);
|
||||
|
||||
const Resurrect_Struct* ra = (const Resurrect_Struct*) app->pBuffer;
|
||||
|
||||
_log(SPELLS__REZ, "Received OP_RezzAnswer from client. Pendingrezzexp is %i, action is %s",
|
||||
@@ -4788,6 +4783,7 @@ void Client::Handle_OP_RezzAnswer(const EQApplicationPacket *app)
|
||||
// the rezzed corpse is in to mark the corpse as rezzed.
|
||||
outapp->SetOpcode(OP_RezzComplete);
|
||||
worldserver.RezzPlayer(outapp, 0, 0, OP_RezzComplete);
|
||||
safe_delete(outapp);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -7389,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);
|
||||
@@ -7430,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;
|
||||
@@ -7854,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;
|
||||
}
|
||||
|
||||
@@ -7893,7 +7866,6 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app)
|
||||
|
||||
if(!TradeItemsValid) {
|
||||
Trader_EndTrader();
|
||||
DumpPacket(app);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7949,7 +7921,6 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app)
|
||||
return;
|
||||
}
|
||||
|
||||
DumpPacket(app);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -8128,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;
|
||||
}
|
||||
|
||||
@@ -13496,8 +13465,6 @@ void Client::Handle_OP_MercenaryDataRequest(const EQApplicationPacket *app)
|
||||
//send info about your current merc(s)
|
||||
}
|
||||
|
||||
DumpPacket(app);
|
||||
|
||||
if(!RuleB(Mercs, AllowMercs)) {
|
||||
return;
|
||||
}
|
||||
@@ -13515,24 +13482,35 @@ void Client::Handle_OP_MercenaryDataRequest(const EQApplicationPacket *app)
|
||||
return;
|
||||
}
|
||||
|
||||
MercenaryMerchantList_Struct* mml = new MercenaryMerchantList_Struct;
|
||||
|
||||
mercTypeCount = tar->GetNumMercTypes(GetClientVersion());
|
||||
mercCount = tar->GetNumMercs(GetClientVersion());
|
||||
|
||||
if(mercCount > MAX_MERC)
|
||||
return;
|
||||
|
||||
std::list<MercType> mercTypeList = tar->GetMercTypesList(GetClientVersion());
|
||||
std::list<MercData> mercDataList = tar->GetMercsList(GetClientVersion());
|
||||
|
||||
mml->MercTypeCount = mercTypeCount;
|
||||
int i = 0;
|
||||
int StanceCount = 0;
|
||||
|
||||
for(std::list<MercData>::iterator mercListItr = mercDataList.begin(); mercListItr != mercDataList.end(); mercListItr++)
|
||||
{
|
||||
list<MercStanceInfo>::iterator siter = zone->merc_stance_list[mercListItr->MercTemplateID].begin();
|
||||
for(siter = zone->merc_stance_list[mercListItr->MercTemplateID].begin(); siter != zone->merc_stance_list[mercListItr->MercTemplateID].end(); siter++)
|
||||
{
|
||||
StanceCount++;
|
||||
}
|
||||
}
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenaryDataResponse, sizeof(MercenaryMerchantList_Struct));
|
||||
MercenaryMerchantList_Struct* mml = (MercenaryMerchantList_Struct*)outapp->pBuffer;
|
||||
|
||||
mml->MercTypeCount = mercTypeCount;
|
||||
if(mercTypeCount > 0)
|
||||
{
|
||||
mml->MercGrades = new MercenaryGrade_Struct[mercTypeCount];
|
||||
for(std::list<MercType>::iterator mercTypeListItr = mercTypeList.begin(); mercTypeListItr != mercTypeList.end(); mercTypeListItr++) {
|
||||
mml->MercGrades[i].GradeCountEntry = mercTypeListItr->Type; // DBStringID for Type
|
||||
mml->MercGrades[i] = mercTypeListItr->Type; // DBStringID for Type
|
||||
i++;
|
||||
}
|
||||
}
|
||||
@@ -13540,50 +13518,48 @@ void Client::Handle_OP_MercenaryDataRequest(const EQApplicationPacket *app)
|
||||
|
||||
if(mercCount > 0)
|
||||
{
|
||||
mml->Mercs = new MercenaryListEntry_Struct[mercCount];
|
||||
i = 0;
|
||||
for(std::list<MercData>::iterator mercListItr = mercDataList.begin(); mercListItr != mercDataList.end(); mercListItr++)
|
||||
for(std::list<MercData>::iterator mercListIter = mercDataList.begin(); mercListIter != mercDataList.end(); mercListIter++)
|
||||
{
|
||||
mml->Mercs[i].MercID = mercListItr->MercTemplateID;
|
||||
mml->Mercs[i].MercType = mercListItr->MercType;
|
||||
mml->Mercs[i].MercSubType = mercListItr->MercSubType;
|
||||
mml->Mercs[i].PurchaseCost = RuleB(Mercs, ChargeMercPurchaseCost) ? Merc::CalcPurchaseCost(mercListItr->MercTemplateID, GetLevel(), 0): 0;
|
||||
mml->Mercs[i].UpkeepCost = RuleB(Mercs, ChargeMercUpkeepCost) ? Merc::CalcUpkeepCost(mercListItr->MercTemplateID, GetLevel(), 0): 0;
|
||||
mml->Mercs[i].MercID = mercListIter->MercTemplateID;
|
||||
mml->Mercs[i].MercType = mercListIter->MercType;
|
||||
mml->Mercs[i].MercSubType = mercListIter->MercSubType;
|
||||
mml->Mercs[i].PurchaseCost = RuleB(Mercs, ChargeMercPurchaseCost) ? Merc::CalcPurchaseCost(mercListIter->MercTemplateID, GetLevel(), 0): 0;
|
||||
mml->Mercs[i].UpkeepCost = RuleB(Mercs, ChargeMercUpkeepCost) ? Merc::CalcUpkeepCost(mercListIter->MercTemplateID, GetLevel(), 0): 0;
|
||||
mml->Mercs[i].Status = 0;
|
||||
mml->Mercs[i].AltCurrencyCost = RuleB(Mercs, ChargeMercPurchaseCost) ? Merc::CalcPurchaseCost(mercListItr->MercTemplateID, GetLevel(), altCurrentType): 0;
|
||||
mml->Mercs[i].AltCurrencyUpkeep = RuleB(Mercs, ChargeMercUpkeepCost) ? Merc::CalcUpkeepCost(mercListItr->MercTemplateID, GetLevel(), altCurrentType): 0;
|
||||
mml->Mercs[i].AltCurrencyCost = RuleB(Mercs, ChargeMercPurchaseCost) ? Merc::CalcPurchaseCost(mercListIter->MercTemplateID, GetLevel(), altCurrentType): 0;
|
||||
mml->Mercs[i].AltCurrencyUpkeep = RuleB(Mercs, ChargeMercUpkeepCost) ? Merc::CalcUpkeepCost(mercListIter->MercTemplateID, GetLevel(), altCurrentType): 0;
|
||||
mml->Mercs[i].AltCurrencyType = altCurrentType;
|
||||
mml->Mercs[i].MercUnk01 = 0;
|
||||
mml->Mercs[i].TimeLeft = -1;
|
||||
mml->Mercs[i].MerchantSlot = i + 1;
|
||||
mml->Mercs[i].MercUnk02 = 1;
|
||||
mml->Mercs[i].StanceCount = zone->merc_stance_list[mercListItr->MercTemplateID].size();
|
||||
int mercStanceCount = 0;
|
||||
list<MercStanceInfo>::iterator iter = zone->merc_stance_list[mercListIter->MercTemplateID].begin();
|
||||
for(iter = zone->merc_stance_list[mercListIter->MercTemplateID].begin(); iter != zone->merc_stance_list[mercListIter->MercTemplateID].end(); iter++)
|
||||
{
|
||||
mercStanceCount++;
|
||||
}
|
||||
mml->Mercs[i].StanceCount = mercStanceCount;
|
||||
mml->Mercs[i].MercUnk03 = 519044964;
|
||||
mml->Mercs[i].MercUnk04 = 1;
|
||||
//mml->Mercs[i].MercName;
|
||||
int stanceindex = 0;
|
||||
if(mml->Mercs[i].StanceCount != 0)
|
||||
if(mercStanceCount > 0)
|
||||
{
|
||||
mml->Mercs[i].Stances = new MercenaryStance_Struct[mml->Mercs[i].StanceCount];
|
||||
list<MercStanceInfo>::iterator iter = zone->merc_stance_list[mercListItr->MercTemplateID].begin();
|
||||
while(iter != zone->merc_stance_list[mercListItr->MercTemplateID].end())
|
||||
list<MercStanceInfo>::iterator iter2 = zone->merc_stance_list[mercListIter->MercTemplateID].begin();
|
||||
while(iter2 != zone->merc_stance_list[mercListIter->MercTemplateID].end())
|
||||
{
|
||||
mml->Mercs[i].Stances[stanceindex].StanceIndex = stanceindex;
|
||||
mml->Mercs[i].Stances[stanceindex].Stance = (iter->StanceID);
|
||||
mml->Mercs[i].Stances[stanceindex].Stance = (iter2->StanceID);
|
||||
stanceindex++;
|
||||
iter++;
|
||||
iter2++;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenaryDataResponse, 1); //Packet sizes are handled by the encoder.
|
||||
outapp->pBuffer = (unsigned char*)mml;
|
||||
// DumpPacket(outapp);
|
||||
FastQueuePacket(&outapp);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13605,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);
|
||||
|
||||
@@ -13668,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);
|
||||
|
||||
@@ -13694,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);
|
||||
|
||||
@@ -13748,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.");
|
||||
|
||||
@@ -13770,8 +13738,6 @@ void Client::Handle_OP_MercenaryDismiss(const EQApplicationPacket *app)
|
||||
return;
|
||||
}
|
||||
|
||||
DumpPacket(app);
|
||||
|
||||
uint8 Command = 0;
|
||||
if(app->size > 0)
|
||||
{
|
||||
@@ -13790,7 +13756,7 @@ void Client::Handle_OP_MercenaryDismiss(const EQApplicationPacket *app)
|
||||
merc->Dismiss();
|
||||
}
|
||||
|
||||
// Unsure if there is a server response to this packet
|
||||
SendMercMerchantResponsePacket(10);
|
||||
|
||||
}
|
||||
|
||||
@@ -13805,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.");
|
||||
|
||||
|
||||
@@ -930,7 +930,6 @@ void Client::BulkSendInventoryItems() {
|
||||
ptr += length;
|
||||
}
|
||||
}
|
||||
//DumpPacket(outapp);
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
}
|
||||
@@ -1309,8 +1308,6 @@ void Client::OPMoveCoin(const EQApplicationPacket* app)
|
||||
int32 *from_bucket = 0, *to_bucket = 0;
|
||||
Mob* trader = trade->With();
|
||||
|
||||
//DumpPacket(app);
|
||||
|
||||
// could just do a range, but this is clearer and explicit
|
||||
if
|
||||
(
|
||||
|
||||
+1
-1
@@ -148,7 +148,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
|
||||
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveDoor, sizeof(MoveDoor_Struct));
|
||||
MoveDoor_Struct* md = (MoveDoor_Struct*)outapp->pBuffer;
|
||||
//DumpPacket(app);
|
||||
|
||||
md->doorid = door_id;
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//used_pawn: Locked doors! Rogue friendly too =)
|
||||
|
||||
@@ -1980,7 +1980,6 @@ void Client::SendItemPacket(int16 slot_id, const ItemInst* inst, ItemPacketType
|
||||
#if EQDEBUG >= 9
|
||||
DumpPacket(outapp);
|
||||
#endif
|
||||
//DumpPacket(outapp);
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
|
||||
+10
-11
@@ -5630,7 +5630,7 @@ bool Merc::Unsuspend(bool setMaxStats) {
|
||||
if(!mercOwner->IsGrouped())
|
||||
{
|
||||
Group *g = new Group(mercOwner);
|
||||
if(AddMercToGroup(this, g))
|
||||
if(g && AddMercToGroup(this, g))
|
||||
{
|
||||
entity_list.AddGroup(g);
|
||||
database.SetGroupLeaderName(g->GetID(), mercOwner->GetName());
|
||||
@@ -5641,6 +5641,15 @@ bool Merc::Unsuspend(bool setMaxStats) {
|
||||
|
||||
loaded = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(MERC_DEBUG > 0)
|
||||
mercOwner->Message(7, "Mercenary failed to join the group - Suspending");
|
||||
|
||||
Suspend();
|
||||
safe_delete(g);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (AddMercToGroup(this, mercOwner->GetGroup()))
|
||||
{
|
||||
@@ -5880,24 +5889,18 @@ void Client::SendMercMerchantResponsePacket(int32 response_type) {
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenaryHire, sizeof(MercenaryMerchantResponse_Struct));
|
||||
MercenaryMerchantResponse_Struct* mmr = (MercenaryMerchantResponse_Struct*)outapp->pBuffer;
|
||||
mmr->ResponseType = response_type; // send specified response type
|
||||
|
||||
DumpPacket(outapp);
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
void Client::SendMercenaryUnknownPacket(uint8 type) {
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenaryUnknown1, 1);
|
||||
outapp->WriteUInt8(type);
|
||||
|
||||
DumpPacket(outapp);
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
void Client::SendMercenaryUnsuspendPacket(uint8 type) {
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenaryUnsuspendResponse, 1);
|
||||
outapp->WriteUInt8(type);
|
||||
|
||||
DumpPacket(outapp);
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
@@ -5905,8 +5908,6 @@ void Client::SendMercSuspendResponsePacket(uint32 suspended_time) {
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenarySuspendResponse, sizeof(SuspendMercenaryResponse_Struct));
|
||||
SuspendMercenaryResponse_Struct* smr = (SuspendMercenaryResponse_Struct*)outapp->pBuffer;
|
||||
smr->SuspendTime = suspended_time; // Seen 0 (not suspended) or c9 c2 64 4f (suspended on Sat Mar 17 11:58:49 2012) - Unix Timestamp
|
||||
|
||||
DumpPacket(outapp);
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
@@ -5924,8 +5925,6 @@ void Client::SendMercTimerPacket(int32 entity_id, int32 merc_state, int32 suspen
|
||||
mss->MercUnk01 = unk01; // Seen 180000 - 3 minutes in ms - Used for the unsuspend button refresh timer
|
||||
mss->MercState = merc_state; // Seen 5 (normal) or 1 (suspended)
|
||||
mss->SuspendedTime = suspended_time; // Seen 0 for not suspended or Unix Timestamp for suspended merc
|
||||
|
||||
DumpPacket(outapp);
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -840,7 +840,6 @@ void ClientTaskState::EnableTask(int CharID, int TaskCount, int *TaskList) {
|
||||
_log(TASKS__UPDATE, "New enabled task list ");
|
||||
for(unsigned int i=0; i<EnabledTasks.size(); i++)
|
||||
_log(TASKS__UPDATE, "%i ", EnabledTasks[i]);
|
||||
fflush(stdout);
|
||||
|
||||
if(TasksEnabled.size() == 0 ) return;
|
||||
|
||||
@@ -901,7 +900,6 @@ void ClientTaskState::DisableTask(int CharID, int TaskCount, int *TaskList) {
|
||||
_log(TASKS__UPDATE, "New enabled task list ");
|
||||
for(unsigned int i=0; i<EnabledTasks.size(); i++)
|
||||
_log(TASKS__UPDATE, "%i ", EnabledTasks[i]);
|
||||
fflush(stdout);
|
||||
|
||||
if(TasksDisabled.size() == 0) return;
|
||||
|
||||
@@ -2561,7 +2559,7 @@ void Client::SendTaskFailed(int TaskID, int TaskIndex) {
|
||||
tac->unknown5 = 0; // 0 for task complete or failed.
|
||||
|
||||
_log(TASKS__UPDATE, "TaskFailed");
|
||||
//DumpPacket(outapp); fflush(stdout);
|
||||
|
||||
_pkt(TASKS__PACKETS, outapp);
|
||||
|
||||
QueuePacket(outapp);
|
||||
|
||||
@@ -517,7 +517,7 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac
|
||||
outp->reply_code = 0x00000000; //success for finding it...
|
||||
|
||||
user->QueuePacket(outapp);
|
||||
//DumpPacket(outapp);
|
||||
|
||||
safe_delete(outapp);
|
||||
|
||||
|
||||
@@ -665,7 +665,6 @@ void Client::TradeskillSearchResults(const char *query, unsigned long qlen,
|
||||
reply->trivial = trivial;
|
||||
strn0cpy(reply->recipe_name, name, sizeof(reply->recipe_name));
|
||||
|
||||
//DumpPacket(outapp);
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
mysql_free_result(result);
|
||||
@@ -1520,4 +1519,4 @@ bool Client::CanIncreaseTradeskill(SkillType tradeskill) {
|
||||
break; //Other skills unchecked and ability to increase assumed true
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,7 +392,6 @@ void WorldServer::Process() {
|
||||
_log(ZONE__WORLD, "Error: WhoAllReturnStruct did not point to a valid client! "
|
||||
"id=%i, playerineqstring=%i, playersinzonestring=%i. Dumping WhoAllReturnStruct:",
|
||||
wars->id, wars->playerineqstring, wars->playersinzonestring);
|
||||
//DumpPacket(pack);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -495,7 +494,7 @@ void WorldServer::Process() {
|
||||
if (!(Zone::Bootup(zst->zoneid, zst->instanceid, zst->makestatic))) {
|
||||
SendChannelMessage(0, 0, 10, 0, 0, "%s:%i Zone::Bootup failed: %s", net.GetZoneAddress(), net.GetZonePort(), database.GetZoneName(zst->zoneid));
|
||||
}
|
||||
// Moved annoucement to ZoneBootup() - Quagmire
|
||||
// Moved annoucement to ZoneBootup()
|
||||
// else
|
||||
// SendEmoteMessage(0, 0, 15, "Zone bootup: %s", zone->GetLongName());
|
||||
break;
|
||||
@@ -1822,7 +1821,6 @@ void WorldServer::Process() {
|
||||
default: {
|
||||
cout << " Unknown ZSopcode:" << (int)pack->opcode;
|
||||
cout << " size:" << pack->size << endl;
|
||||
//DumpPacket(pack->pBuffer, pack->size);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-2
@@ -1748,7 +1748,7 @@ bool ZoneDatabase::SaveMerc(Merc *merc) {
|
||||
}
|
||||
}
|
||||
|
||||
safe_delete(Query);
|
||||
safe_delete_array(Query);
|
||||
|
||||
if(!errorMessage.empty() || (Result && affectedRows != 1)) {
|
||||
if(owner && !errorMessage.empty())
|
||||
@@ -1917,12 +1917,16 @@ bool ZoneDatabase::DeleteMerc(uint32 merc_id) {
|
||||
else
|
||||
TempCounter++;
|
||||
|
||||
safe_delete_array(Query);
|
||||
|
||||
if(!database.RunQuery(Query, MakeAnyLenString(&Query, "DELETE FROM mercs WHERE MercID = '%u'", merc_id), TempErrorMessageBuffer)) {
|
||||
errorMessage = std::string(TempErrorMessageBuffer);
|
||||
}
|
||||
else
|
||||
TempCounter++;
|
||||
|
||||
safe_delete_array(Query);
|
||||
|
||||
if(TempCounter == 2)
|
||||
Result = true;
|
||||
}
|
||||
@@ -2202,7 +2206,7 @@ uint8 ZoneDatabase::GetZoneWeather(uint32 zoneid, uint32 version) {
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT weather FROM zone WHERE zoneidnumber=%i AND (version=%i OR version=0) ORDER BY version DESC", zoneid), errbuf, &result))
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT weather FROM zone WHERE zoneidnumber=%i AND (version=%i OR version=0) ORDER BY version DESC", zoneid, version), errbuf, &result))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
if (mysql_num_rows(result) > 0) {
|
||||
|
||||
Reference in New Issue
Block a user