mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Ignore tab list items not containing a valid name
For cleaner /list output without "???tab" placeholders eg from TabListPlus.
This commit is contained in:
parent
4c460537e4
commit
461385d057
3 changed files with 5 additions and 5 deletions
|
|
@ -204,7 +204,7 @@ namespace MinecraftClient
|
||||||
/// Verify that a string contains only a-z A-Z 0-9 and _ characters.
|
/// Verify that a string contains only a-z A-Z 0-9 and _ characters.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
||||||
protected static bool IsValidName(string username)
|
public static bool IsValidName(string username)
|
||||||
{
|
{
|
||||||
if (String.IsNullOrEmpty(username))
|
if (String.IsNullOrEmpty(username))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -563,8 +563,8 @@ namespace MinecraftClient
|
||||||
/// <param name="info">Info about this player</param>
|
/// <param name="info">Info about this player</param>
|
||||||
public void OnPlayerJoin(PlayerInfo info)
|
public void OnPlayerJoin(PlayerInfo info)
|
||||||
{
|
{
|
||||||
//Ignore TabListPlus placeholders
|
//Ignore placeholders eg 0000tab# from TabListPlus
|
||||||
if (info.Name.StartsWith("0000tab#"))
|
if (!ChatBot.IsValidName(info.Name))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
lock (onlinePlayers)
|
lock (onlinePlayers)
|
||||||
|
|
|
||||||
|
|
@ -430,8 +430,8 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
int propNum = readNextVarInt(packetData);
|
int propNum = readNextVarInt(packetData);
|
||||||
for (int p = 0; p < propNum; p++)
|
for (int p = 0; p < propNum; p++)
|
||||||
{
|
{
|
||||||
readNextString(packetData);
|
string key = readNextString(packetData);
|
||||||
readNextString(packetData);
|
string val = readNextString(packetData);
|
||||||
if (readNextBool(packetData))
|
if (readNextBool(packetData))
|
||||||
readNextString(packetData);
|
readNextString(packetData);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue