Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
cf4b235
progress towards activating/deactivating admins
maxijabase Jul 30, 2026
6ea340d
merge upstream/main into feature/1509-ex-admin-deactivate
maxijabase Aug 4, 2026
fb13141
feat(admins): soft-retire, durable issuer names, and bulk actions (#1…
maxijabase Aug 4, 2026
6605ad2
fix seeder to insert coherent data in admins
maxijabase Aug 4, 2026
0fb0dd3
fix(admins): match reactivate row action to icon-only chrome
maxijabase Aug 4, 2026
259e6e4
feat(frontend): theme single-selects to match multi-select chrome
maxijabase Aug 4, 2026
919b396
feat(admins): add password visibility toggle on add-admin form
maxijabase Aug 4, 2026
339a481
fix(frontend): flip themed select panels when they would overflow
maxijabase Aug 4, 2026
4fc5736
switch add-admin server access to multiselects
maxijabase Aug 5, 2026
d2525c5
fix missing mb-3 spacing on admins list
maxijabase Aug 5, 2026
b2b99ab
rehash admins after deactivate/reactivate
maxijabase Aug 5, 2026
ecd3757
document windows powershell docker compose
maxijabase Aug 5, 2026
8433bb0
theme bulk admin group selects
maxijabase Aug 5, 2026
2fcc8ec
let dialog selects escape palette clip
maxijabase Aug 5, 2026
7c42c80
keep filter select widths on themed wrap
maxijabase Aug 5, 2026
e0c75ea
mirror flex sizing onto themed select wrap
maxijabase Aug 5, 2026
d025649
unify admins bulk action button chrome
maxijabase Aug 5, 2026
38283b9
fix mobile admins bulk select chrome
maxijabase Aug 5, 2026
8a9bd3d
replace native confirm with panel dialogs
maxijabase Aug 5, 2026
bafd23f
use multiselects on edit admin servers
maxijabase Aug 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 33 additions & 9 deletions AGENTS.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -975,13 +975,13 @@ in dev/CI). Major tables:

| Table | Purpose |
| --------------------------- | --------------------------------------------- |
| `sb_admins` | Web admins + bcrypt password + lockout state. |
| `sb_admins` | Web admins + bcrypt password + lockout state + `enabled` soft-retire flag. |
| `sb_groups` | Web admin groups (permission bitmasks). |
| `sb_srvgroups` | SourceMod admin groups (char flags). |
| `sb_admins_servers_groups` | Admin × server × group mapping. |
| `sb_servers` / `sb_servers_groups` | Game servers + server-group membership. |
| `sb_bans` | The bans themselves. |
| `sb_comms` | Mutes / gags / blocks. |
| `sb_bans` | The bans themselves (+ `admin_name` issuer snapshot). |
| `sb_comms` | Mutes / gags / blocks (+ `admin_name` issuer snapshot). |
| `sb_banlog` | Per-server enforcement events (dashboard). |
| `sb_comments` | Threaded comments on a ban. |
| `sb_demos` | Uploaded demo metadata. |
Expand Down
6 changes: 6 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ up on the next request — no rebuilds needed.
- Docker 24+ with the Compose plugin (`docker compose`, not `docker-compose`)
- Ports `8080`, `8081`, `8025`, `1025`, `3307` free on the host (override in `.env`)

`./sbpp.sh` is a bash wrapper. On **Windows PowerShell**, skip it and run
the underlying `docker compose` commands from `sbpp.sh` directly (see
`AGENTS.md` → Dev commands for the PHPUnit / seed env overrides; those
`-e DB_NAME=…` flags are required so tests never wipe the seeded panel
DB).

## Quick start

