mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Merge branch 'StringFormatting' into small_stage_cleanup
Conflicts: common/Item.cpp world/client.cpp zone/net.cpp
This commit is contained in:
+29
-31
@@ -17,9 +17,7 @@
|
||||
*/
|
||||
#include "../common/debug.h"
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
#include <iomanip>
|
||||
using namespace std;
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@@ -622,7 +620,7 @@ bool Client::Save(uint8 iCommitNow) {
|
||||
SaveBackup();
|
||||
}
|
||||
else {
|
||||
cerr << "Failed to update player profile" << endl;
|
||||
std::cerr << "Failed to update player profile" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2037,7 +2035,7 @@ void Client::ReadBook(BookRequest_Struct *book) {
|
||||
return;
|
||||
}
|
||||
|
||||
string booktxt2 = database.GetBook(txtfile);
|
||||
std::string booktxt2 = database.GetBook(txtfile);
|
||||
int length = booktxt2.length();
|
||||
|
||||
if (booktxt2[0] != '\0') {
|
||||
@@ -2069,7 +2067,7 @@ void Client::ReadBook(BookRequest_Struct *book) {
|
||||
}
|
||||
|
||||
void Client::QuestReadBook(const char* text, uint8 type) {
|
||||
string booktxt2 = text;
|
||||
std::string booktxt2 = text;
|
||||
int length = booktxt2.length();
|
||||
if (booktxt2[0] != '\0') {
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_ReadBook, length + sizeof(BookText_Struct));
|
||||
@@ -2570,7 +2568,7 @@ void Client::LogMerchant(Client* player, Mob* merchant, uint32 quantity, uint32
|
||||
if(!player || !merchant || !item)
|
||||
return;
|
||||
|
||||
string LogText = "Qty: ";
|
||||
std::string LogText = "Qty: ";
|
||||
|
||||
char Buffer[255];
|
||||
memset(Buffer, 0, sizeof(Buffer));
|
||||
@@ -3865,7 +3863,7 @@ void Client::KeyRingLoad()
|
||||
}
|
||||
mysql_free_result(result);
|
||||
}else {
|
||||
cerr << "Error in Client::KeyRingLoad query '" << query << "' " << errbuf << endl;
|
||||
std::cerr << "Error in Client::KeyRingLoad query '" << query << "' " << errbuf << std::endl;
|
||||
safe_delete_array(query);
|
||||
return;
|
||||
}
|
||||
@@ -3888,7 +3886,7 @@ void Client::KeyRingAdd(uint32 item_id)
|
||||
}
|
||||
else
|
||||
{
|
||||
cerr << "Error in Doors::HandleClick query '" << query << "' " << errbuf << endl;
|
||||
std::cerr << "Error in Doors::HandleClick query '" << query << "' " << errbuf << std::endl;
|
||||
safe_delete_array(query);
|
||||
return;
|
||||
}
|
||||
@@ -3941,7 +3939,7 @@ bool Client::IsDiscovered(uint32 itemid) {
|
||||
}
|
||||
else
|
||||
{
|
||||
cerr << "Error in IsDiscovered query '" << query << "' " << errbuf << endl;
|
||||
std::cerr << "Error in IsDiscovered query '" << query << "' " << errbuf << std::endl;
|
||||
}
|
||||
mysql_free_result(result);
|
||||
safe_delete_array(query);
|
||||
@@ -4730,10 +4728,10 @@ uint32 Client::GetStartZone()
|
||||
void Client::ShowSkillsWindow()
|
||||
{
|
||||
const char *WindowTitle = "Skills";
|
||||
string WindowText;
|
||||
std::string WindowText;
|
||||
// using a map for easy alphabetizing of the skills list
|
||||
map<string, SkillType> Skills;
|
||||
map<string, SkillType>::iterator it;
|
||||
std::map<std::string, SkillType> Skills;
|
||||
std::map<std::string, SkillType>::iterator it;
|
||||
|
||||
// this list of names must keep the same order as that in common/skills.h
|
||||
const char* SkillName[] = {"1H Blunt","1H Slashing","2H Blunt","2H Slashing","Abjuration","Alteration","Apply Poison","Archery",
|
||||
@@ -5135,7 +5133,7 @@ void Client::SendRewards()
|
||||
InternalVeteranReward *ivr = (InternalVeteranReward*)data;
|
||||
ivr->claim_id = rewards[i].id;
|
||||
ivr->number_available = rewards[i].amount;
|
||||
list<InternalVeteranReward>::iterator iter = zone->VeteranRewards.begin();
|
||||
std::list<InternalVeteranReward>::iterator iter = zone->VeteranRewards.begin();
|
||||
while(iter != zone->VeteranRewards.end())
|
||||
{
|
||||
if((*iter).claim_id == rewards[i].id)
|
||||
@@ -5225,7 +5223,7 @@ bool Client::TryReward(uint32 claim_id)
|
||||
return false;
|
||||
}
|
||||
|
||||
list<InternalVeteranReward>::iterator iter = zone->VeteranRewards.begin();
|
||||
std::list<InternalVeteranReward>::iterator iter = zone->VeteranRewards.begin();
|
||||
while(iter != zone->VeteranRewards.end())
|
||||
{
|
||||
if((*iter).claim_id == claim_id)
|
||||
@@ -6044,7 +6042,7 @@ void Client::NPCSpawn(NPC *target_npc, const char *identifier, uint32 extra)
|
||||
|
||||
bool Client::IsDraggingCorpse(const char *CorpseName)
|
||||
{
|
||||
for(std::list<string>::iterator Iterator = DraggedCorpses.begin(); Iterator != DraggedCorpses.end(); ++Iterator)
|
||||
for(std::list<std::string>::iterator Iterator = DraggedCorpses.begin(); Iterator != DraggedCorpses.end(); ++Iterator)
|
||||
{
|
||||
if(!strcasecmp((*Iterator).c_str(), CorpseName))
|
||||
return true;
|
||||
@@ -6055,7 +6053,7 @@ bool Client::IsDraggingCorpse(const char *CorpseName)
|
||||
|
||||
void Client::DragCorpses()
|
||||
{
|
||||
for(std::list<string>::iterator Iterator = DraggedCorpses.begin(); Iterator != DraggedCorpses.end(); ++Iterator)
|
||||
for(std::list<std::string>::iterator Iterator = DraggedCorpses.begin(); Iterator != DraggedCorpses.end(); ++Iterator)
|
||||
{
|
||||
Mob* corpse = entity_list.GetMob((*Iterator).c_str());
|
||||
|
||||
@@ -6710,7 +6708,7 @@ void Client::SendAltCurrencies() {
|
||||
altc->count = count;
|
||||
|
||||
uint32 i = 0;
|
||||
list<AltCurrencyDefinition_Struct>::iterator iter = zone->AlternateCurrencies.begin();
|
||||
std::list<AltCurrencyDefinition_Struct>::iterator iter = zone->AlternateCurrencies.begin();
|
||||
while(iter != zone->AlternateCurrencies.end()) {
|
||||
const Item_Struct* item = database.GetItem((*iter).item_id);
|
||||
altc->entries[i].currency_number = (*iter).id;
|
||||
@@ -6765,7 +6763,7 @@ void Client::AddAlternateCurrencyValue(uint32 currency_id, int32 amount)
|
||||
|
||||
void Client::SendAlternateCurrencyValues()
|
||||
{
|
||||
list<AltCurrencyDefinition_Struct>::iterator iter = zone->AlternateCurrencies.begin();
|
||||
std::list<AltCurrencyDefinition_Struct>::iterator iter = zone->AlternateCurrencies.begin();
|
||||
while(iter != zone->AlternateCurrencies.end()) {
|
||||
SendAlternateCurrencyValue((*iter).id, false);
|
||||
iter++;
|
||||
@@ -7132,23 +7130,23 @@ void Client::SendWebLink(const char *website)
|
||||
{
|
||||
if(website != 0)
|
||||
{
|
||||
string str = website;
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_Weblink, sizeof(Weblink_Struct) + str.length() + 1);
|
||||
Weblink_Struct *wl = (Weblink_Struct*)outapp->pBuffer;
|
||||
memcpy(wl->weblink, str.c_str(), str.length() + 1);
|
||||
wl->weblink[str.length() + 1] = '\0';
|
||||
std::string str = website;
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_Weblink, sizeof(Weblink_Struct) + str.length() + 1);
|
||||
Weblink_Struct *wl = (Weblink_Struct*)outapp->pBuffer;
|
||||
memcpy(wl->weblink, str.c_str(), str.length() + 1);
|
||||
wl->weblink[str.length() + 1] = '\0';
|
||||
|
||||
FastQueuePacket(&outapp);
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
}
|
||||
|
||||
void Client::SendMercPersonalInfo()
|
||||
{
|
||||
uint32 mercTypeCount = 1;
|
||||
uint32 mercCount = 1; //TODO: Un-hardcode this and support multiple mercs like in later clients than SoD.
|
||||
//uint32 packetSize = 0;
|
||||
uint32 i=0;
|
||||
uint32 altCurrentType = 19; //TODO: Implement alternate currency purchases involving mercs!
|
||||
uint32 mercTypeCount = 1;
|
||||
uint32 mercCount = 1; //TODO: Un-hardcode this and support multiple mercs like in later clients than SoD.
|
||||
//uint32 packetSize = 0;
|
||||
uint32 i=0;
|
||||
uint32 altCurrentType = 19; //TODO: Implement alternate currency purchases involving mercs!
|
||||
|
||||
if (GetClientVersion() >= EQClientRoF)
|
||||
{
|
||||
@@ -7191,7 +7189,7 @@ void Client::SendMercPersonalInfo()
|
||||
uint32 stanceindex = 0;
|
||||
if (mdus->MercData[i].StanceCount != 0)
|
||||
{
|
||||
list<MercStanceInfo>::iterator iter = zone->merc_stance_list[mercData->MercTemplateID].begin();
|
||||
std::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;
|
||||
@@ -7257,7 +7255,7 @@ void Client::SendMercPersonalInfo()
|
||||
int stanceindex = 0;
|
||||
if(mml->Mercs[i].StanceCount != 0)
|
||||
{
|
||||
list<MercStanceInfo>::iterator iter = zone->merc_stance_list[mercData->MercTemplateID].begin();
|
||||
std::list<MercStanceInfo>::iterator iter = zone->merc_stance_list[mercData->MercTemplateID].begin();
|
||||
while(iter != zone->merc_stance_list[mercData->MercTemplateID].end())
|
||||
{
|
||||
mml->Mercs[i].Stances[stanceindex].StanceIndex = stanceindex;
|
||||
|
||||
Reference in New Issue
Block a user