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,14 +1107,11 @@ namespace MinecraftClient
|
||||||
/// <returns>Player info</returns>
|
/// <returns>Player info</returns>
|
||||||
public PlayerInfo? GetPlayerInfo(Guid uuid)
|
public PlayerInfo? GetPlayerInfo(Guid uuid)
|
||||||
{
|
{
|
||||||
lock (onlinePlayers)
|
if (onlinePlayers.TryGetValue(uuid, out PlayerInfo? player))
|
||||||
{
|
return player;
|
||||||
if (onlinePlayers.ContainsKey(uuid))
|
|
||||||
return onlinePlayers[uuid];
|
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public PlayerKeyPair? GetPlayerKeyPair()
|
public PlayerKeyPair? GetPlayerKeyPair()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1351,6 +1351,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
{
|
{
|
||||||
Guid playerUuid = dataTypes.ReadNextUUID(packetData);
|
Guid playerUuid = dataTypes.ReadNextUUID(packetData);
|
||||||
|
|
||||||
|
PlayerInfo player;
|
||||||
if ((actionBitset & (1 << 0)) > 0) // Actions bit 0: add player
|
if ((actionBitset & (1 << 0)) > 0) // Actions bit 0: add player
|
||||||
{
|
{
|
||||||
string name = dataTypes.ReadNextString(packetData);
|
string name = dataTypes.ReadNextString(packetData);
|
||||||
|
|
@ -1362,10 +1363,23 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
if (dataTypes.ReadNextBool(packetData))
|
if (dataTypes.ReadNextBool(packetData))
|
||||||
dataTypes.SkipNextString(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
|
if ((actionBitset & (1 << 1)) > 0) // Actions bit 1: initialize chat
|
||||||
{
|
{
|
||||||
bool hasSignatureData = dataTypes.ReadNextBool(packetData);
|
bool hasSignatureData = dataTypes.ReadNextBool(packetData);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue