Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
fix: Loading
Browse files Browse the repository at this point in the history
  • Loading branch information
K4ryuu committed Apr 11, 2024
1 parent 92cbfe9 commit 1f6558c
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 20 deletions.
6 changes: 4 additions & 2 deletions K4-System/src/Module/ModuleRank.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ public partial class ModuleRank : IModuleRank
public ModuleRank(ILogger<ModuleRank> logger, IPluginContext pluginContext)
{
this.Logger = logger;
this.plugin = (pluginContext.Plugin as Plugin)!;
this.Config = plugin.Config;
this.pluginContext = pluginContext;
}

public void Initialize(bool hotReload)
{
this.plugin = (pluginContext.Plugin as Plugin)!;
this.Config = plugin.Config;

this.Logger.LogInformation("Initializing '{0}'", this.GetType().Name);

//** ? Register Module Parts */
Expand Down
6 changes: 4 additions & 2 deletions K4-System/src/Module/ModuleStat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ public partial class ModuleStat : IModuleStat
public ModuleStat(ILogger<ModuleStat> logger, IPluginContext pluginContext)
{
this.Logger = logger;
this.plugin = (pluginContext.Plugin as Plugin)!;
this.Config = plugin.Config;
this.pluginContext = pluginContext;
}

public void Initialize(bool hotReload)
{
this.plugin = (pluginContext.Plugin as Plugin)!;
this.Config = plugin.Config;

this.Logger.LogInformation("Initializing '{0}'", this.GetType().Name);

//** ? Register Module Parts */
Expand Down
6 changes: 4 additions & 2 deletions K4-System/src/Module/ModuleTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ public partial class ModuleTime : IModuleTime
public ModuleTime(ILogger<ModuleTime> logger, IPluginContext pluginContext)
{
this.Logger = logger;
this.plugin = (pluginContext.Plugin as Plugin)!;
this.Config = plugin.Config;
this.pluginContext = pluginContext;
}

public void Initialize(bool hotReload)
{
this.plugin = (pluginContext.Plugin as Plugin)!;
this.Config = plugin.Config;

this.Logger.LogInformation("Initializing '{0}'", this.GetType().Name);

//** ? Register Module Parts */
Expand Down
6 changes: 4 additions & 2 deletions K4-System/src/Module/ModuleUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ public partial class ModuleUtils : IModuleUtils
public ModuleUtils(ILogger<ModuleUtils> logger, IPluginContext pluginContext)
{
this.Logger = logger;
this.plugin = (pluginContext.Plugin as Plugin)!;
this.Config = plugin.Config;
this.pluginContext = pluginContext;
}

public void Initialize(bool hotReload)
{
this.plugin = (pluginContext.Plugin as Plugin)!;
this.Config = plugin.Config;

this.Logger.LogInformation("Initializing '{0}'", this.GetType().Name);

//** ? Register Module Parts */
Expand Down
6 changes: 3 additions & 3 deletions K4-System/src/Module/Rank/RankGlobals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ public class RankData
public required bool MuteMessages { get; set; }
}

public readonly Plugin plugin;
public required Plugin plugin;
public readonly ILogger<ModuleRank> Logger;

public readonly PluginConfig Config;

public required PluginConfig Config;
public readonly IPluginContext pluginContext;
public Dictionary<string, Rank> rankDictionary = new Dictionary<string, Rank>();
public Rank? noneRank;
}
Expand Down
6 changes: 4 additions & 2 deletions K4-System/src/Module/Stat/StatGlobals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ public class StatData
public Dictionary<string, int> StatFields { get; set; } = new Dictionary<string, int>();
}

public readonly Plugin plugin;
public required Plugin plugin;
public readonly ILogger<ModuleStat> Logger;
public readonly PluginConfig Config;

public required PluginConfig Config;
public readonly IPluginContext pluginContext;

public bool FirstBlood = false;
}
Expand Down
5 changes: 3 additions & 2 deletions K4-System/src/Module/Time/TimeGlobals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ public class TimeData
public Dictionary<string, int> TimeFields { get; set; } = new Dictionary<string, int>();
}

public readonly Plugin plugin;
public required Plugin plugin;
public readonly ILogger<ModuleTime> Logger;

public readonly PluginConfig Config;
public required PluginConfig Config;
public readonly IPluginContext pluginContext;
}
}
5 changes: 3 additions & 2 deletions K4-System/src/Module/Utils/UtilsGlobals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ namespace K4System

public partial class ModuleUtils : IModuleUtils
{
public readonly Plugin plugin;
public required Plugin plugin;
public readonly ILogger<ModuleUtils> Logger;

public readonly PluginConfig Config;
public required PluginConfig Config;
public readonly IPluginContext pluginContext;
}
}
4 changes: 1 addition & 3 deletions K4-System/src/Plugin/Plugin.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
namespace K4System
{
using Microsoft.Extensions.Logging;
using MySqlConnector;

using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Core.Attributes;
using CounterStrikeSharp.API;
using K4System.Models;
using Dapper;

[MinimumApiVersion(191)]
[MinimumApiVersion(200)]
public sealed partial class Plugin : BasePlugin, IPluginConfig<PluginConfig>
{
//** ? PLUGIN GLOBALS */
Expand Down

0 comments on commit 1f6558c

Please sign in to comment.