mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-03-10 16:34:40 +00:00
1.2.9a - fix
- Fixed native in non-main thread
This commit is contained in:
@@ -59,7 +59,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
}
|
||||
}
|
||||
|
||||
public async void OnConfigParsed(CS2_SimpleAdminConfig config)
|
||||
public void OnConfigParsed(CS2_SimpleAdminConfig config)
|
||||
{
|
||||
if (config.DatabaseHost.Length < 1 || config.DatabaseName.Length < 1 || config.DatabaseUser.Length < 1)
|
||||
{
|
||||
@@ -77,8 +77,11 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
|
||||
dbConnectionString = builder.ConnectionString;
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
_database = new(dbConnectionString);
|
||||
|
||||
using (var connection = _database.GetConnection())
|
||||
@@ -161,6 +164,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
Logger.LogError("Unable to connect to the database!");
|
||||
throw new Exception("[CS2-SimpleAdmin] Unable to connect to the Database!");
|
||||
}
|
||||
});
|
||||
|
||||
Config = config;
|
||||
_localizer = Localizer;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using MySqlConnector;
|
||||
|
||||
namespace CS2_SimpleAdmin;
|
||||
public class Database
|
||||
{
|
||||
private readonly string _dbConnectionString;
|
||||
|
||||
@@ -4,6 +4,7 @@ using CounterStrikeSharp.API.Modules.Admin;
|
||||
using CounterStrikeSharp.API.Modules.Commands;
|
||||
using CounterStrikeSharp.API.Modules.Cvars;
|
||||
using Dapper;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using static CounterStrikeSharp.API.Core.Listeners;
|
||||
|
||||
Reference in New Issue
Block a user