mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 17:51:28 +00:00
Filter start_zones [skip ci]
This commit is contained in:
parent
2f4a217f7a
commit
c8722ea789
@ -25,6 +25,7 @@
|
||||
#include <cstdlib>
|
||||
#include <vector>
|
||||
#include "sof_char_create_data.h"
|
||||
#include "../common/repositories/criteria/content_filter_criteria.h"
|
||||
|
||||
WorldDatabase database;
|
||||
WorldDatabase content_db;
|
||||
@ -197,10 +198,11 @@ void WorldDatabase::GetCharSelectInfo(uint32 account_id, EQApplicationPacket **o
|
||||
|
||||
if (has_home == 0 || has_bind == 0) {
|
||||
character_list_query = StringFormat(
|
||||
"SELECT `zone_id`, `bind_id`, `x`, `y`, `z` FROM `start_zones` WHERE `player_class` = %i AND `player_deity` = %i AND `player_race` = %i",
|
||||
"SELECT `zone_id`, `bind_id`, `x`, `y`, `z` FROM `start_zones` WHERE `player_class` = %i AND `player_deity` = %i AND `player_race` = %i %s",
|
||||
p_character_select_entry_struct->Class,
|
||||
p_character_select_entry_struct->Deity,
|
||||
p_character_select_entry_struct->Race
|
||||
p_character_select_entry_struct->Race,
|
||||
ContentFilterCriteria::apply().c_str()
|
||||
);
|
||||
auto results_bind = content_db.QueryDatabase(character_list_query);
|
||||
for (auto row_d = results_bind.begin(); row_d != results_bind.end(); ++row_d) {
|
||||
@ -423,11 +425,12 @@ bool WorldDatabase::GetStartZone(
|
||||
// see if we have an entry for start_zone. We can support both titanium & SOF+ by having two entries per class/race/deity combo with different zone_ids
|
||||
std::string query = StringFormat(
|
||||
"SELECT x, y, z, heading, start_zone, bind_id, bind_x, bind_y, bind_z FROM start_zones WHERE zone_id = %i "
|
||||
"AND player_class = %i AND player_deity = %i AND player_race = %i",
|
||||
"AND player_class = %i AND player_deity = %i AND player_race = %i %s",
|
||||
p_char_create_struct->start_zone,
|
||||
p_char_create_struct->class_,
|
||||
p_char_create_struct->deity,
|
||||
p_char_create_struct->race
|
||||
p_char_create_struct->race,
|
||||
ContentFilterCriteria::apply().c_str()
|
||||
);
|
||||
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
@ -12437,9 +12437,14 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app)
|
||||
uint32 zoneid = 0;
|
||||
uint32 startCity = (uint32)strtol((const char*)app->pBuffer, nullptr, 10);
|
||||
|
||||
std::string query = StringFormat("SELECT zone_id, bind_id, x, y, z FROM start_zones "
|
||||
"WHERE player_class=%i AND player_deity=%i AND player_race=%i",
|
||||
m_pp.class_, m_pp.deity, m_pp.race);
|
||||
std::string query = StringFormat(
|
||||
"SELECT zone_id, bind_id, x, y, z FROM start_zones "
|
||||
"WHERE player_class=%i AND player_deity=%i AND player_race=%i %s",
|
||||
m_pp.class_,
|
||||
m_pp.deity,
|
||||
m_pp.race,
|
||||
ContentFilterCriteria::apply().c_str()
|
||||
);
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
LogError("No valid start zones found for /setstartcity");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user