Ignore tab list items not containing a valid name

For cleaner /list output without "???tab"
placeholders eg from TabListPlus.
This commit is contained in:
ORelio 2016-08-22 23:15:16 +02:00
parent 4c460537e4
commit 461385d057
3 changed files with 5 additions and 5 deletions

View file

@ -204,7 +204,7 @@ namespace MinecraftClient
/// Verify that a string contains only a-z A-Z 0-9 and _ characters.
/// </summary>
protected static bool IsValidName(string username)
public static bool IsValidName(string username)
{
if (String.IsNullOrEmpty(username))
return false;

View file

@ -563,8 +563,8 @@ namespace MinecraftClient
/// <param name="info">Info about this player</param>
public void OnPlayerJoin(PlayerInfo info)
{
//Ignore TabListPlus placeholders
if (info.Name.StartsWith("0000tab#"))
//Ignore placeholders eg 0000tab# from TabListPlus
if (!ChatBot.IsValidName(info.Name))
return;
lock (onlinePlayers)

View file

@ -430,8 +430,8 @@ namespace MinecraftClient.Protocol.Handlers
int propNum = readNextVarInt(packetData);
for (int p = 0; p < propNum; p++)
{
readNextString(packetData);
readNextString(packetData);
string key = readNextString(packetData);
string val = readNextString(packetData);
if (readNextBool(packetData))
readNextString(packetData);
}