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 MinecraftClient.Protocol;
|
||||
|
||||
namespace MinecraftClient.ChatBots
|
||||
|
|
@ -11,15 +9,16 @@ namespace MinecraftClient.ChatBots
|
|||
/// </summary>
|
||||
public class ReplayCapture : ChatBot
|
||||
{
|
||||
private ReplayHandler replay;
|
||||
private int backupInterval = 3000; // Unit: second * 10
|
||||
private ReplayHandler? replay;
|
||||
private readonly int backupInterval = 3000; // Unit: second * 10
|
||||
private int backupCounter = -1;
|
||||
|
||||
public ReplayCapture(int backupInterval)
|
||||
{
|
||||
if (backupInterval != -1)
|
||||
this.backupInterval = backupInterval * 10;
|
||||
else this.backupInterval = -1;
|
||||
else
|
||||
this.backupInterval = -1;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
|
|
@ -34,12 +33,12 @@ namespace MinecraftClient.ChatBots
|
|||
|
||||
public override void OnNetworkPacket(int packetID, List<byte> packetData, bool isLogin, bool isInbound)
|
||||
{
|
||||
replay.AddPacket(packetID, packetData, isLogin, isInbound);
|
||||
replay!.AddPacket(packetID, packetData, isLogin, isInbound);
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
if (backupInterval > 0 && replay.RecordRunning)
|
||||
if (backupInterval > 0 && replay!.RecordRunning)
|
||||
{
|
||||
if (backupCounter <= 0)
|
||||
{
|
||||
|
|
@ -52,7 +51,7 @@ namespace MinecraftClient.ChatBots
|
|||
|
||||
public override bool OnDisconnect(DisconnectReason reason, string message)
|
||||
{
|
||||
replay.OnShutDown();
|
||||
replay!.OnShutDown();
|
||||
return base.OnDisconnect(reason, message);
|
||||
}
|
||||
|
||||
|
|
@ -60,7 +59,7 @@ namespace MinecraftClient.ChatBots
|
|||
{
|
||||
try
|
||||
{
|
||||
if (replay.RecordRunning)
|
||||
if (replay!.RecordRunning)
|
||||
{
|
||||
if (args.Length > 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue