Compare commits

...

1 Commits

Author SHA1 Message Date
Nereziel
e1f24abd5d removed exception 2023-11-25 13:10:52 +01:00

View File

@@ -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); });