mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-02-18 10:43:22 +00:00
removed exception
This commit is contained in:
@@ -91,7 +91,6 @@ public class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig>
|
||||
};
|
||||
public override void Load(bool hotReload)
|
||||
{
|
||||
SetGlobalExceptionHandler();
|
||||
if (!Config.GlobalShare)
|
||||
{
|
||||
BuildDatabaseConnectionString();
|
||||
@@ -219,21 +218,8 @@ public class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig>
|
||||
*/
|
||||
public override void Unload(bool hotReload)
|
||||
{
|
||||
RemoveGlobalExceptionHandler();
|
||||
base.Unload(hotReload);
|
||||
}
|
||||
private void GlobalExceptionHandler(object? sender, FirstChanceExceptionEventArgs @event)
|
||||
{
|
||||
Log(@event.Exception.ToString());
|
||||
}
|
||||
private void SetGlobalExceptionHandler()
|
||||
{
|
||||
AppDomain.CurrentDomain.FirstChanceException += this.GlobalExceptionHandler;
|
||||
}
|
||||
private void RemoveGlobalExceptionHandler()
|
||||
{
|
||||
AppDomain.CurrentDomain.FirstChanceException -= this.GlobalExceptionHandler;
|
||||
}
|
||||
private void RegisterCommands()
|
||||
{
|
||||
AddCommand($"css_{Config.Additional.CommandSkin}", "Skins info", (player, info) => { if (player == null) return; OnCommandWS(player, info); });
|
||||
|
||||
Reference in New Issue
Block a user