mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Bug fix
This commit is contained in:
parent
ced65122f1
commit
1298654693
2 changed files with 20 additions and 9 deletions
|
|
@ -1107,13 +1107,10 @@ namespace MinecraftClient
|
|||
/// <returns>Player info</returns>
|
||||
public PlayerInfo? GetPlayerInfo(Guid uuid)
|
||||
{
|
||||
lock (onlinePlayers)
|
||||
{
|
||||
if (onlinePlayers.ContainsKey(uuid))
|
||||
return onlinePlayers[uuid];
|
||||
else
|
||||
return null;
|
||||
}
|
||||
if (onlinePlayers.TryGetValue(uuid, out PlayerInfo? player))
|
||||
return player;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public PlayerKeyPair? GetPlayerKeyPair()
|
||||
|
|
|
|||
|
|
@ -1351,6 +1351,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
{
|
||||
Guid playerUuid = dataTypes.ReadNextUUID(packetData);
|
||||
|
||||
PlayerInfo player;
|
||||
if ((actionBitset & (1 << 0)) > 0) // Actions bit 0: add player
|
||||
{
|
||||
string name = dataTypes.ReadNextString(packetData);
|
||||
|
|
@ -1362,10 +1363,23 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
if (dataTypes.ReadNextBool(packetData))
|
||||
dataTypes.SkipNextString(packetData);
|
||||
}
|
||||
handler.OnPlayerJoin(new(name, playerUuid));
|
||||
player = new(name, playerUuid);
|
||||
handler.OnPlayerJoin(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerInfo? playerGet = handler.GetPlayerInfo(playerUuid);
|
||||
if (playerGet == null)
|
||||
{
|
||||
player = new(string.Empty, playerUuid);
|
||||
handler.OnPlayerJoin(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
player = playerGet;
|
||||
}
|
||||
}
|
||||
|
||||
PlayerInfo player = handler.GetPlayerInfo(playerUuid)!;
|
||||
if ((actionBitset & (1 << 1)) > 0) // Actions bit 1: initialize chat
|
||||
{
|
||||
bool hasSignatureData = dataTypes.ReadNextBool(packetData);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue