mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-09-27 20:17:04 +02:00
1.7.3a
【UPDATE 1.7.3a】
🆕 What's new and what's changed:
- Fixed problem when you can't add admin because of the same group names on multiple servers from now on it takes in order -> server id and if there is no -> global
- Added ability to add penalties via SteamID
- Added ability to display penalty messages only for admins (ShowActivityType = 3)
- Reverted OnClientConnect to EventPlayerFullConnect
This commit is contained in:
parent
8cc0398f6b
commit
64e5f1156e
16 changed files with 301 additions and 32 deletions
|
|
@ -446,9 +446,20 @@ public class PermissionManager(Database.Database? database)
|
|||
{
|
||||
if (flag.StartsWith($"#"))
|
||||
{
|
||||
const string sql = "SELECT id FROM `sa_groups` WHERE name = @groupName";
|
||||
var groupId = await connection.QuerySingleOrDefaultAsync<int?>(sql, new { groupName = flag });
|
||||
// const string sql = "SELECT id FROM `sa_groups` WHERE name = @groupName";
|
||||
// var groupId = await connection.QuerySingleOrDefaultAsync<int?>(sql, new { groupName = flag });
|
||||
|
||||
const string sql = """
|
||||
SELECT sgs.group_id
|
||||
FROM sa_groups_servers sgs
|
||||
JOIN sa_groups sg ON sgs.group_id = sg.id
|
||||
WHERE sg.name = @groupName
|
||||
ORDER BY (sgs.server_id = @serverId) DESC, sgs.server_id ASC
|
||||
LIMIT 1
|
||||
""";
|
||||
|
||||
var groupId = await connection.QuerySingleOrDefaultAsync<int?>(sql, new { groupName = flag, CS2_SimpleAdmin.ServerId });
|
||||
|
||||
if (groupId != null)
|
||||
{
|
||||
const string updateAdminGroup = "UPDATE `sa_admins` SET group_id = @groupId WHERE id = @adminId";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue