mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-09-27 20:17:04 +02:00
update: info in readme & fixes
This commit is contained in:
parent
970d7f1033
commit
1d7f30e809
3 changed files with 316 additions and 2 deletions
296
CS2-SimpleAdmin.example.json
Normal file
296
CS2-SimpleAdmin.example.json
Normal file
|
|
@ -0,0 +1,296 @@
|
||||||
|
// This configuration was automatically generated by CounterStrikeSharp for plugin 'CS2-SimpleAdmin', at 2024/10/09 05:40:44
|
||||||
|
{
|
||||||
|
"ConfigVersion": 21,
|
||||||
|
"DatabaseHost": "",
|
||||||
|
"DatabasePort": 3306,
|
||||||
|
"DatabaseUser": "",
|
||||||
|
"DatabasePassword": "",
|
||||||
|
"DatabaseName": "",
|
||||||
|
"OtherSettings": {
|
||||||
|
"ShowActivityType": 1,
|
||||||
|
"TeamSwitchType": 1,
|
||||||
|
"KickTime": 5,
|
||||||
|
"BanType": 1,
|
||||||
|
"TimeMode": 1,
|
||||||
|
"DisableDangerousCommands": true,
|
||||||
|
"MaxBanDuration": 10080,
|
||||||
|
"ExpireOldIpBans": 0,
|
||||||
|
"ReloadAdminsEveryMapChange": false,
|
||||||
|
"DisconnectedPlayersHistoryCount": 10,
|
||||||
|
"NotifyPenaltiesToAdminOnConnect": true,
|
||||||
|
"ShowBanMenuIfNoTime": true
|
||||||
|
},
|
||||||
|
"EnableMetrics": true,
|
||||||
|
"EnableUpdateCheck": true,
|
||||||
|
"Timezone": "UTC",
|
||||||
|
"WarnThreshold": {
|
||||||
|
"998": "css_addban STEAMID64 60 \u00223/4 Warn\u0022",
|
||||||
|
"999": "css_ban #USERID 120 \u00224/4 Warn\u0022"
|
||||||
|
},
|
||||||
|
"MultiServerMode": true,
|
||||||
|
"Discord": {
|
||||||
|
"DiscordLogWebhook": "",
|
||||||
|
"DiscordPenaltyBanSettings": [
|
||||||
|
{
|
||||||
|
"name": "Color",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Webhook",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ThumbnailUrl",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ImageUrl",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Footer",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Time",
|
||||||
|
"value": "{relative}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"DiscordPenaltyMuteSettings": [
|
||||||
|
{
|
||||||
|
"name": "Color",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Webhook",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ThumbnailUrl",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ImageUrl",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Footer",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Time",
|
||||||
|
"value": "{relative}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"DiscordPenaltyGagSettings": [
|
||||||
|
{
|
||||||
|
"name": "Color",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Webhook",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ThumbnailUrl",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ImageUrl",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Footer",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Time",
|
||||||
|
"value": "{relative}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"DiscordPenaltySilenceSettings": [
|
||||||
|
{
|
||||||
|
"name": "Color",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Webhook",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ThumbnailUrl",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ImageUrl",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Footer",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Time",
|
||||||
|
"value": "{relative}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"DiscordPenaltyWarnSettings": [
|
||||||
|
{
|
||||||
|
"name": "Color",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Webhook",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ThumbnailUrl",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ImageUrl",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Footer",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Time",
|
||||||
|
"value": "{relative}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"DefaultMaps": [],
|
||||||
|
"WorkshopMaps": {
|
||||||
|
"awp_arena_vlgbeta_gg2": 3080841519
|
||||||
|
},
|
||||||
|
"CustomServerCommands": [],
|
||||||
|
"MenuConfig": {
|
||||||
|
"Durations": [
|
||||||
|
{
|
||||||
|
"name": "1 minute",
|
||||||
|
"duration": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "5 minutes",
|
||||||
|
"duration": 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "15 minutes",
|
||||||
|
"duration": 15
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "1 hour",
|
||||||
|
"duration": 60
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "1 day",
|
||||||
|
"duration": 1440
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "7 days",
|
||||||
|
"duration": 10080
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "14 days",
|
||||||
|
"duration": 20160
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "30 days",
|
||||||
|
"duration": 43200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Permanent",
|
||||||
|
"duration": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"BanReasons": [
|
||||||
|
"Hacking",
|
||||||
|
"Voice Abuse",
|
||||||
|
"Chat Abuse",
|
||||||
|
"Admin disrespect",
|
||||||
|
"Other"
|
||||||
|
],
|
||||||
|
"KickReasons": [
|
||||||
|
"Voice Abuse",
|
||||||
|
"Chat Abuse",
|
||||||
|
"Admin disrespect",
|
||||||
|
"Other"
|
||||||
|
],
|
||||||
|
"WarnReasons": [
|
||||||
|
"Voice Abuse",
|
||||||
|
"Chat Abuse",
|
||||||
|
"Admin disrespect",
|
||||||
|
"Other"
|
||||||
|
],
|
||||||
|
"MuteReasons": [
|
||||||
|
"Racial slurs",
|
||||||
|
"Advertising",
|
||||||
|
"Spamming",
|
||||||
|
"Spectator camera abuse",
|
||||||
|
"Hate",
|
||||||
|
"Admin disrespect",
|
||||||
|
"Other"
|
||||||
|
],
|
||||||
|
"AdminFlags": [
|
||||||
|
{
|
||||||
|
"name": "Generic",
|
||||||
|
"flag": "@css/generic"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Chat",
|
||||||
|
"flag": "@css/chat"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Change Map",
|
||||||
|
"flag": "@css/changemap"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Slay",
|
||||||
|
"flag": "@css/slay"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Kick",
|
||||||
|
"flag": "@css/kick"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Ban",
|
||||||
|
"flag": "@css/ban"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Perm Ban",
|
||||||
|
"flag": "@css/permban"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Unban",
|
||||||
|
"flag": "@css/unban"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Show IP",
|
||||||
|
"flag": "@css/showip"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Cvar",
|
||||||
|
"flag": "@css/cvar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Rcon",
|
||||||
|
"flag": "@css/rcon"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Root (all flags)",
|
||||||
|
"flag": "@css/root"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ChatLog": {
|
||||||
|
"ChatLog_Enable": true,
|
||||||
|
"ChatLog_ExcludeMessageContains": "!./",
|
||||||
|
"ChatLog_ExcludeMessageContainsLessThanXLetters": 0,
|
||||||
|
"ChatLog_ExcludeMessageDuplicate": false
|
||||||
|
},
|
||||||
|
"Statistics_Enable": true,
|
||||||
|
"IsCSSPanel": true,
|
||||||
|
"BanIDBan": false
|
||||||
|
}
|
||||||
|
|
@ -48,14 +48,28 @@ public class ServerManager
|
||||||
|
|
||||||
if (!addressExists)
|
if (!addressExists)
|
||||||
{
|
{
|
||||||
|
string query = "INSERT INTO sa_servers (address, hostname) VALUES (@address, @hostname)";
|
||||||
|
|
||||||
|
if(CS2_SimpleAdmin.Instance.Config.IsCSSPanel)
|
||||||
|
{
|
||||||
|
query = "INSERT INTO sa_servers (address, hostname, rcon) VALUES (@address, @hostname, @rcon)";
|
||||||
|
}
|
||||||
|
|
||||||
await connection.ExecuteAsync(
|
await connection.ExecuteAsync(
|
||||||
"INSERT INTO sa_servers (address, hostname, rcon) VALUES (@address, @hostname, @rcon)",
|
query,
|
||||||
new { address, hostname, rcon });
|
new { address, hostname, rcon });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
string query = "UPDATE `sa_servers` SET `hostname` = @hostname, `id` = `id` WHERE `address` = @address";
|
||||||
|
|
||||||
|
if(CS2_SimpleAdmin.Instance.Config.IsCSSPanel)
|
||||||
|
{
|
||||||
|
query = "UPDATE `sa_servers` SET `hostname` = @hostname, rcon = @rcon, `id` = `id` WHERE `address` = @address";
|
||||||
|
}
|
||||||
|
|
||||||
await connection.ExecuteAsync(
|
await connection.ExecuteAsync(
|
||||||
"UPDATE `sa_servers` SET `hostname` = @hostname, rcon = @rcon, `id` = `id` WHERE `address` = @address",
|
query,
|
||||||
new { address, rcon, hostname });
|
new { address, rcon, hostname });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
# This fork is made to support [CSSPanel](https://github.com/CSSPanel/Panel)'s functionalities:
|
||||||
|
- This fork has added some variables in config file so refer to: `CS2-SimpleAdmin.example.json`. That's all for folks who are upgrading from [CSSPanel Plugin](https://github.com/CSSPanel/Plugin)
|
||||||
|
- If you are upgrading from [CS2-SimpleAdmin](https://github.com/daffyyyy/CS2-SimpleAdmin) and want to use CSSPanel stuff, you need to execute `Database/Migrations/011_CSSPanelSupport.sql` file in your database.
|
||||||
|
|
||||||
# CS2-SimpleAdmin
|
# CS2-SimpleAdmin
|
||||||
|
|
||||||
> **Manage your Counter-Strike 2 server with simple commands!**
|
> **Manage your Counter-Strike 2 server with simple commands!**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue