Move execute db query cmd to developer script
This commit is contained in:
@@ -682,4 +682,35 @@ function showLocalePickerTestCommand(command, params, client) {
|
|||||||
showLocaleChooserForPlayer(client);
|
showLocaleChooserForPlayer(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function executeDatabaseQueryCommand(command, params, client) {
|
||||||
|
if(areParamsEmpty(params)) {
|
||||||
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!targetClient) {
|
||||||
|
messagePlayerError(client, "That player was not found!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(targetCode == "") {
|
||||||
|
messagePlayerError(client, "You didn't enter any code!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let success = quickDatabaseQuery(params);
|
||||||
|
|
||||||
|
if(!success) {
|
||||||
|
messagePlayerAlert(client, `Database query failed to execute: {ALTCOLOUR}${query}`);
|
||||||
|
} else if(typeof success != "boolean") {
|
||||||
|
messagePlayeSuccess(client, `Database query successful: {ALTCOLOUR}${query}`);
|
||||||
|
messagePlayerInfo(client, `Returns: ${success}`);
|
||||||
|
} else {
|
||||||
|
messagePlayerSuccess(client, `Database query successful: {ALTCOLOUR}${query}`);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
Reference in New Issue
Block a user