Only add \0FML\0 to the IP if forgeinfo is not null (+ whitespace fixes)

This commit is contained in:
Pokechu22 2015-10-24 22:56:35 -07:00
parent 77277bcf84
commit b746b5612b
2 changed files with 4 additions and 4 deletions

View file

@ -694,7 +694,7 @@ namespace MinecraftClient.Protocol.Handlers
public bool Login()
{
byte[] protocol_version = getVarInt(protocolversion);
byte[] server_adress_val = Encoding.UTF8.GetBytes(handler.GetServerHost() + "\0FML\0");
byte[] server_adress_val = Encoding.UTF8.GetBytes(handler.GetServerHost() + (forgeInfo != null ? "\0FML\0" : ""));
byte[] server_adress_len = getVarInt(server_adress_val.Length);
byte[] server_port = BitConverter.GetBytes((ushort)handler.GetServerPort()); Array.Reverse(server_port);
byte[] next_state = getVarInt(2);