Skip to content

Commit

Permalink
fix DI
Browse files Browse the repository at this point in the history
  • Loading branch information
MSWS committed Oct 31, 2024
1 parent 2264677 commit ef422d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/CS2/Leaderboard/MSLeaderboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using GangsAPI;
using GangsAPI.Data;
using GangsAPI.Services.Commands;
using GangsAPI.Services.Gang;
using Microsoft.Extensions.DependencyInjection;
using MySqlConnector;

Expand All @@ -13,7 +14,8 @@ public class MSLeaderboard(IServiceProvider provider, IDBConfig config)
public void Start(BasePlugin? plugin, bool hotReload) {
if (plugin == null) return;
var cmd = provider.GetRequiredService<ICommandManager>();
cmd.RegisterCommand(new LeaderboardCommand(this));
cmd.RegisterCommand(new LeaderboardCommand(this,
provider.GetRequiredService<IGangManager>()));
}

public async Task<IEnumerable<(int, double)>> GetTopGangs(int limit = 10,
Expand All @@ -33,7 +35,7 @@ public void Start(BasePlugin? plugin, bool hotReload) {

while (await reader.ReadAsync())
result.Add((reader.GetInt32(0), reader.GetDouble(1)));

return result;
}
}

0 comments on commit ef422d9

Please sign in to comment.