Fix all warnings & Trim (#2226)

* Fix AutoFishing crash
* Fix all warnings
* Remove DotNetZip.
* Fix the usage of HttpClient.
This commit is contained in:
BruceChen 2022-10-02 18:31:08 +08:00 committed by GitHub
parent 4aa6c1c99f
commit 1d52d1eadd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
227 changed files with 2201 additions and 43564 deletions

View file

@ -34,12 +34,12 @@ namespace MinecraftClient.Protocol.Keys
public bool NeedRefresh()
{
return DateTime.Now.ToUniversalTime() > this.RefreshedAfter;
return DateTime.Now.ToUniversalTime() > RefreshedAfter;
}
public bool IsExpired()
{
return DateTime.Now.ToUniversalTime() > this.ExpiresAt;
return DateTime.Now.ToUniversalTime() > ExpiresAt;
}
public long GetExpirationMilliseconds()
@ -61,17 +61,17 @@ namespace MinecraftClient.Protocol.Keys
if (fields.Length < 6)
throw new InvalidDataException("Invalid string format");
PublicKey publicKey = new PublicKey(pemKey: fields[0].Trim(),
PublicKey publicKey = new(pemKey: fields[0].Trim(),
sig: fields[1].Trim(), sigV2: fields[2].Trim());
PrivateKey privateKey = new PrivateKey(pemKey: fields[3].Trim());
PrivateKey privateKey = new(pemKey: fields[3].Trim());
return new PlayerKeyPair(publicKey, privateKey, fields[4].Trim(), fields[5].Trim());
}
public override string ToString()
{
List<string> datas = new List<string>();
List<string> datas = new();
datas.Add(Convert.ToBase64String(PublicKey.Key));
if (PublicKey.Signature == null)
datas.Add(String.Empty);