• 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!

AAC Ban all account query

OverBash

Well-Known Member
Joined
Mar 18, 2019
Messages
138
Solutions
2
Reaction score
74
Location
Brasil
Hello there is some query that I can run to ban all accounts for 1 day,
Just like the one I banned?
banall.jpg
 
Solution
I advice you to always take database backups before attempting to run untested SQL queries.

SQL:
INSERT INTO `bans` (
    `type`,
    `value`,
    `expires`,
    `added`,
    `admin_id`,
    `comment`
) SELECT 
    3 AS `type`,
    `accounts`.`id` AS `value`,
    UNIX_TIMESTAMP(DATE_ADD(CURDATE(), INTERVAL 24 HOUR)) AS `expires`,
    UNIX_TIMESTAMP(CURDATE()) AS `added`,
    933 AS `admin_id`,
    'Temporary ban on all accounts.' AS `comment` 
FROM `accounts`;

This should ban all accounts on your server for 24 hours after you execute the command.

The script presumes that GM player id is 933. I took the value from your first screenshot sample.
Possible with an SQL query.

... But, why?

You should be able to do /closeserver if you want to lock everyone from the game while testing stuff on your GM etc.
 
Possible with an SQL query.

... But, why?

You should be able to do /closeserver if you want to lock everyone from the game while testing stuff on your GM etc.
It is to ban all old accounts for 1 day, and only to release new accounts, for a function that cannot raise the highest levels in the game.
 
What is your SQL schema for accounts table and bans table?
hi, my schema is:
accounts:
idnamepasswordpremdayslastdayemailkeyblocked internal usagewarningsgroup_idpage_lastdayemail_newemail_new_timecreatedrlnamelocationpage_accessemail_codenext_emailpremium_pointsvotelast_postflagviptimevip_timevipdayssalt
bans table:


id
type 1 - ip banishment, 2 - namelock, 3 - account banis…value ip address (integer), player guid or account numbe…param used only for ip banishment mask (integer)activeexpiresaddedadmin_idcomment
 

Attachments

I advice you to always take database backups before attempting to run untested SQL queries.

SQL:
INSERT INTO `bans` (
    `type`,
    `value`,
    `expires`,
    `added`,
    `admin_id`,
    `comment`
) SELECT 
    3 AS `type`,
    `accounts`.`id` AS `value`,
    UNIX_TIMESTAMP(DATE_ADD(CURDATE(), INTERVAL 24 HOUR)) AS `expires`,
    UNIX_TIMESTAMP(CURDATE()) AS `added`,
    933 AS `admin_id`,
    'Temporary ban on all accounts.' AS `comment` 
FROM `accounts`;

This should ban all accounts on your server for 24 hours after you execute the command.

The script presumes that GM player id is 933. I took the value from your first screenshot sample.
 
Last edited:
Solution
I advice you to always take database backups before attempting to run untested SQL queries.
SQL:
INSERT INTO [ICODE]bans[/ICODE] (
    [ICODE]type[/ICODE],
    [ICODE]value[/ICODE],
    [ICODE]expires[/ICODE],
    [ICODE]added[/ICODE],
    [ICODE]admin_id[/ICODE],
    [ICODE]comment[/ICODE]
) SELECT
    3 AS [ICODE]type[/ICODE],
    [ICODE]accounts[/ICODE].[ICODE]id[/ICODE] AS [ICODE]value[/ICODE],
    UNIX_TIMESTAMP(DATE_ADD(CURDATE(), INTERVAL 24 HOUR)) AS [ICODE]expires[/ICODE],
    UNIX_TIMESTAMP(CURDATE()) AS [ICODE]added[/ICODE],
    933 AS [ICODE]admin_id[/ICODE],
    'Temporary ban on all accounts.' AS [ICODE]comment[/ICODE]
FROM [ICODE]accounts[/ICODE];

This should ban all accounts on your server for 24 hours after you execute the command.

Otland code tags is a bit buggy atm, here is a pastebin for not obscured code: ... Ban all accounts for a day :) https://otland.net/threads/ban-all-account-query.265699/#post-2568153 (https://gist.github.com/Znote/2c852bf8ba700b58688b915f37684c1d)

The script presumes that GM player id is 933. I took the value from your first screenshot sample.
Thanks! worked perfectly
 
Basic SQL, check your ban by ip talkaction and copy the query from it.

If what you're trying to achive is to only show active players in highscores, i'd suggest just changing the query for your highscores page to oinly select active accounts basd on login date.
 
Back
Top