Tweak so that writing to the context will automatically send a message back to
the originator in handshakeestablished.
This commit is contained in:
parent
be8d33070e
commit
5d811025a7
|
@ -36,6 +36,7 @@ import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import cpw.mods.fml.common.FMLLog;
|
import cpw.mods.fml.common.FMLLog;
|
||||||
import cpw.mods.fml.common.ModContainer;
|
import cpw.mods.fml.common.ModContainer;
|
||||||
import cpw.mods.fml.common.discovery.ASMDataTable;
|
import cpw.mods.fml.common.discovery.ASMDataTable;
|
||||||
|
import cpw.mods.fml.common.network.FMLOutboundHandler.OutboundTarget;
|
||||||
import cpw.mods.fml.common.network.handshake.NetworkDispatcher;
|
import cpw.mods.fml.common.network.handshake.NetworkDispatcher;
|
||||||
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
|
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
|
||||||
import cpw.mods.fml.common.network.internal.NetworkModHolder;
|
import cpw.mods.fml.common.network.internal.NetworkModHolder;
|
||||||
|
@ -311,6 +312,8 @@ public enum NetworkRegistry
|
||||||
NetworkHandshakeEstablished handshake = new NetworkHandshakeEstablished(networkDispatcher, networkDispatcher.getNetHandler(), origin);
|
NetworkHandshakeEstablished handshake = new NetworkHandshakeEstablished(networkDispatcher, networkDispatcher.getNetHandler(), origin);
|
||||||
for (Entry<String, FMLEmbeddedChannel> channel : channels.get(origin).entrySet())
|
for (Entry<String, FMLEmbeddedChannel> channel : channels.get(origin).entrySet())
|
||||||
{
|
{
|
||||||
|
channel.getValue().attr(FMLOutboundHandler.FML_MESSAGETARGET).set(OutboundTarget.DISPATCHER);
|
||||||
|
channel.getValue().attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(networkDispatcher);
|
||||||
channel.getValue().pipeline().fireUserEventTriggered(handshake);
|
channel.getValue().pipeline().fireUserEventTriggered(handshake);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue