mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-09 01:38:20 +00:00
Update lookup command (#909)
* Update lookup command * Fix bugs Update SlashCommandHandler.cpp
This commit is contained in:
parent
a28a2e60cf
commit
a580e3a2f5
@ -1198,11 +1198,17 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
EntityManager::Instance()->SerializeEntity(entity);
|
||||
}
|
||||
|
||||
if (chatCommand == "lookup" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() == 1) {
|
||||
if (chatCommand == "lookup" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
auto query = CDClientDatabase::CreatePreppedStmt(
|
||||
"SELECT `id`, `name` FROM `Objects` WHERE `displayName` LIKE ?1 OR `name` LIKE ?1 OR `description` LIKE ?1 LIMIT 50");
|
||||
// Concatenate all of the arguments into a single query so a multi word query can be used properly.
|
||||
std::string conditional = args[0];
|
||||
args.erase(args.begin());
|
||||
for (auto& argument : args) {
|
||||
conditional += ' ' + argument;
|
||||
}
|
||||
|
||||
const std::string query_text = "%" + args[0] + "%";
|
||||
const std::string query_text = "%" + conditional + "%";
|
||||
query.bind(1, query_text.c_str());
|
||||
|
||||
auto tables = query.execQuery();
|
||||
|
@ -78,7 +78,7 @@ These commands are primarily for development and testing. The usage of many of t
|
||||
|inspect|`/inspect <component> (-m <waypoint> \| -a <animation> \| -s \| -p \| -f (faction) \| -t)`|Finds the closest entity with the given component or LDF variable (ignoring players and racing cars), printing its ID, distance from the player, and whether it is sleeping, as well as the the IDs of all components the entity has. See [Detailed `/inspect` Usage](#detailed-inspect-usage) below.|8|
|
||||
|list-spawns|`/list-spawns`|Lists all the character spawn points in the zone. Additionally, this command will display the current scene that plays when the character lands in the next zone, if there is one.|8|
|
||||
|locrow|`/locrow`|Prints the your current position and rotation information to the console.|8|
|
||||
|lookup|`/lookup <query>`|Searches through the Objects table in the client SQLite database for items whose display name, name, or description contains the query.|8|
|
||||
|lookup|`/lookup <query>`|Searches through the Objects table in the client SQLite database for items whose display name, name, or description contains the query. Query can be multiple words delimited by spaces.|8|
|
||||
|playanimation|`/playanimation <id>`|Plays animation with given ID. Alias: `/playanim`.|8|
|
||||
|playeffect|`/playeffect <effect id> <effect type> <effect name>`|Plays an effect.|8|
|
||||
|playlvlfx|`/playlvlfx`|Plays the level up animation on your character.|8|
|
||||
|
Loading…
Reference in New Issue
Block a user