diff --git a/src/map/utils/moduleutils.cpp b/src/map/utils/moduleutils.cpp index 6cb6b70ab57..dcd2a4f8d27 100644 --- a/src/map/utils/moduleutils.cpp +++ b/src/map/utils/moduleutils.cpp @@ -232,10 +232,21 @@ namespace moduleutils // we need to sanity check them here by checking the name and port against the database. if (parts.size() >= 3 && parts[0] == "xi" && parts[1] == "zones") { - auto zoneName = parts[2]; - auto currentPort = map_port == 0 ? settings::get("network.MAP_PORT") : map_port; + const auto zoneName = parts[2]; + const auto currentPort = map_port == 0 ? settings::get("network.MAP_PORT") : map_port; - auto rset = db::preparedStmt("SELECT `name`, zoneport FROM zone_settings WHERE `name` = ? AND zoneport = ?", zoneName, currentPort); + /* + TODO: Why doesn't preparedStmt work here? + + auto rset = db::preparedStmt("SELECT name, zoneport FROM zone_settings WHERE name = ? AND zoneport = ?", zoneName, currentPort); + + [debug] preparedStmt: SELECT name, zoneport FROM zone_settings WHERE name = ? AND zoneport = ? (db::preparedStmt::::()::::operator ():517) + [debug] binding 1: GM_Home (db::detail::bindValue:368) + [debug] binding 2: 54230 (db::detail::bindValue:368) + + But then no rows in the rset? + */ + const auto rset = db::query(fmt::format("SELECT name, zoneport FROM zone_settings WHERE name = {} AND zoneport = {}", zoneName, currentPort).c_str()); if (rset && rset->rowsCount() == 0) { DebugModules(fmt::format("{} does not appear to exist on this process.", zoneName));