Bunch of changes (see description)
* New script files to organize GUI * Added clientside pickup detection to reduce server load for enter/exit * Added notips command for players to toggle random tips * Select account last IP as part of wildcard (was separate due to old INT) * Save account registration with datetime instead of unix timestamp * Don't force mouse camera on moving anims in SA+ * Add IP ban to server runtime memory in subnet ban command * Add non-roleplay character name account moderation flag * Fix bizowner and bizclan commands * Fix bug that allowed buying items without having the needed cash * Fix set biz blip command * Add dealership help label type command * Added command to show all clan flag types * Added discord config and load from database * Fix angle for directional teleport and anim move directions * Use new colour structure in preparation for locale translations * Add on-foot only item usetype array to prevent using when in veh * Fix wrong const value for exit pickup type * Start using datetime in MySQL tables instead of unix timestamps * Start adding webhooks for discord (unfinished) * Added new discord URL to discord help category * Added house reset pickups/blips utils * Prevent using items when in skin selector * Fix get player command * Fix give player money command * Add coffee shop and vehicle repair shop default biz item templates * Remove old game fixes util (resource now in server config) * Fix bug where characters in clans wouldn't be shown in char select * Slimmed down the amount of timers * Made some potentially large numbers more readable (commas) * Remove colours in message for console output
This commit is contained in:
@@ -46,6 +46,36 @@ function autoLoginByIPCommand(command, params, client) {
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function toggleNoRandomTipsCommand(command, params, client) {
|
||||
let flagValue = getAccountSettingsFlagValue("noTimedRandomTips");
|
||||
|
||||
if(isAccountAutoIPLoginEnabled(getPlayerData(client).accountData)) {
|
||||
getPlayerData(client).accountData.settings = getPlayerData(client).accountData.settings & ~flagValue;
|
||||
messagePlayerSuccess(client, `You will not receive random tips anymore.`);
|
||||
} else {
|
||||
getPlayerData(client).accountData.settings = getPlayerData(client).accountData.settings | flagValue;
|
||||
messagePlayerSuccess(client, `You will now receive random tips every 15 minutes.`);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function toggleNoActionTipsCommand(command, params, client) {
|
||||
let flagValue = getAccountSettingsFlagValue("noActionTips");
|
||||
|
||||
if(isAccountAutoIPLoginEnabled(getPlayerData(client).accountData)) {
|
||||
getPlayerData(client).accountData.settings = getPlayerData(client).accountData.settings & ~flagValue;
|
||||
messagePlayerSuccess(client, `You will not receive action-based tips anymore.`);
|
||||
} else {
|
||||
getPlayerData(client).accountData.settings = getPlayerData(client).accountData.settings | flagValue;
|
||||
messagePlayerSuccess(client, `You will now receive tips for some actions and commands.`);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function autoSelectLastCharacterCommand(command, params, client) {
|
||||
let flagValue = getAccountSettingsFlagValue("autoSelectLastCharacter");
|
||||
|
||||
@@ -296,6 +326,37 @@ function verifyAccountEmailCommand(command, params, client) {
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
/*
|
||||
function resetAccountPasswordCommand(command, params, client) {
|
||||
if(areParamsEmpty(params)) {
|
||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||
return false;
|
||||
}
|
||||
|
||||
let splitParams = params.split(" ");
|
||||
let verificationCode = splitParams[0] || "";
|
||||
|
||||
if(!isAccountEmailVerified(getPlayerData(client).accountData)) {
|
||||
messagePlayerError(client, `Your email is not verified. Your password will not be reset!`);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!areParamsEmpty(verificationCode)) {
|
||||
if(module.hashing.sha512(verificationCode) != getPlayerData(client).accountData.resetPasswordVerificationCode) {
|
||||
messagePlayerError(client, `Invalid reset password verification code! A new one has been created and sent to your email.`);
|
||||
let resetPasswordVerificationCode = generateResetPasswordVerificationCode();
|
||||
setAccountEmailVerificationCode(getPlayerData(client).accountData, emailVerificationCode);
|
||||
sendEmailVerificationEmail(client, emailVerificationCode);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
saveAccountToDatabase(getPlayerData(client).accountData);
|
||||
}
|
||||
*/
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function setAccountDiscordCommand(command, params, client) {
|
||||
messagePlayerError(client, `This command is not yet finished and will be available soon!`);
|
||||
return false;
|
||||
@@ -371,7 +432,7 @@ function loadAccountFromName(accountName, fullLoad = false) {
|
||||
let dbConnection = connectToDatabase();
|
||||
if(dbConnection) {
|
||||
accountName = escapeDatabaseString(dbConnection, accountName);
|
||||
let dbQueryString = `SELECT acct_main.*, acct_svr.*, acct_main.acct_ip AS ipstring FROM acct_main INNER JOIN acct_svr ON acct_svr.acct_svr_acct = acct_main.acct_id AND acct_svr.acct_svr_svr = ${getServerId()} WHERE acct_name = '${accountName}' LIMIT 1;`;
|
||||
let dbQueryString = `SELECT acct_main.*, acct_svr.* FROM acct_main INNER JOIN acct_svr ON acct_svr.acct_svr_acct = acct_main.acct_id AND acct_svr.acct_svr_svr = ${getServerId()} WHERE acct_name = '${accountName}' LIMIT 1;`;
|
||||
let dbQuery = queryDatabase(dbConnection, dbQueryString);
|
||||
if(dbQuery) {
|
||||
if(dbQuery.numRows > 0) {
|
||||
@@ -664,7 +725,7 @@ function createAccount(name, password, email = "") {
|
||||
let safeName = escapeDatabaseString(dbConnection, name);
|
||||
let safeEmail = escapeDatabaseString(dbConnection, email);
|
||||
|
||||
let dbQuery = queryDatabase(dbConnection, `INSERT INTO acct_main (acct_name, acct_pass, acct_email, acct_when_registered) VALUES ('${safeName}', '${hashedPassword}', '${safeEmail}', UNIX_TIMESTAMP())`);
|
||||
let dbQuery = queryDatabase(dbConnection, `INSERT INTO acct_main (acct_name, acct_pass, acct_email, acct_when_registered) VALUES ('${safeName}', '${hashedPassword}', '${safeEmail}', CURRENT_TIMESTAMP())`);
|
||||
if(getDatabaseInsertId(dbConnection) > 0) {
|
||||
let tempAccountData = loadAccountFromId(getDatabaseInsertId(dbConnection), false);
|
||||
createDefaultAccountServerData(tempAccountData.databaseId);
|
||||
|
||||
Reference in New Issue
Block a user