Skip to content

Commit

Permalink
update event handlers to use enqueuetext calls + update access
Browse files Browse the repository at this point in the history
  • Loading branch information
0b10000 committed Dec 31, 2021
1 parent 6d3e4dd commit 7fb6bf7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions EventHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,14 @@ public void OnDying(DyingEventArgs ev)

public void OnRoundEnded(RoundEndedEventArgs ev)
{
plugin.LogManager.SendQueue();
plugin.KillWebhook.SendMessage("**=== ROUND ENDED ===**")
.Queue(() => Log.Debug("Sent round ended message", plugin.Config.Debug));
plugin.LogManager.EnqueueText("**=== ROUND ENDED ===**", true);
Log.Debug("Sent round ended message", plugin.Config.Debug);
}

public void OnRoundStarted()
{
plugin.KillWebhook.SendMessage("**=== ROUND STARTED ===**")
.Queue(() => Log.Debug("Sent round started message", plugin.Config.Debug));
plugin.LogManager.EnqueueText("**=== ROUND STARTED ===**", true);
Log.Debug("Sent round started message", plugin.Config.Debug);
}

public void OnRespawningTeam(RespawningTeamEventArgs ev)
Expand Down
2 changes: 1 addition & 1 deletion LogManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void ReportKill(DyingEventArgs ev, LogReason reason, bool sendImmediately
EnqueueText(_killString.ToString(), sendImmediately);
}

public void SendQueue()
private void SendQueue()
{
plugin.KillWebhook.SendMessage(_queue.ToString())
.Queue(() => Log.Debug($"Sent queue of length {_queue.Length}", plugin.Config.Debug));
Expand Down
2 changes: 1 addition & 1 deletion Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class Plugin : Plugin<Config>
public override Version Version { get; } = new(2, 0, 1);
public override Version RequiredExiledVersion { get; } = new(4, 1, 5);

public EventHandlers EventHandlers { get; private set; }
private EventHandlers EventHandlers { get; set; }

public LogManager LogManager { get; private set; }

Expand Down

0 comments on commit 7fb6bf7

Please sign in to comment.