Skip to content

Commit

Permalink
Merge branch 'feat/gangs' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
MSWS committed Sep 17, 2024
2 parents 1d1ea68 + d49f25f commit 619546b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion mod/Gangs.BombIconPerk/BombIconCommand.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using GangsAPI;
using CounterStrikeSharp.API;
using GangsAPI;
using GangsAPI.Data;
using GangsAPI.Data.Command;
using GangsAPI.Exceptions;
Expand Down Expand Up @@ -43,11 +44,13 @@ public class BombIconCommand(IServiceProvider provider) : ICommand {
public string[] Usage => ["<icon>"];

public void Start() {
Server.PrintToConsole("Registering Bomb Icon Command");
provider.GetRequiredService<ICommandManager>().RegisterCommand(this);
}

public async Task<CommandResult> Execute(PlayerWrapper? executor,
CommandInfoWrapper info) {
info.ReplySync("Test");
if (executor == null) return CommandResult.PLAYER_ONLY;
var player = await players.GetPlayer(executor.Steam)
?? throw new PlayerNotFoundException(executor.Steam);
Expand Down
7 changes: 6 additions & 1 deletion mod/Gangs.Boostrap/GangsServiceExtension.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core;
using Gangs.BombIconPerk;
using Jailbreak.Public;
using Jailbreak.Public.Behaviors;
using Jailbreak.Public.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

namespace Gangs.Boostrap;

Expand All @@ -16,6 +18,9 @@ public static void AddGangs(this IServiceCollection services) {
public class GangsInit : IPluginBehavior {
public void Start(BasePlugin basePlugin) {
var services = API.Gangs?.Services;
basePlugin.Logger.LogInformation(
"Found services: {services} (is null: {null}) ({Gangs}) (null: {isNull})", services,
services == null, API.Gangs, API.Gangs == null);
if (services == null) return;

_ = new BombIconBootstrap(services);
Expand Down

0 comments on commit 619546b

Please sign in to comment.