mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-10-18 04:47: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
|
|
@ -48,14 +48,28 @@ public class ServerManager
|
|||
|
||||
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(
|
||||
"INSERT INTO sa_servers (address, hostname, rcon) VALUES (@address, @hostname, @rcon)",
|
||||
query,
|
||||
new { address, hostname, rcon });
|
||||
}
|
||||
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(
|
||||
"UPDATE `sa_servers` SET `hostname` = @hostname, rcon = @rcon, `id` = `id` WHERE `address` = @address",
|
||||
query,
|
||||
new { address, rcon, hostname });
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue