Handle new clients pinging old versions (Fixes #972 and Fixes #969)

This commit is contained in:
Thinkofdeath 2014-04-12 10:16:58 +01:00
parent 153bca00be
commit 1aa5379030

View File

@ -27,12 +27,13 @@ public class PlayerInfoSerializer implements JsonSerializer<ServerPing.PlayerInf
{ {
JsonObject js = json.getAsJsonObject(); JsonObject js = json.getAsJsonObject();
ServerPing.PlayerInfo info = new ServerPing.PlayerInfo( js.get( "name" ).getAsString(), (UUID) null ); ServerPing.PlayerInfo info = new ServerPing.PlayerInfo( js.get( "name" ).getAsString(), (UUID) null );
if ( protocol == 4 ) String id = js.get( "id" ).getAsString();
if ( protocol == 4 || !id.contains( "-" ))
{ {
info.setId( js.get( "id" ).getAsString() ); info.setId( id );
} else } else
{ {
info.setUniqueId( UUID.fromString( js.get( "id" ).getAsString() ) ); info.setUniqueId( UUID.fromString( id ) );
} }
return null; return null;
} }