mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Merge branch 'MCCTeam:master' into master
This commit is contained in:
commit
99ea0d8997
3 changed files with 20 additions and 3 deletions
|
|
@ -595,7 +595,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
bool lastVerifyResult = player.IsMessageChainLegal();
|
||||
verifyResult = player.VerifyMessageHead(ref precedingSignature, ref headerSignature, ref bodyDigest);
|
||||
if (lastVerifyResult && !verifyResult)
|
||||
log.Warn("Player " + player.Name + "'s message chain is broken!");
|
||||
log.Warn(Translations.Get("chat.message_chain_broken", player.Name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ namespace MinecraftClient.Protocol
|
|||
Gamemode = gamemode;
|
||||
Ping = ping;
|
||||
DisplayName = displayName;
|
||||
lastMessageVerified = false;
|
||||
if (timeStamp != null && publicKey != null && signature != null)
|
||||
{
|
||||
DateTimeOffset dateTimeOffset = DateTimeOffset.FromUnixTimeMilliseconds((long)timeStamp);
|
||||
|
|
@ -53,13 +54,13 @@ namespace MinecraftClient.Protocol
|
|||
try
|
||||
{
|
||||
PublicKey = new PublicKey(publicKey, signature);
|
||||
lastMessageVerified = true;
|
||||
}
|
||||
catch (System.Security.Cryptography.CryptographicException)
|
||||
{
|
||||
PublicKey = null;
|
||||
}
|
||||
}
|
||||
lastMessageVerified = true;
|
||||
precedingSignature = null;
|
||||
}
|
||||
|
||||
|
|
@ -121,9 +122,15 @@ namespace MinecraftClient.Protocol
|
|||
if (this.lastMessageVerified == false)
|
||||
return false;
|
||||
if (PublicKey == null || IsKeyExpired() || (this.precedingSignature != null && precedingSignature == null))
|
||||
{
|
||||
this.lastMessageVerified = false;
|
||||
return false;
|
||||
}
|
||||
if (this.precedingSignature != null && !this.precedingSignature.SequenceEqual(precedingSignature!))
|
||||
{
|
||||
this.lastMessageVerified = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
DateTimeOffset timeOffset = DateTimeOffset.FromUnixTimeMilliseconds(timestamp);
|
||||
|
||||
|
|
@ -150,9 +157,15 @@ namespace MinecraftClient.Protocol
|
|||
if (this.lastMessageVerified == false)
|
||||
return false;
|
||||
if (PublicKey == null || IsKeyExpired() || (this.precedingSignature != null && precedingSignature == null))
|
||||
{
|
||||
this.lastMessageVerified = false;
|
||||
return false;
|
||||
}
|
||||
if (this.precedingSignature != null && !this.precedingSignature.SequenceEqual(precedingSignature!))
|
||||
{
|
||||
this.lastMessageVerified = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool res = PublicKey.VerifyHeader(Uuid, ref bodyDigest, ref headerSignature, ref precedingSignature);
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
[Documentation](https://mccteam.github.io/docs/) | [Download](#download) | [Installation](https://mccteam.github.io/docs/guide/installation.html) | [Configuration](https://mccteam.github.io/docs/guide/configuration.html) | [Usage](https://mccteam.github.io/docs/guide/usage.html)
|
||||
|
||||
[](https://github.com/MCCTeam/Minecraft-Console-Client/releases/latest)
|
||||
[](https://github.com/MCCTeam/Minecraft-Console-Client/releases/latest) <a href="https://discord.gg/sfBv4TtpC9"><img src="https://img.shields.io/discord/1018553894831403028?color=5865F2&logo=discord&logoColor=white" alt="Discord server" /></a>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
@ -31,6 +31,10 @@ Get development builds from the [Releases section](https://github.com/MCCTeam/Mi
|
|||
|
||||
Check out the [Website](https://mccteam.github.io/), [README](https://github.com/MCCTeam/Minecraft-Console-Client/tree/master/MinecraftClient/config#minecraft-console-client-user-manual) and existing [Discussions](https://github.com/MCCTeam/Minecraft-Console-Client/discussions): Maybe your question is answered there. If not, please open a [New Discussion](https://github.com/MCCTeam/Minecraft-Console-Client/discussions/new) and ask your question. If you find a bug, please report it in the [Issues](https://github.com/MCCTeam/Minecraft-Console-Client/issues) section.
|
||||
|
||||
## Discord
|
||||
|
||||
We now have a Discord server, click [here](https://discord.gg/sfBv4TtpC9) to join.
|
||||
|
||||
## Helping Us ❤️
|
||||
|
||||
We are a small community so we need help to implement upgrades for new Minecraft versions, fixing bugs and expanding the project. We are always looking for motivated people to contribute. If you feel like it could be you, please have a look at the [issues](https://github.com/MCCTeam/Minecraft-Console-Client/issues?q=is%3Aissue+is%3Aopen+label%3Awaiting-for%3Acontributor) section :)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue