• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Modern account website character deletion

Killzon32

There killing our dudes.
Joined
Aug 11, 2010
Messages
235
Reaction score
8
Location
mount olympus
I know this probably been asked a couple of times I tried searching without finding an answer.
But people can't delete characters off the modern acc website I am wondering how you fix this bug.... If this is a easy fix then Accept my free rep by answering it :3
 
Follow the next steps:

1.- Create Account
2.- Create a Character
3.- Try Login in your OT
4.- Now, go to your Page and delete it (Character).
5.- Now, try login in your OT

What happened? this function won't delete your character from the database, this function deactivated your character and this works how a deletion no permanent.
 
I click on x button on website it says do you want to delete it I click yes, and it does nothing and its still there, It deletes it in game but not on website.
 
Last edited:
You need to update the SQL query, and verify that the player is offline before deleting it.

This is very simplified, but some logic like this:
PHP:
<?php
$query = "SELECT online FROM players WHERE name='%s'", mysql_real_escape_string($charname);
if ($query == 0){ // If player is offline
$query = "DELETE FROM players WHERE name='%s'", mysql_real_escape_string($charname);
mysql_query($query);
} else {
echo 'Character must be offline before deleting!';
}
?>

You have to figure out how modern aac does this, and change the behavior to slightly mimic my sample.
 
You need to update the SQL query, and verify that the player is offline before deleting it.

This is very simplified, but some logic like this:
PHP:
<?php
$query = "SELECT online FROM players WHERE name='%s'", mysql_real_escape_string($charname);
if ($query == 0){ // If player is offline
$query = "DELETE FROM players WHERE name='%s'", mysql_real_escape_string($charname);
mysql_query($query);
} else {
echo 'Character must be offline before deleting!';
}
?>

You have to figure out how modern aac does this, and change the behavior to slightly mimic my sample.
jackie-chan-meme.jpg
 
Ok I cant really help much but I can tell you what lines to modify but together with zNote's code it should work if you have a clue about php (which I dont).
PHP:
// system/application/controllers/account.php - line 458
$this->account_model->deletePlayer($id); // change this line

// system\application\libraries\POT/OTS_players_list
//change line 26 -- change it so it deletes the whole table. I tried but couldnt figure out how to do it myself

//function deletePlayer

public function deletePlayer(OTS_Player $player)
    {
        $this->db->query('DELETE FROM ' . $this->db->tableName('players') . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $player->getId() );
    }
 
you cant just throw them in there but in

system\application\libraries\POT/OTS_players_list - line 26

system/application/controllers/account.php - line 458
 
You have to change the line 26 in system\application\libraries\POT/OTS_players_list to delete the selected character's table in 'players'
 
Sorry for pushing. But I got the same problem until 5 minutes ago and im sure i will not be the only one in the future.

Simply go into htdocs\system\application\models\account_model.php and overwrite this function:
PHP:
    public function deletePlayer($id) {
        $this->db->update('players', array('deleted' => 1), array('id' => $id));
    }

with that one:
PHP:
    public function deletePlayer($id) {
        $this->db->query("DELETE FROM `players` WHERE `id` = ".$this->db->escape($id)."");
    }

This will DELETE the whole user from your database without making trouble with Modern AAC :)

Feel loved by me, Leyla.
 
Back
Top