mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-02-25 04:42:47 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1f24abd5d |
@@ -91,7 +91,6 @@ public class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig>
|
|||||||
};
|
};
|
||||||
public override void Load(bool hotReload)
|
public override void Load(bool hotReload)
|
||||||
{
|
{
|
||||||
SetGlobalExceptionHandler();
|
|
||||||
if (!Config.GlobalShare)
|
if (!Config.GlobalShare)
|
||||||
{
|
{
|
||||||
BuildDatabaseConnectionString();
|
BuildDatabaseConnectionString();
|
||||||
@@ -219,21 +218,8 @@ public class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig>
|
|||||||
*/
|
*/
|
||||||
public override void Unload(bool hotReload)
|
public override void Unload(bool hotReload)
|
||||||
{
|
{
|
||||||
RemoveGlobalExceptionHandler();
|
|
||||||
base.Unload(hotReload);
|
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()
|
private void RegisterCommands()
|
||||||
{
|
{
|
||||||
AddCommand($"css_{Config.Additional.CommandSkin}", "Skins info", (player, info) => { if (player == null) return; OnCommandWS(player, info); });
|
AddCommand($"css_{Config.Additional.CommandSkin}", "Skins info", (player, info) => { if (player == null) return; OnCommandWS(player, info); });
|
||||||
|
|||||||
Reference in New Issue
Block a user