```sh
Expand Down
12 changes: 10 additions & 2 deletions docs/src/content/docs/configuring/data-export.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ sbpp-export-<uuid>.zip
`manifest.json` is always the first central-directory entry, so
consumers can read it without slurping the whole bundle. Fields:

- `format_version`: integer (currently `1`). Bumps trigger a
documented consumer-side migration.
- `format_version`: integer (currently `2`). Bumps trigger a
documented consumer-side migration. Version `2` adds
`admins.enabled` and `bans.admin_name` / `comms.admin_name`
(durable issuer snapshot).
- `bundle_id`: UUIDv4 string. Unique per attempt. Logged in the
audit trail.
- `created_at`: integer unix seconds (UTC).
Expand Down Expand Up @@ -144,6 +146,12 @@ A few entities carry derived fields:
- `comms.mute_kind`: `"mute"`, `"gag"`, `"silence"`, or
`"unknown"` (from `:prefix_comms.type` 1/2/3). `type_raw` is
the source int.
- `admins.enabled`: `1` (active) or `0` (soft-retired). Inactive
admins keep their row so attribution JOINs still resolve.
- `bans.admin_name` / `comms.admin_name`: snapshot of the issuing
admin's username at insert time (and re-snapshotted on hard
delete when still empty). Prefer this over joining `admins.user`
when reconstructing history.
- `bans.state`: `"active"`, `"expired"`, `"unbanned"`,
`"deleted"`, or `"permanent"`. Same classifier the banlist
page uses. `RemoveType` / `removed_by` / `removed_on` /
Expand Down
17 changes: 16 additions & 1 deletion docs/src/content/docs/setup/admins-and-groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,29 @@ records every admin action (bans, unbans, settings changes) with
timestamp and admin name. It's the first place to look if something
unexpected changed.

## Deactivate vs delete

Under **Admin Panel → Admins**:

- **Deactivate** retires access without removing the account. The admin
cannot log in or load as an in-game admin after the next rehash. Their
username stays on bans and blocks they issued. Use this when someone
leaves the team but you want history to stay readable.
- **Delete** permanently removes the account. Ban and block rows keep a
frozen copy of their username (`admin_name`). The list never shows
"admin deleted" for those rows.

Deactivated accounts still reserve their username and SteamID. Free
those by deleting the row or editing the account details first.

## Removing an admin

Under **Admin Panel → Admins**, find the row and click the trash icon.
You'll be asked for a reason. It goes into the audit log alongside
the removal.

Removed admins lose panel access immediately. In-game admin status
clears on the next map change.
clears on the next map change. Issuer names on existing bans stay.

## Common pitfalls

Expand Down
25 changes: 15 additions & 10 deletions game/addons/sourcemod/scripting/sbpp_comms.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1743,11 +1743,11 @@ public void Query_ProcessQueue(Database db, DBResultSet results, const char[] er
// all blocks should be entered into db!

FormatEx(query, sizeof(query),
"INSERT INTO %s_comms (authid, name, created, ends, length, reason, aid, adminIp, sid, type) \
"INSERT INTO %s_comms (authid, name, created, ends, length, reason, aid, adminIp, admin_name, sid, type) \
VALUES ('%s', '%s', %d, %d, %d, '%s', \
IFNULL((SELECT aid FROM %s_admins WHERE authid = '%s' OR authid REGEXP '^STEAM_[0-9]:%s$'), '0'), \
'%s', %d, %d)",
DatabasePrefix, sAuthEscaped, banName, startTime, (startTime + (time * 60)), (time * 60), banReason, DatabasePrefix, sAdmAuthEscaped, sAdmAuthYZEscaped, adminIp, serverID, type);
'%s', IFNULL((SELECT user FROM %s_admins WHERE authid = '%s' OR authid REGEXP '^STEAM_[0-9]:%s$'), ''), %d, %d)",
DatabasePrefix, sAuthEscaped, banName, startTime, (startTime + (time * 60)), (time * 60), banReason, DatabasePrefix, sAdmAuthEscaped, sAdmAuthYZEscaped, adminIp, DatabasePrefix, sAdmAuthEscaped, sAdmAuthYZEscaped, serverID, type);
#if defined LOG_QUERIES
LogToFile(logQuery, "Query_ProcessQueue. QUERY: %s", query);
#endif
Expand Down Expand Up @@ -3180,19 +3180,24 @@ stock void SavePunishment(int admin = 0, int target, int type, int length = -1,
"IFNULL((SELECT aid FROM %s_admins WHERE authid = '%s' OR authid REGEXP '^STEAM_[0-9]:%s$'), 0)",
DatabasePrefix, sAdminAuthIdEscaped, sAdminAuthIdYZEscaped);

char sQueryAdmName[512];
FormatEx(sQueryAdmName, sizeof(sQueryAdmName),
"IFNULL((SELECT user FROM %s_admins WHERE authid = '%s' OR authid REGEXP '^STEAM_[0-9]:%s$'), '')",
DatabasePrefix, sAdminAuthIdEscaped, sAdminAuthIdYZEscaped);

if (length >= 0)
{
// authid name, created, ends, length, reason, aid, adminIp, sid
// authid name, created, ends, length, reason, aid, adminIp, admin_name, sid
FormatEx(sQueryVal, sizeof(sQueryVal),
"'%s', '%s', UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + %d, %d, '%s', %s, '%s', %d",
sAuthidEscaped, banName, length * 60, length * 60, banReason, sQueryAdm, adminIp, serverID);
"'%s', '%s', UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + %d, %d, '%s', %s, '%s', %s, %d",
sAuthidEscaped, banName, length * 60, length * 60, banReason, sQueryAdm, adminIp, sQueryAdmName, serverID);
}
else // Session mutes
{
// authid name, created, ends, length, reason, aid, adminIp, sid
// authid name, created, ends, length, reason, aid, adminIp, admin_name, sid
FormatEx(sQueryVal, sizeof(sQueryVal),
"'%s', '%s', UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + %d, %d, '%s', %s, '%s', %d",
sAuthidEscaped, banName, SESSION_MUTE_FALLBACK, -1, banReason, sQueryAdm, adminIp, serverID);
"'%s', '%s', UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + %d, %d, '%s', %s, '%s', %s, %d",
sAuthidEscaped, banName, SESSION_MUTE_FALLBACK, -1, banReason, sQueryAdm, adminIp, sQueryAdmName, serverID);
}

switch (type)
Expand All @@ -3210,7 +3215,7 @@ stock void SavePunishment(int admin = 0, int target, int type, int length = -1,

// litle magic - one query for all actions (mute, gag or silence)
FormatEx(sQuery, sizeof(sQuery),
"INSERT INTO %s_comms (authid, name, created, ends, length, reason, aid, adminIp, sid, type) VALUES %s%s%s",
"INSERT INTO %s_comms (authid, name, created, ends, length, reason, aid, adminIp, admin_name, sid, type) VALUES %s%s%s",
DatabasePrefix, sQueryMute, type == TYPE_SILENCE ? ", " : "", sQueryGag);

#if defined LOG_QUERIES
Expand Down
54 changes: 31 additions & 23 deletions game/addons/sourcemod/scripting/sbpp_main.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1119,16 +1119,16 @@ public void GotDatabase(Database db, const char[] error, any data)
FormatEx(query, sizeof(query), "SELECT authid, srv_password, (SELECT name FROM %s_srvgroups WHERE name = srv_group AND flags != '') AS srv_group, srv_flags, user, immunity \
FROM %s_admins_servers_groups AS asg \
LEFT JOIN %s_admins AS a ON a.aid = asg.admin_id \
WHERE %s (server_id = (SELECT sid FROM %s_servers WHERE ip = '%s' AND port = '%s' LIMIT 0,1) \
WHERE a.enabled = 1 AND %s (server_id = (SELECT sid FROM %s_servers WHERE ip = '%s' AND port = '%s' LIMIT 0,1) \
OR srv_group_id = ANY (SELECT group_id FROM %s_servers_groups WHERE server_id = (SELECT sid FROM %s_servers WHERE ip = '%s' AND port = '%s' LIMIT 0,1))) \
GROUP BY aid, authid, srv_password, srv_group, srv_flags, user",
DatabasePrefix, DatabasePrefix, DatabasePrefix, queryLastLogin, DatabasePrefix, ServerIp, ServerPort, DatabasePrefix, DatabasePrefix, ServerIp, ServerPort);
} else {
FormatEx(query, sizeof(query), "SELECT authid, srv_password, (SELECT name FROM %s_srvgroups WHERE name = srv_group AND flags != '') AS srv_group, srv_flags, user, immunity \
FROM %s_admins_servers_groups AS asg \
LEFT JOIN %s_admins AS a ON a.aid = asg.admin_id \
WHERE %s server_id = %d \
OR srv_group_id = ANY (SELECT group_id FROM %s_servers_groups WHERE server_id = %d) \
WHERE a.enabled = 1 AND %s (server_id = %d \
OR srv_group_id = ANY (SELECT group_id FROM %s_servers_groups WHERE server_id = %d)) \
GROUP BY aid, authid, srv_password, srv_group, srv_flags, user",
DatabasePrefix, DatabasePrefix, DatabasePrefix, queryLastLogin, serverID, DatabasePrefix, serverID);
}
Expand Down Expand Up @@ -1242,7 +1242,7 @@ public void VerifyInsert(Database db, DBResultSet results, const char[] error, D
public void SelectBanIpCallback(Database db, DBResultSet results, const char[] error, DataPack dataPack)
{
int admin, minutes;
char adminAuth[MAX_AUTHID_LENGTH], adminIp[16], banReason[256], ip[16], reason[128], Query[512];
char adminAuth[MAX_AUTHID_LENGTH], adminIp[16], banReason[256], ip[16], reason[128], Query[1536];
char targetName[MAX_NAME_LENGTH], sTEscapedName[MAX_NAME_LENGTH * 2 + 1], targetAuth[MAX_AUTHID_LENGTH];

dataPack.Reset();
Expand Down Expand Up @@ -1278,15 +1278,17 @@ public void SelectBanIpCallback(Database db, DBResultSet results, const char[] e
}
if (serverID == -1)
{
FormatEx(Query, sizeof(Query), "INSERT INTO %s_bans (type, ip, authid, name, created, ends, length, reason, aid, adminIp, sid, country) VALUES \
FormatEx(Query, sizeof(Query), "INSERT INTO %s_bans (type, ip, authid, name, created, ends, length, reason, aid, adminIp, admin_name, sid, country) VALUES \
(1, '%s', '%s', '%s', UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + %d, %d, '%s', (SELECT aid FROM %s_admins WHERE authid = '%s' OR authid REGEXP '^STEAM_[0-9]:%s$'), '%s', \
IFNULL((SELECT user FROM %s_admins WHERE authid = '%s' OR authid REGEXP '^STEAM_[0-9]:%s$'), ''), \
(SELECT sid FROM %s_servers WHERE ip = '%s' AND port = '%s' LIMIT 0,1), ' ')",
DatabasePrefix, ip, targetAuth, sTEscapedName, (minutes * 60), (minutes * 60), banReason, DatabasePrefix, adminAuth, adminAuth[8], adminIp, DatabasePrefix, ServerIp, ServerPort);
DatabasePrefix, ip, targetAuth, sTEscapedName, (minutes * 60), (minutes * 60), banReason, DatabasePrefix, adminAuth, adminAuth[8], adminIp, DatabasePrefix, adminAuth, adminAuth[8], DatabasePrefix, ServerIp, ServerPort);
} else {
FormatEx(Query, sizeof(Query), "INSERT INTO %s_bans (type, ip, authid, name, created, ends, length, reason, aid, adminIp, sid, country) VALUES \
FormatEx(Query, sizeof(Query), "INSERT INTO %s_bans (type, ip, authid, name, created, ends, length, reason, aid, adminIp, admin_name, sid, country) VALUES \
(1, '%s', '%s', '%s', UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + %d, %d, '%s', (SELECT aid FROM %s_admins WHERE authid = '%s' OR authid REGEXP '^STEAM_[0-9]:%s$'), '%s', \
IFNULL((SELECT user FROM %s_admins WHERE authid = '%s' OR authid REGEXP '^STEAM_[0-9]:%s$'), ''), \
%d, ' ')",
DatabasePrefix, ip, targetAuth, sTEscapedName, (minutes * 60), (minutes * 60), banReason, DatabasePrefix, adminAuth, adminAuth[8], adminIp, serverID);
DatabasePrefix, ip, targetAuth, sTEscapedName, (minutes * 60), (minutes * 60), banReason, DatabasePrefix, adminAuth, adminAuth[8], adminIp, DatabasePrefix, adminAuth, adminAuth[8], serverID);
}

db.Query(InsertBanIpCallback, Query, dataPack, DBPrio_High);
Expand Down Expand Up @@ -1451,7 +1453,7 @@ public void InsertUnbanCallback(Database db, DBResultSet results, const char[] e
public void SelectAddbanCallback(Database db, DBResultSet results, const char[] error, DataPack dataPack)
{
int admin, minutes;
char adminAuth[MAX_AUTHID_LENGTH], adminIp[16], authid[MAX_AUTHID_LENGTH], banReason[256], Query[512];
char adminAuth[MAX_AUTHID_LENGTH], adminIp[16], authid[MAX_AUTHID_LENGTH], banReason[256], Query[1536];
char reason[128];

dataPack.Reset();
Expand Down Expand Up @@ -1485,15 +1487,17 @@ public void SelectAddbanCallback(Database db, DBResultSet results, const char[]
}
if (serverID == -1)
{
FormatEx(Query, sizeof(Query), "INSERT INTO %s_bans (authid, name, created, ends, length, reason, aid, adminIp, sid, country) VALUES \
FormatEx(Query, sizeof(Query), "INSERT INTO %s_bans (authid, name, created, ends, length, reason, aid, adminIp, admin_name, sid, country) VALUES \
('%s', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + %d, %d, '%s', (SELECT aid FROM %s_admins WHERE authid = '%s' OR authid REGEXP '^STEAM_[0-9]:%s$'), '%s', \
IFNULL((SELECT user FROM %s_admins WHERE authid = '%s' OR authid REGEXP '^STEAM_[0-9]:%s$'), ''), \
(SELECT sid FROM %s_servers WHERE ip = '%s' AND port = '%s' LIMIT 0,1), ' ')",
DatabasePrefix, authid, (minutes * 60), (minutes * 60), banReason, DatabasePrefix, adminAuth, adminAuth[8], adminIp, DatabasePrefix, ServerIp, ServerPort);
DatabasePrefix, authid, (minutes * 60), (minutes * 60), banReason, DatabasePrefix, adminAuth, adminAuth[8], adminIp, DatabasePrefix, adminAuth, adminAuth[8], DatabasePrefix, ServerIp, ServerPort);
} else {
FormatEx(Query, sizeof(Query), "INSERT INTO %s_bans (authid, name, created, ends, length, reason, aid, adminIp, sid, country) VALUES \
FormatEx(Query, sizeof(Query), "INSERT INTO %s_bans (authid, name, created, ends, length, reason, aid, adminIp, admin_name, sid, country) VALUES \
('%s', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + %d, %d, '%s', (SELECT aid FROM %s_admins WHERE authid = '%s' OR authid REGEXP '^STEAM_[0-9]:%s$'), '%s', \
IFNULL((SELECT user FROM %s_admins WHERE authid = '%s' OR authid REGEXP '^STEAM_[0-9]:%s$'), ''), \
%d, ' ')",
DatabasePrefix, authid, (minutes * 60), (minutes * 60), banReason, DatabasePrefix, adminAuth, adminAuth[8], adminIp, serverID);
DatabasePrefix, authid, (minutes * 60), (minutes * 60), banReason, DatabasePrefix, adminAuth, adminAuth[8], adminIp, DatabasePrefix, adminAuth, adminAuth[8], serverID);
}

db.Query(InsertAddbanCallback, Query, dataPack, DBPrio_High);
Expand Down Expand Up @@ -1548,7 +1552,7 @@ public void ProcessQueueCallback(Database db, DBResultSet results, const char[]
char ip[16];
char adminAuth[MAX_AUTHID_LENGTH];
char adminIp[16];
char query[1024];
char query[1536];
char banName[MAX_NAME_LENGTH];
char banReason[256];
while (results.MoreRows)
Expand All @@ -1574,18 +1578,20 @@ public void ProcessQueueCallback(Database db, DBResultSet results, const char[]
if (serverID == -1)
{
FormatEx(query, sizeof(query),
"INSERT INTO %s_bans (ip, authid, name, created, ends, length, reason, aid, adminIp, sid) VALUES \
"INSERT INTO %s_bans (ip, authid, name, created, ends, length, reason, aid, adminIp, admin_name, sid) VALUES \
('%s', '%s', '%s', %d, %d, %d, '%s', (SELECT aid FROM %s_admins WHERE authid = '%s' OR authid REGEXP '^STEAM_[0-9]:%s$'), '%s', \
IFNULL((SELECT user FROM %s_admins WHERE authid = '%s' OR authid REGEXP '^STEAM_[0-9]:%s$'), ''), \
(SELECT sid FROM %s_servers WHERE ip = '%s' AND port = '%s' LIMIT 0,1))",
DatabasePrefix, ip, auth, banName, startTime, startTime + time * 60, time * 60, banReason, DatabasePrefix, adminAuth, adminAuth[8], adminIp, DatabasePrefix, ServerIp, ServerPort);
DatabasePrefix, ip, auth, banName, startTime, startTime + time * 60, time * 60, banReason, DatabasePrefix, adminAuth, adminAuth[8], adminIp, DatabasePrefix, adminAuth, adminAuth[8], DatabasePrefix, ServerIp, ServerPort);
}
else
{
FormatEx(query, sizeof(query),
"INSERT INTO %s_bans (ip, authid, name, created, ends, length, reason, aid, adminIp, sid) VALUES \
"INSERT INTO %s_bans (ip, authid, name, created, ends, length, reason, aid, adminIp, admin_name, sid) VALUES \
('%s', '%s', '%s', %d, %d, %d, '%s', (SELECT aid FROM %s_admins WHERE authid = '%s' OR authid REGEXP '^STEAM_[0-9]:%s$'), '%s', \
IFNULL((SELECT user FROM %s_admins WHERE authid = '%s' OR authid REGEXP '^STEAM_[0-9]:%s$'), ''), \
%d)",
DatabasePrefix, ip, auth, banName, startTime, startTime + time * 60, time * 60, banReason, DatabasePrefix, adminAuth, adminAuth[8], adminIp, serverID);
DatabasePrefix, ip, auth, banName, startTime, startTime + time * 60, time * 60, banReason, DatabasePrefix, adminAuth, adminAuth[8], adminIp, DatabasePrefix, adminAuth, adminAuth[8], serverID);
}
DataPack authPack = new DataPack();
authPack.WriteString(auth);
Expand Down Expand Up @@ -2552,20 +2558,22 @@ stock void UTIL_InsertBan(int time, const char[] Name, const char[] Authid, cons
//PruneBans(dummy);
char banName[MAX_NAME_LENGTH];
char banReason[256];
char Query[1024];
char Query[1536];
DB.Escape(Name, banName, sizeof(banName));
DB.Escape(Reason, banReason, sizeof(banReason));
if (serverID == -1)
{
FormatEx(Query, sizeof(Query), "INSERT INTO %s_bans (ip, authid, name, created, ends, length, reason, aid, adminIp, sid, country) VALUES \
FormatEx(Query, sizeof(Query), "INSERT INTO %s_bans (ip, authid, name, created, ends, length, reason, aid, adminIp, admin_name, sid, country) VALUES \
('%s', '%s', '%s', UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + %d, %d, '%s', IFNULL((SELECT aid FROM %s_admins WHERE authid = '%s' OR authid REGEXP '^STEAM_[0-9]:%s$'),'0'), '%s', \
IFNULL((SELECT user FROM %s_admins WHERE authid = '%s' OR authid REGEXP '^STEAM_[0-9]:%s$'), ''), \
(SELECT sid FROM %s_servers WHERE ip = '%s' AND port = '%s' LIMIT 0,1), ' ')",
DatabasePrefix, Ip, Authid, banName, (time * 60), (time * 60), banReason, DatabasePrefix, AdminAuthid, AdminAuthid[8], AdminIp, DatabasePrefix, ServerIp, ServerPort);
DatabasePrefix, Ip, Authid, banName, (time * 60), (time * 60), banReason, DatabasePrefix, AdminAuthid, AdminAuthid[8], AdminIp, DatabasePrefix, AdminAuthid, AdminAuthid[8], DatabasePrefix, ServerIp, ServerPort);
} else {
FormatEx(Query, sizeof(Query), "INSERT INTO %s_bans (ip, authid, name, created, ends, length, reason, aid, adminIp, sid, country) VALUES \
FormatEx(Query, sizeof(Query), "INSERT INTO %s_bans (ip, authid, name, created, ends, length, reason, aid, adminIp, admin_name, sid, country) VALUES \
('%s', '%s', '%s', UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + %d, %d, '%s', IFNULL((SELECT aid FROM %s_admins WHERE authid = '%s' OR authid REGEXP '^STEAM_[0-9]:%s$'),'0'), '%s', \
IFNULL((SELECT user FROM %s_admins WHERE authid = '%s' OR authid REGEXP '^STEAM_[0-9]:%s$'), ''), \
%d, ' ')",
DatabasePrefix, Ip, Authid, banName, (time * 60), (time * 60), banReason, DatabasePrefix, AdminAuthid, AdminAuthid[8], AdminIp, serverID);
DatabasePrefix, Ip, Authid, banName, (time * 60), (time * 60), banReason, DatabasePrefix, AdminAuthid, AdminAuthid[8], AdminIp, DatabasePrefix, AdminAuthid, AdminAuthid[8], serverID);
}
DB.Query(VerifyInsert, Query, dataPack, DBPrio_High);
}
Expand Down
Loading
Loading