mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fix all warnings & Trim (#2226)
* Fix AutoFishing crash * Fix all warnings * Remove DotNetZip. * Fix the usage of HttpClient.
This commit is contained in:
parent
4aa6c1c99f
commit
1d52d1eadd
227 changed files with 2201 additions and 43564 deletions
|
|
@ -1,7 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace MinecraftClient.WinAPI
|
||||
|
|
@ -17,7 +15,7 @@ namespace MinecraftClient.WinAPI
|
|||
/// <summary>
|
||||
/// Store codes to run before quitting
|
||||
/// </summary>
|
||||
private static List<Action> actions = new List<Action>();
|
||||
private static readonly List<Action> actions = new();
|
||||
|
||||
static ExitCleanUp()
|
||||
{
|
||||
|
|
@ -31,10 +29,12 @@ namespace MinecraftClient.WinAPI
|
|||
catch (DllNotFoundException)
|
||||
{
|
||||
// Probably on mono, fallback to ctrl+c only
|
||||
Console.CancelKeyPress += delegate (object sender, ConsoleCancelEventArgs e)
|
||||
static void value(object sender, ConsoleCancelEventArgs e)
|
||||
{
|
||||
RunCleanUp();
|
||||
};
|
||||
}
|
||||
|
||||
Console.CancelKeyPress += value!;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ namespace MinecraftClient.WinAPI
|
|||
[DllImport("Kernel32")]
|
||||
private static extern bool SetConsoleCtrlHandler(ConsoleCtrlHandler handler, bool add);
|
||||
private delegate bool ConsoleCtrlHandler(CtrlType sig);
|
||||
private static ConsoleCtrlHandler _handler;
|
||||
private static readonly ConsoleCtrlHandler? _handler;
|
||||
|
||||
enum CtrlType
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue