fix: remove sa_server_groups, not really needed for core functionality

This commit is contained in:
Dollan 2024-04-11 22:57:40 +02:00
parent c2b79cd822
commit 614348fd2a
No known key found for this signature in database
2 changed files with 3 additions and 9 deletions

View file

@ -50,9 +50,3 @@ CREATE TABLE IF NOT EXISTS `sa_servers` (
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `address` (`address`) UNIQUE KEY `address` (`address`)
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; ) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
CREATE TABLE IF NOT EXISTS `sa_server_groups` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`group_name` varchar(128) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

View file

@ -70,8 +70,8 @@ public class AdminSQLManager
{ {
await using MySqlConnection connection = await _database.GetConnectionAsync(); await using MySqlConnection connection = await _database.GetConnectionAsync();
string sql = "SELECT player_steamid, flags, immunity, ends FROM sa_admins WHERE (ends IS NULL OR ends > @CurrentTime) AND (server_id IS NULL OR server_id = @serverid)"; string sql = "SELECT player_steamid, flags, immunity, ends FROM sa_admins WHERE (ends IS NULL OR ends > @CurrentTime) AND (server_id IS NULL OR server_id = @serverid) AND (group_id LIKE CONCAT('%', @groupid, '%'));";
List<dynamic>? activeFlags = (await connection.QueryAsync(sql, new { CurrentTime = now, serverid = CS2_SimpleAdmin.ServerId }))?.ToList(); List<dynamic>? activeFlags = (await connection.QueryAsync(sql, new { CurrentTime = now, serverid = CS2_SimpleAdmin.ServerId, groupid = CS2_SimpleAdmin.GroupIds }))?.ToList();
if (activeFlags == null) if (activeFlags == null)
{ {