Skip to content

Commit fbf7101

Browse files
committed
Make service as a singleton
1 parent b11607d commit fbf7101

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

OpenDeathMessages/Commands/CommandDeathMessageDisplay.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ protected override async UniTask OnExecuteAsync()
3131
throw new CommandWrongUsageException(Context);
3232
}
3333

34-
var displayType = DisplayType.Global;
3534
var displayTypeString = Context.Parameters[0];
35+
36+
DisplayType displayType;
3637
if (displayTypeString.Equals("group", StringComparison.InvariantCultureIgnoreCase))
3738
{
3839
displayType = DisplayType.Group;

OpenDeathMessages/Services/PlayerMessager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Cysharp.Threading.Tasks;
22
using EvolutionPlugins.OpenDeathMessages.API;
33
using Microsoft.Extensions.Configuration;
4+
using Microsoft.Extensions.DependencyInjection;
45
using OpenMod.API.Ioc;
56
using OpenMod.UnityEngine.Extensions;
67
using OpenMod.Unturned.Players;
@@ -13,7 +14,7 @@
1314

1415
namespace EvolutionPlugins.OpenDeathMessages.Services
1516
{
16-
[PluginServiceImplementation]
17+
[PluginServiceImplementation(Lifetime = ServiceLifetime.Singleton)]
1718
public class PlayerMessager : IPlayerMessager
1819
{
1920
private readonly DisplayType m_DisplayType;

0 commit comments

Comments
 (0)