Skip to content

Commit

Permalink
AFKManager v1.2.3 - Code cleanup
Browse files Browse the repository at this point in the history
- Fixing compiler warnings
  • Loading branch information
data-bomb authored Jan 6, 2024
1 parent 268bed7 commit 9c9c1c6
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions Si_AFKManager/Si_AFK.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Silica AFK Manager
Copyright (C) 2023 by databomb
Copyright (C) 2024 by databomb
* Description *
For Silica listen servers, allows hosts to use the !kick or !afk command
Expand Down Expand Up @@ -34,7 +34,7 @@ You should have received a copy of the GNU General Public License
using SilicaAdminMod;
using System;

[assembly: MelonInfo(typeof(AwayFromKeyboard), "AFK Manager", "1.2.2", "databomb", "https://github.com/data-bomb/Silica")]
[assembly: MelonInfo(typeof(AwayFromKeyboard), "AFK Manager", "1.2.3", "databomb", "https://github.com/data-bomb/Silica")]
[assembly: MelonGame("Bohemia Interactive", "Silica")]
[assembly: MelonOptionalDependencies("Admin Mod")]

Expand All @@ -44,13 +44,23 @@ public class AwayFromKeyboard : MelonMod
{
public class AFKCount
{
public Player Player { get; set; }
public uint Minutes { get; set; }
private Player _player = null!;

public Player Player
{
get => _player;
set => _player = value ?? throw new ArgumentNullException("Player is required.");
}
public uint Minutes
{
get;
set;
}
}

static System.Timers.Timer afkTimer;
static Timer afkTimer = null!;
static bool AdminModAvailable = false;
static List<AFKCount> AFKTracker;
static List<AFKCount> AFKTracker = null!;
static bool oneMinuteCheckTime;
static bool skippedFirstCheck;

Expand Down Expand Up @@ -210,7 +220,7 @@ public static void Command_AFK(Player callerPlayer, String args)
}
}

private static void TimerCallbackOneMinute(object source, ElapsedEventArgs e)
private static void TimerCallbackOneMinute(object? source, ElapsedEventArgs e)
{
oneMinuteCheckTime = true;
}
Expand Down

0 comments on commit 9c9c1c6

Please sign in to comment.