mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-16 13:58:22 +00:00
RunQuery now uses a string instead of a char* for the error buffer.
This commit is contained in:
+5
-5
@@ -374,14 +374,14 @@ void Adventure::MoveCorpsesToGraveyard()
|
||||
|
||||
std::list<uint32> dbid_list;
|
||||
std::list<uint32> charid_list;
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
std::string query;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
StringFormat(query,"SELECT id, charid FROM player_corpses WHERE instanceid=%d", GetInstanceID());
|
||||
|
||||
if(database.RunQuery(query,errbuf, &result))
|
||||
if(database.RunQuery(query, &errbuf, &result))
|
||||
{
|
||||
while((row = mysql_fetch_row(result)))
|
||||
{
|
||||
@@ -392,7 +392,7 @@ void Adventure::MoveCorpsesToGraveyard()
|
||||
}
|
||||
else
|
||||
{
|
||||
LogFile->write(EQEMuLog::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), errbuf);
|
||||
LogFile->write(EQEMuLog::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), errbuf.c_str());
|
||||
}
|
||||
|
||||
std::list<uint32>::iterator iter = dbid_list.begin();
|
||||
@@ -405,9 +405,9 @@ void Adventure::MoveCorpsesToGraveyard()
|
||||
StringFormat(query,"UPDATE player_corpses SET zoneid=%d, instanceid=0, x=%f, y=%f, z=%f WHERE instanceid=%d",
|
||||
GetTemplate()->graveyard_zone_id, x, y, z, GetInstanceID());
|
||||
|
||||
if(!database.RunQuery(query,errbuf))
|
||||
if(!database.RunQuery(query,&errbuf))
|
||||
{
|
||||
LogFile->write(EQEMuLog::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), errbuf);
|
||||
LogFile->write(EQEMuLog::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), errbuf.c_str());
|
||||
}
|
||||
iter++;
|
||||
}
|
||||
|
||||
@@ -635,7 +635,7 @@ AdventureTemplate *AdventureManager::GetAdventureTemplate(int id)
|
||||
|
||||
bool AdventureManager::LoadAdventureTemplates()
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
@@ -646,7 +646,7 @@ bool AdventureManager::LoadAdventureTemplates()
|
||||
" dest_z, dest_h, graveyard_zone_id, graveyard_x, graveyard_y, graveyard_z, "
|
||||
"graveyard_radius FROM adventure_template";
|
||||
|
||||
if(database.RunQuery(query,errbuf, &result))
|
||||
if(database.RunQuery(query, &errbuf, &result))
|
||||
{
|
||||
while((row = mysql_fetch_row(result)))
|
||||
{
|
||||
@@ -691,7 +691,7 @@ bool AdventureManager::LoadAdventureTemplates()
|
||||
}
|
||||
else
|
||||
{
|
||||
LogFile->write(EQEMuLog::Error, "Error in AdventureManager:::LoadAdventures: %s (%s)", query.c_str(), errbuf);
|
||||
LogFile->write(EQEMuLog::Error, "Error in AdventureManager:::LoadAdventures: %s (%s)", query.c_str(), errbuf.c_str());
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
@@ -699,13 +699,13 @@ bool AdventureManager::LoadAdventureTemplates()
|
||||
|
||||
bool AdventureManager::LoadAdventureEntries()
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
std::string query= "SELECT id, template_id FROM adventure_template_entry";
|
||||
|
||||
if(database.RunQuery(query, errbuf, &result))
|
||||
if(database.RunQuery(query, &errbuf, &result))
|
||||
{
|
||||
while((row = mysql_fetch_row(result)))
|
||||
{
|
||||
@@ -742,7 +742,7 @@ bool AdventureManager::LoadAdventureEntries()
|
||||
}
|
||||
else
|
||||
{
|
||||
LogFile->write(EQEMuLog::Error, "Error in AdventureManager:::LoadAdventureEntries: %s (%s)", query.c_str(), errbuf);
|
||||
LogFile->write(EQEMuLog::Error, "Error in AdventureManager:::LoadAdventureEntries: %s (%s)", query.c_str(), errbuf.c_str());
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
@@ -1090,7 +1090,7 @@ void AdventureManager::LoadLeaderboardInfo()
|
||||
leaderboard_info_percentage_ruj.clear();
|
||||
leaderboard_info_wins_tak.clear();
|
||||
leaderboard_info_percentage_tak.clear();
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
@@ -1098,7 +1098,7 @@ void AdventureManager::LoadLeaderboardInfo()
|
||||
"AS adv_stats ""left join character_ AS ch on "
|
||||
"adv_stats.player_id = ch.id;";
|
||||
|
||||
if(database.RunQuery(query,errbuf, &result))
|
||||
if(database.RunQuery(query, &errbuf, &result))
|
||||
{
|
||||
while((row = mysql_fetch_row(result)))
|
||||
{
|
||||
@@ -1159,7 +1159,7 @@ void AdventureManager::LoadLeaderboardInfo()
|
||||
}
|
||||
else
|
||||
{
|
||||
LogFile->write(EQEMuLog::Error, "Error in AdventureManager:::GetLeaderboardInfo: %s (%s)", query.c_str(), errbuf);
|
||||
LogFile->write(EQEMuLog::Error, "Error in AdventureManager:::GetLeaderboardInfo: %s (%s)", query.c_str(), errbuf.c_str());
|
||||
return;
|
||||
}
|
||||
return;
|
||||
|
||||
+25
-25
@@ -33,7 +33,7 @@ EQLConfig::EQLConfig(const char *launcher_name)
|
||||
}
|
||||
|
||||
void EQLConfig::LoadSettings() {
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
std::string query;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
@@ -45,19 +45,19 @@ void EQLConfig::LoadSettings() {
|
||||
|
||||
StringFormat(query,"SELECT dynamics FROM launcher WHERE name='%s'",namebuf.c_str());
|
||||
|
||||
if (database.RunQuery(query, errbuf, &result))
|
||||
if (database.RunQuery(query, &errbuf, &result))
|
||||
{
|
||||
while ((row = mysql_fetch_row(result))) {
|
||||
m_dynamics = atoi(row[0]);
|
||||
}
|
||||
mysql_free_result(result);
|
||||
} else {
|
||||
LogFile->write(EQEMuLog::Error, "EQLConfig::LoadSettings: %s", errbuf);
|
||||
LogFile->write(EQEMuLog::Error, "EQLConfig::LoadSettings: %s", errbuf.c_str());
|
||||
}
|
||||
|
||||
StringFormat(query, "SELECT zone,port FROM launcher_zones WHERE launcher='%s'", namebuf.c_str());
|
||||
|
||||
if (database.RunQuery(query, errbuf, &result))
|
||||
if (database.RunQuery(query, &errbuf, &result))
|
||||
{
|
||||
LauncherZone zs;
|
||||
while ((row = mysql_fetch_row(result))) {
|
||||
@@ -67,12 +67,12 @@ void EQLConfig::LoadSettings() {
|
||||
}
|
||||
mysql_free_result(result);
|
||||
} else {
|
||||
LogFile->write(EQEMuLog::Error, "EQLConfig::LoadSettings: %s", errbuf);
|
||||
LogFile->write(EQEMuLog::Error, "EQLConfig::LoadSettings: %s", errbuf.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
EQLConfig *EQLConfig::CreateLauncher(const char *name, uint8 dynamic_count) {
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
std::string query;
|
||||
|
||||
std::string namebuf;
|
||||
@@ -82,8 +82,8 @@ EQLConfig *EQLConfig::CreateLauncher(const char *name, uint8 dynamic_count) {
|
||||
StringFormat(query, "INSERT INTO launcher (name,dynamics) VALUES('%s', %d)",
|
||||
namebuf.c_str(), dynamic_count);
|
||||
|
||||
if (!database.RunQuery(query, errbuf)) {
|
||||
LogFile->write(EQEMuLog::Error, "Error in CreateLauncher query: %s", errbuf);
|
||||
if (!database.RunQuery(query, &errbuf)) {
|
||||
LogFile->write(EQEMuLog::Error, "Error in CreateLauncher query: %s", errbuf.c_str());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ void EQLConfig::DeleteLauncher() {
|
||||
|
||||
launcher_list.Remove(m_name.c_str());
|
||||
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
std::string query;
|
||||
|
||||
std::string namebuf;
|
||||
@@ -130,16 +130,16 @@ void EQLConfig::DeleteLauncher() {
|
||||
|
||||
StringFormat(query, "DELETE FROM launcher WHERE name='%s'",namebuf.c_str());
|
||||
|
||||
if (!database.RunQuery(query, errbuf)) {
|
||||
LogFile->write(EQEMuLog::Error, "Error in DeleteLauncher 1 query: %s", errbuf);
|
||||
if (!database.RunQuery(query, &errbuf)) {
|
||||
LogFile->write(EQEMuLog::Error, "Error in DeleteLauncher 1 query: %s", errbuf.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
StringFormat(query, "DELETE FROM launcher_zones WHERE launcher='%s'",
|
||||
namebuf.c_str());
|
||||
|
||||
if (!database.RunQuery(query, errbuf)) {
|
||||
LogFile->write(EQEMuLog::Error, "Error in DeleteLauncher 2 query: %s", errbuf);
|
||||
if (!database.RunQuery(query, &errbuf)) {
|
||||
LogFile->write(EQEMuLog::Error, "Error in DeleteLauncher 2 query: %s", errbuf.c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -176,7 +176,7 @@ bool EQLConfig::BootStaticZone(Const_char *short_name, uint16 port) {
|
||||
return(false);
|
||||
|
||||
//database update
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
std::string query;
|
||||
|
||||
std::string namebuf;
|
||||
@@ -190,8 +190,8 @@ bool EQLConfig::BootStaticZone(Const_char *short_name, uint16 port) {
|
||||
StringFormat(query, "INSERT INTO launcher_zones (launcher,zone,port) VALUES('%s', '%s', %d)",
|
||||
namebuf.c_str(), zonebuf.c_str(), port);
|
||||
|
||||
if (!database.RunQuery(query, errbuf)) {
|
||||
LogFile->write(EQEMuLog::Error, "Error in BootStaticZone query: %s", errbuf);
|
||||
if (!database.RunQuery(query, &errbuf)) {
|
||||
LogFile->write(EQEMuLog::Error, "Error in BootStaticZone query: %s", errbuf.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) {
|
||||
|
||||
|
||||
//database update
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
std::string query;
|
||||
|
||||
std::string namebuf;
|
||||
@@ -240,8 +240,8 @@ bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) {
|
||||
StringFormat(query, "UPDATE launcher_zones SET port=%d WHERE launcher='%s' AND zone='%s'",
|
||||
port, namebuf.c_str(), zonebuf.c_str());
|
||||
|
||||
if (!database.RunQuery(query, errbuf)) {
|
||||
LogFile->write(EQEMuLog::Error, "Error in ChangeStaticZone query: %s", errbuf);
|
||||
if (!database.RunQuery(query, &errbuf)) {
|
||||
LogFile->write(EQEMuLog::Error, "Error in ChangeStaticZone query: %s", errbuf.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) {
|
||||
}
|
||||
|
||||
//database update
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
std::string query;
|
||||
|
||||
std::string namebuf;
|
||||
@@ -282,8 +282,8 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) {
|
||||
StringFormat(query, "DELETE FROM launcher_zones WHERE launcher='%s' AND zone='%s'",
|
||||
namebuf.c_str(), zonebuf.c_str());
|
||||
|
||||
if (!database.RunQuery(query, errbuf)) {
|
||||
LogFile->write(EQEMuLog::Error, "Error in DeleteStaticZone query: %s", errbuf);
|
||||
if (!database.RunQuery(query, &errbuf)) {
|
||||
LogFile->write(EQEMuLog::Error, "Error in DeleteStaticZone query: %s", errbuf.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) {
|
||||
}
|
||||
|
||||
bool EQLConfig::SetDynamicCount(int count) {
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
std::string query;
|
||||
|
||||
std::string namebuf;
|
||||
@@ -310,8 +310,8 @@ bool EQLConfig::SetDynamicCount(int count) {
|
||||
StringFormat(query, "UPDATE launcher SET dynamics=%d WHERE name='%s'",
|
||||
count, namebuf.c_str());
|
||||
|
||||
if (!database.RunQuery(query, errbuf)) {
|
||||
LogFile->write(EQEMuLog::Error, "Error in SetDynamicCount query: %s", errbuf);
|
||||
if (!database.RunQuery(query, &errbuf)) {
|
||||
LogFile->write(EQEMuLog::Error, "Error in SetDynamicCount query: %s", errbuf.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+8
-8
@@ -384,13 +384,13 @@ bool EQW::SetPublicNote(uint32 charid, const char *note) {
|
||||
}
|
||||
|
||||
int EQW::CountBugs() {
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
std::string query = "SELECT count(*) FROM bugs where status = 0";
|
||||
|
||||
if(database.RunQuery(query, errbuf, &result)) {
|
||||
if(database.RunQuery(query, &errbuf, &result)) {
|
||||
if((row = mysql_fetch_row(result))) {
|
||||
int count = atoi(row[0]);
|
||||
mysql_free_result(result);
|
||||
@@ -403,14 +403,14 @@ int EQW::CountBugs() {
|
||||
|
||||
std::vector<std::string> EQW::ListBugs(uint32 offset) {
|
||||
std::vector<std::string> res;
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
std::string query;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
StringFormat(query,"SELECT id FROM bugs WHERE status = 0 limit %d, 30", offset);
|
||||
|
||||
if(database.RunQuery(query, errbuf, &result)) {
|
||||
if(database.RunQuery(query, &errbuf, &result)) {
|
||||
while((row = mysql_fetch_row(result))) {
|
||||
res.push_back(row[0]);
|
||||
}
|
||||
@@ -421,14 +421,14 @@ std::vector<std::string> EQW::ListBugs(uint32 offset) {
|
||||
|
||||
std::map<std::string,std::string> EQW::GetBugDetails(Const_char *id) {
|
||||
std::map<std::string,std::string> res;
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
std::string query;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
StringFormat(query,"select name, zone, x, y, z, target, bug from bugs where id = %s", id);
|
||||
|
||||
if(database.RunQuery(query, errbuf, &result)) {
|
||||
if(database.RunQuery(query, &errbuf, &result)) {
|
||||
while((row = mysql_fetch_row(result))) {
|
||||
res["name"] = row[0];
|
||||
res["zone"] = row[1];
|
||||
@@ -446,12 +446,12 @@ std::map<std::string,std::string> EQW::GetBugDetails(Const_char *id) {
|
||||
|
||||
void EQW::ResolveBug(const char *id) {
|
||||
std::vector<std::string> res;
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
std::string query;
|
||||
|
||||
StringFormat(query,"UPDATE bugs SET status=1 WHERE id=%s", id);
|
||||
|
||||
if(!database.RunQuery(query, errbuf)) {
|
||||
if(!database.RunQuery(query, &errbuf)) {
|
||||
// TODO: log failed statement.
|
||||
}
|
||||
}
|
||||
|
||||
+26
-26
@@ -35,7 +35,7 @@ extern std::vector<RaceClassCombos> character_create_race_class_combos;
|
||||
|
||||
// solar: the current stuff is at the bottom of this function
|
||||
void WorldDatabase::GetCharSelectInfo(uint32 account_id, CharacterSelect_Struct* cs) {
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
std::string query;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
@@ -58,7 +58,7 @@ void WorldDatabase::GetCharSelectInfo(uint32 account_id, CharacterSelect_Struct*
|
||||
"order by name limit 10",
|
||||
account_id);
|
||||
|
||||
if (RunQuery(query, errbuf, &result)) {
|
||||
if (RunQuery(query, &errbuf, &result)) {
|
||||
while ((row = mysql_fetch_row(result))) {
|
||||
lengths = mysql_fetch_lengths(result);
|
||||
////////////
|
||||
@@ -128,7 +128,7 @@ void WorldDatabase::GetCharSelectInfo(uint32 account_id, CharacterSelect_Struct*
|
||||
"WHERE player_class=%i AND player_deity=%i AND player_race=%i",
|
||||
pp->class_, pp->deity, pp->race);
|
||||
|
||||
RunQuery(query,errbuf,&result2);
|
||||
RunQuery(query,&errbuf,&result2);
|
||||
|
||||
// if there is only one possible start city, set it
|
||||
if(mysql_num_rows(result2) == 1) {
|
||||
@@ -161,7 +161,7 @@ void WorldDatabase::GetCharSelectInfo(uint32 account_id, CharacterSelect_Struct*
|
||||
|
||||
StringFormat(query,"SELECT extprofile FROM character_ WHERE id=%i",char_id);
|
||||
|
||||
RunQuery(query,errbuf, &result2);
|
||||
RunQuery(query, &errbuf, &result2);
|
||||
if(result2) {
|
||||
row2 = mysql_fetch_row(result2);
|
||||
ExtendedProfile_Struct* ext = (ExtendedProfile_Struct*)row2[0];
|
||||
@@ -240,7 +240,7 @@ int WorldDatabase::MoveCharacterToBind(int CharID, uint8 bindnum) {
|
||||
if (bindnum > 4)
|
||||
bindnum = 0;
|
||||
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
std::string query;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
@@ -251,7 +251,7 @@ int WorldDatabase::MoveCharacterToBind(int CharID, uint8 bindnum) {
|
||||
|
||||
StringFormat(query, "SELECT profile from character_ where id='%i'", CharID);
|
||||
|
||||
if (RunQuery(query, errbuf, &result)) {
|
||||
if (RunQuery(query, &errbuf, &result)) {
|
||||
row = mysql_fetch_row(result);
|
||||
unsigned long* lengths = mysql_fetch_lengths(result);
|
||||
if (lengths[0] == sizeof(PlayerProfile_Struct)) {
|
||||
@@ -271,7 +271,7 @@ int WorldDatabase::MoveCharacterToBind(int CharID, uint8 bindnum) {
|
||||
BindZoneName, pp.binds[bindnum].zoneId, pp.binds[bindnum].x, pp.binds[bindnum].y, pp.binds[bindnum].z,
|
||||
CharID);
|
||||
|
||||
if (!RunQuery(query, errbuf, nullptr,&affected_rows)) {
|
||||
if (!RunQuery(query, &errbuf, nullptr,&affected_rows)) {
|
||||
|
||||
return pp.zone_id;
|
||||
}
|
||||
@@ -281,7 +281,7 @@ int WorldDatabase::MoveCharacterToBind(int CharID, uint8 bindnum) {
|
||||
|
||||
bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* in_cc)
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
std::string query;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row = 0;
|
||||
@@ -299,9 +299,9 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct*
|
||||
in_cc->start_zone, in_cc->class_,
|
||||
in_cc->deity, in_cc->race);
|
||||
|
||||
if(!RunQuery(query, errbuf, &result))
|
||||
if(!RunQuery(query, &errbuf, &result))
|
||||
{
|
||||
LogFile->write(EQEMuLog::Error, "Start zone query failed: %s : %s\n", query.c_str(), errbuf);
|
||||
LogFile->write(EQEMuLog::Error, "Start zone query failed: %s : %s\n", query.c_str(), errbuf.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -432,7 +432,7 @@ bool WorldDatabase::GetStartZoneSoF(PlayerProfile_Struct* in_pp, CharCreate_Stru
|
||||
// For now, if no row matching row is found, send them to Crescent Reach, as that is probably the most likely
|
||||
// reason for no match being found.
|
||||
//
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
std::string query;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row = 0;
|
||||
@@ -450,9 +450,9 @@ bool WorldDatabase::GetStartZoneSoF(PlayerProfile_Struct* in_pp, CharCreate_Stru
|
||||
in_cc->start_zone, in_cc->class_,
|
||||
in_cc->deity, in_cc->race);
|
||||
|
||||
if(!RunQuery(query, errbuf, &result))
|
||||
if(!RunQuery(query, &errbuf, &result))
|
||||
{
|
||||
LogFile->write(EQEMuLog::Status, "SoF Start zone query failed: %s : %s\n", query.c_str(), errbuf);
|
||||
LogFile->write(EQEMuLog::Status, "SoF Start zone query failed: %s : %s\n", query.c_str(), errbuf.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -497,7 +497,7 @@ bool WorldDatabase::GetStartZoneSoF(PlayerProfile_Struct* in_pp, CharCreate_Stru
|
||||
}
|
||||
|
||||
void WorldDatabase::GetLauncherList(std::vector<std::string> &rl) {
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
@@ -505,7 +505,7 @@ void WorldDatabase::GetLauncherList(std::vector<std::string> &rl) {
|
||||
|
||||
std::string query = "SELECT name FROM launcher";
|
||||
|
||||
if (RunQuery(query, errbuf, &result))
|
||||
if (RunQuery(query, &errbuf, &result))
|
||||
{
|
||||
while ((row = mysql_fetch_row(result))) {
|
||||
rl.push_back(row[0]);
|
||||
@@ -513,13 +513,13 @@ void WorldDatabase::GetLauncherList(std::vector<std::string> &rl) {
|
||||
mysql_free_result(result);
|
||||
}
|
||||
else {
|
||||
LogFile->write(EQEMuLog::Error, "WorldDatabase::GetLauncherList: %s", errbuf);
|
||||
LogFile->write(EQEMuLog::Error, "WorldDatabase::GetLauncherList: %s", errbuf.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void WorldDatabase::SetMailKey(int CharID, int IPAddress, int MailKey) {
|
||||
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
std::string query;
|
||||
|
||||
char MailKeyString[17];
|
||||
@@ -532,21 +532,21 @@ void WorldDatabase::SetMailKey(int CharID, int IPAddress, int MailKey) {
|
||||
StringFormat(query, "UPDATE character_ SET mailkey = '%s' WHERE id='%i'",
|
||||
MailKeyString, CharID);
|
||||
|
||||
if (!RunQuery(query, errbuf))
|
||||
LogFile->write(EQEMuLog::Error, "WorldDatabase::SetMailKey(%i, %s) : %s", CharID, MailKeyString, errbuf);
|
||||
if (!RunQuery(query, &errbuf))
|
||||
LogFile->write(EQEMuLog::Error, "WorldDatabase::SetMailKey(%i, %s) : %s", CharID, MailKeyString, errbuf.c_str());
|
||||
|
||||
}
|
||||
|
||||
bool WorldDatabase::GetCharacterLevel(const char *name, int &level)
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
std::string query;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
StringFormat(query, "SELECT level FROM character_ WHERE name='%s'", name);
|
||||
|
||||
if(RunQuery(query, errbuf, &result))
|
||||
if(RunQuery(query, &errbuf, &result))
|
||||
{
|
||||
if(row = mysql_fetch_row(result))
|
||||
{
|
||||
@@ -558,7 +558,7 @@ bool WorldDatabase::GetCharacterLevel(const char *name, int &level)
|
||||
}
|
||||
else
|
||||
{
|
||||
LogFile->write(EQEMuLog::Error, "WorldDatabase::GetCharacterLevel: %s", errbuf);
|
||||
LogFile->write(EQEMuLog::Error, "WorldDatabase::GetCharacterLevel: %s", errbuf.c_str());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -566,14 +566,14 @@ bool WorldDatabase::GetCharacterLevel(const char *name, int &level)
|
||||
bool WorldDatabase::LoadCharacterCreateAllocations() {
|
||||
character_create_allocations.clear();
|
||||
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
std::string query = "SELECT * FROM char_create_point_allocations order by id";
|
||||
|
||||
if(RunQuery(query, errbuf, &result)) {
|
||||
if(RunQuery(query, &errbuf, &result)) {
|
||||
while(row = mysql_fetch_row(result)) {
|
||||
RaceClassAllocation allocate;
|
||||
int r = 0;
|
||||
@@ -605,13 +605,13 @@ bool WorldDatabase::LoadCharacterCreateAllocations() {
|
||||
bool WorldDatabase::LoadCharacterCreateCombos() {
|
||||
character_create_race_class_combos.clear();
|
||||
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
std::string query ="select * from char_create_combinations order by race, class, deity, start_zone";
|
||||
|
||||
if(RunQuery(query, errbuf, &result)) {
|
||||
if(RunQuery(query, &errbuf, &result)) {
|
||||
while(row = mysql_fetch_row(result)) {
|
||||
RaceClassCombos combo;
|
||||
int r = 0;
|
||||
|
||||
@@ -447,7 +447,7 @@ bool ZoneServer::Process() {
|
||||
}
|
||||
else if (cle->Online() == CLE_Status_Zoning) {
|
||||
if (!scm->noreply) {
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
std::string errbuf;
|
||||
std::string query;
|
||||
MYSQL_RES *result;
|
||||
//MYSQL_ROW row; Trumpcard - commenting. Currently unused.
|
||||
@@ -459,14 +459,14 @@ bool ZoneServer::Process() {
|
||||
|
||||
StringFormat(query,"SELECT name from character_ where name='%s'",scm->deliverto);
|
||||
|
||||
if (database.RunQuery(query,errbuf, &result)) {
|
||||
if (database.RunQuery(query, &errbuf, &result)) {
|
||||
if (result!=0) {
|
||||
|
||||
StringFormat(query, "INSERT INTO tellque (Date,Receiver,Sender,Message) "
|
||||
"values('%s','%s','%s','%s')",
|
||||
telldate, scm->deliverto, scm->from,scm->message);
|
||||
|
||||
if (database.RunQuery(query, errbuf, &result))
|
||||
if (database.RunQuery(query, &errbuf, &result))
|
||||
zoneserver_list.SendEmoteMessage(scm->from, 0, 0, 0, "Your message has been added to the %s's que.", scm->to);
|
||||
else
|
||||
zoneserver_list.SendEmoteMessage(scm->from, 0, 0, 0, "You told %s, '%s is not online at this time'", scm->to, scm->to);
|
||||
|
||||
Reference in New Issue
Block a user