Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikihero authored May 19, 2022
1 parent 32afbd4 commit 37bb528
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
8 changes: 7 additions & 1 deletion EventTools/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,11 @@ public sealed class Config : IConfig

[Description("The amount of time (in miliseconds) after which the 'rounlock is still enabled reminder' will be sent.")]
public int RLReminderTime { get; set; } = 300000;
}

[Description("The broadcast to be sent whenever the lottery command is used. [NUMBER] will be replaced with the rolled number.")]
public string LotteryBC { get; set; } = "<color=#b00b69><b><size=60>[NUMBER]</size></b></color>";

[Description("The closing tags for the above config path.")]
public string LotteryBCClosingTags { get; set; } = "";
}
}
30 changes: 12 additions & 18 deletions EventTools/EventTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ public class EventTools : Plugin<Config>
private static Timer aTimer;
private static Timer aTimer2;

private static readonly Lazy<EventTools> LazyInstance = new Lazy<EventTools>(() => new EventTools());
public static EventTools Instance => LazyInstance.Value;

public override PluginPriority Priority { get; } = PluginPriority.Medium;
public static EventTools Instance;
public override Version RequiredExiledVersion => new Version(5, 2, 1);

public static int tester1 = 2;
public static int tester2 = 2;

private EventTools()
public override void OnEnabled()
{

Instance = this;
SetTimer();
SetTimer2();
}

public static int tester1 = 2;
public static int tester2 = 2;
public static void RoundLockAdminChat(Object sender, ElapsedEventArgs e)
{
if (Round.IsLocked == true)
{
string message = EventTools.Instance.Config.RLEnabledMessage;
string message = Instance.Config.RLEnabledMessage;
tester1 = 1;
if (tester2 == 2)
{
Expand Down Expand Up @@ -59,7 +59,7 @@ public static void RoundLockAdminChat(Object sender, ElapsedEventArgs e)
}
else
{
string message = EventTools.Instance.Config.RLDisabledMessage;
string message = Instance.Config.RLDisabledMessage;
tester1 = 0;
if (tester2 == 2)
{
Expand Down Expand Up @@ -92,7 +92,7 @@ public static void RoundLockAdminChat(Object sender, ElapsedEventArgs e)

public static void RoundLockAdminChatReminder(Object sender, ElapsedEventArgs e)
{
string message = EventTools.Instance.Config.RLStillEnabled;
string message = Instance.Config.RLStillEnabled;
if (Round.IsLocked == true)
{
foreach (Player player in Player.List)
Expand All @@ -115,17 +115,11 @@ private static void SetTimer()

private static void SetTimer2()
{
int time = EventTools.Instance.Config.RLReminderTime;
int time = Instance.Config.RLReminderTime;
aTimer2 = new Timer(time);
aTimer2.Elapsed += RoundLockAdminChatReminder;
aTimer2.AutoReset = true;
aTimer2.Enabled = true;
}

public override void OnEnabled()
{
SetTimer();
SetTimer2();
}
}
}
4 changes: 4 additions & 0 deletions EventTools/EventTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\exiled files\EXILED\Plugins\dependencies\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>..\..\..\..\Steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp_publicized, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\exiled files\Assembly-CSharp_publicized.dll</HintPath>
Expand Down Expand Up @@ -106,6 +109,7 @@
<Compile Include="Commands\EventNext.cs" />
<Compile Include="Commands\EventStart.cs" />
<Compile Include="Commands\LockZone.cs" />
<Compile Include="Commands\Lottery.cs" />
<Compile Include="Config.cs" />
<Compile Include="EventTools.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down

0 comments on commit 37bb528

Please sign in to comment.