Skip to main content

📚 ACCOUNT LOCK SYSTEM

Quick Description​

The Account Lock System provides an extra layer of security by allowing players to lock their accounts with a numeric PIN! Once locked, the account cannot be accessed even with the correct login credentials until the PIN is entered. Perfect for preventing account theft, sharing, and unauthorized access.


How it works​

  • Players set a 4-10 digit numeric PIN to lock their account
  • Once locked, login is blocked until PIN is entered correctly
  • PIN is required in addition to normal account password
  • Prevents account theft even if password is compromised
  • Optional character name filtering for additional security
  • Works automatically on login attempts

Main features​

  • Numeric PIN protection - 4-10 digit code requirement
  • Account lock/unlock - Toggle protection on/off
  • Name filtering - Block invalid character names (optional)
  • UI Account Lock - Easy access and setup

Security benefits​

✅ Prevents account sharing - Others can't login even with password
✅ Protects from keyloggers - PIN adds extra layer
✅ Blocks unauthorized access - Account theft protection
✅ No character deletion - Locked accounts can't be modified
✅ Trade/item safety - Prevents unauthorized transactions
✅ Peace of mind - Players control access completely


Quick config (AccountLockConfig.lua)​

Config = {
Switch = true, -- Enable/disable system
FilterName = true, -- Enable character name filtering

-- Multi-language messages
Lang = {
-- Account successfully locked
Account_Locked = {
"[Account Lock] Account locked", -- English
"[Account Lock] A conta foi bloqueada", -- Portuguese
"[Account Lock] La cuenta fue bloqueada", -- Spanish
1, -- Message type (1 = System message)
},

-- Account successfully unlocked
Account_Unlocked = {
"[Account Lock] Account unlocked",
"[Account Lock] A conta foi desbloqueada",
"[Account Lock] La cuenta fue desbloqueada",
1,
},

-- Account already locked error
Account_Already_Locked = {
"[Account Lock] Account already locked",
"[Account Lock] A conta ja esta bloqueada",
"[Account Lock] La cuenta ya esta bloqueada",
1,
},

-- Account not locked error
Account_Not_Locked = {
"[Account Lock] Account not locked",
"[Account Lock] A conta nao esta bloqueada",
"[Account Lock] La cuenta no esta bloqueada",
1,
},

-- Incorrect PIN entered
Account_Incorrect_Password = {
"[Account Lock] Incorrect password",
"[Account Lock] Senha incorreta",
"[Account Lock] La contraseña es incorrecta",
1,
},

-- PIN length requirement error
Account_Password_Min_Max = {
"[Account Lock] Password must be between 4 and 10 digits",
"[Account Lock] A senha deve ter entre 4 e 10 digitos",
"[Account Lock] La contraseña debe tener entre 4 y 10 digitos",
1,
},

-- PIN must be numbers only
Account_Password_Only_Numbers = {
"[Account Lock] Password must only contain numbers",
"[Account Lock] A senha deve conter apenas numeros",
"[Account Lock] La contraseña debe contener solo numeros",
1,
},

-- Invalid character name error
Account_Name_Invalid = {
"[Account Lock] Your character name is invalid",
"[Account Lock] Seu nome de personagem é invalido",
"[Account Lock] El nombre de tu personaje es invalido",
1,
},

-- Invalid name - go to website instruction
Account_Name_Invalid_GoToWeb = {
"[Account Lock] please go to the web to change it",
"[Account Lock] por favor vá para o site para alterá-lo",
"[Account Lock] por favor ve al sitio web para cambiarlo",
1,
},
},
}

Login with locked account​

1. Enter normal account/password at login screen
2. System detects account is locked
3. Player accesses the blocked account interface

Character name filtering​

When FilterName = true, the system checks for invalid character names:

FilterName = true, -- Enable name filtering

Blocked name patterns (examples):​

  • Special characters: @#$%^&*
  • Admin-like names: GM, Admin, Mod
  • Offensive words (configurable)
  • Empty names or spaces only
  • Names with SQL injection attempts

Name validation flow:​

1. Player tries to login
2. System checks character name
3. If invalid: Login blocked
4. Message: "Your character name is invalid"
5. Message: "Please go to the web to change it"
6. Player must visit website to rename character

Disable filtering:

FilterName = false, -- No name filtering

Message types​

1, -- System message (blue text in chat)

Available message types:

  • 0 = Center of screen (big announcement)
  • 1 = System message [Blue]
  • 3 = System message [Red]
  • 100 = System white (accepts HTML tags)

Example with different message types:

Account_Locked = {
"[Account Lock] Account locked",
"[Account Lock] A conta foi bloqueada",
"[Account Lock] La cuenta fue bloqueada",
0, -- Show in center of screen
},

Account_Incorrect_Password = {
"[Account Lock] Incorrect password",
"[Account Lock] Senha incorreta",
"[Account Lock] La contraseña es incorrecta",
3, -- Red warning message
},

Multi-language configuration​

Each message supports 3 languages:

Message_Name = {
"English text",
"Texto em Português",
"Texto en Español",
MessageType,
},

Changing existing messages​

-- Original
Account_Locked = {
"[Account Lock] Account locked",
"[Account Lock] A conta foi bloqueada",
"[Account Lock] La cuenta fue bloqueada",
1,
},

### For administrators:

✅ **Enable name filtering**
```lua
FilterName = true, -- Prevent exploits via character names

Database structure (reference)​

-- Example table structure
CREATE TABLE AccountLock (
AccountID VARCHAR(10) PRIMARY KEY,
PIN VARCHAR(10),
IsLocked BIT DEFAULT 0,
CreatedDate DATETIME,
LastModified DATETIME,
FailedAttempts INT DEFAULT 0,
LastFailedAttempt DATETIME
);

See AccountLockConfig.lua for all configuration options and message customization.