Fix potential rance condition in connecting to vanilla servers as well. And move latch into client side only.
This commit is contained in:
parent
18aed8bf1b
commit
3cb3988491
2 changed files with 3 additions and 1 deletions
|
@ -834,9 +834,9 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
@Override
|
@Override
|
||||||
public void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, Set<String> channelSet, String channel, Side side)
|
public void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, Set<String> channelSet, String channel, Side side)
|
||||||
{
|
{
|
||||||
waitForPlayClient();
|
|
||||||
if (side == Side.CLIENT)
|
if (side == Side.CLIENT)
|
||||||
{
|
{
|
||||||
|
waitForPlayClient();
|
||||||
bus.post(new FMLNetworkEvent.CustomPacketRegistrationEvent<NetHandlerPlayClient>(manager, channelSet, channel, side, NetHandlerPlayClient.class));
|
bus.post(new FMLNetworkEvent.CustomPacketRegistrationEvent<NetHandlerPlayClient>(manager, channelSet, channel, side, NetHandlerPlayClient.class));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -29,6 +29,7 @@ import net.minecraft.network.play.server.S3FPacketCustomPayload;
|
||||||
import net.minecraft.network.play.server.S40PacketDisconnect;
|
import net.minecraft.network.play.server.S40PacketDisconnect;
|
||||||
import net.minecraft.server.management.ServerConfigurationManager;
|
import net.minecraft.server.management.ServerConfigurationManager;
|
||||||
import net.minecraft.util.ChatComponentText;
|
import net.minecraft.util.ChatComponentText;
|
||||||
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import cpw.mods.fml.common.FMLLog;
|
import cpw.mods.fml.common.FMLLog;
|
||||||
import cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec;
|
import cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec;
|
||||||
|
@ -448,6 +449,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||||
|
|
||||||
public void abortClientHandshake(String type)
|
public void abortClientHandshake(String type)
|
||||||
{
|
{
|
||||||
|
FMLClientHandler.instance().waitForPlayClient();
|
||||||
completeClientSideConnection(ConnectionType.valueOf(type));
|
completeClientSideConnection(ConnectionType.valueOf(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue