mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-08 05:52:26 +00:00
SaveZoneCFG converted to QueryDatabase
This commit is contained in:
parent
87efd22394
commit
f1bb019933
@ -70,22 +70,25 @@ ZoneDatabase::~ZoneDatabase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ZoneDatabase::SaveZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct* zd) {
|
bool ZoneDatabase::SaveZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct* zd) {
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
|
||||||
char *query = 0;
|
std::string query = StringFormat("UPDATE zone SET underworld = %f, minclip = %f, "
|
||||||
if (!RunQuery(query, MakeAnyLenString(&query, "update zone set underworld=%f,minclip=%f,"
|
"maxclip = %f, fog_minclip = %f, fog_maxclip = %f, "
|
||||||
"maxclip=%f,fog_minclip=%f,fog_maxclip=%f,fog_blue=%i,fog_red=%i,fog_green=%i,sky=%i,"
|
"fog_blue = %i, fog_red = %i, fog_green = %i, "
|
||||||
"ztype=%i,zone_exp_multiplier=%f,safe_x=%f,safe_y=%f,safe_z=%f "
|
"sky = %i, ztype = %i, zone_exp_multiplier = %f, "
|
||||||
"where zoneidnumber=%i and version=%i",
|
"safe_x = %f, safe_y = %f, safe_z = %f "
|
||||||
|
"WHERE zoneidnumber = %i AND version = %i",
|
||||||
zd->underworld, zd->minclip,
|
zd->underworld, zd->minclip,
|
||||||
zd->maxclip,zd->fog_minclip[0],zd->fog_maxclip[0],zd->fog_blue[0],zd->fog_red[0],zd->fog_green[0],zd->sky,
|
zd->maxclip, zd->fog_minclip[0], zd->fog_maxclip[0],
|
||||||
zd->ztype,zd->zone_exp_multiplier,
|
zd->fog_blue[0], zd->fog_red[0], zd->fog_green[0],
|
||||||
|
zd->sky, zd->ztype, zd->zone_exp_multiplier,
|
||||||
zd->safe_x, zd->safe_y, zd->safe_z,
|
zd->safe_x, zd->safe_y, zd->safe_z,
|
||||||
zoneid, instance_id),errbuf)) {
|
zoneid, instance_id);
|
||||||
LogFile->write(EQEMuLog::Error, "Error in SaveZoneCFG query %s: %s", query, errbuf);
|
auto results = QueryDatabase(query);
|
||||||
safe_delete_array(query);
|
if (!results.Success()) {
|
||||||
|
LogFile->write(EQEMuLog::Error, "Error in SaveZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
safe_delete_array(query);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user