Package net.minecraftforge.network
Class NetworkContext
java.lang.Object
net.minecraftforge.network.NetworkContext
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final io.netty.util.AttributeKey
<NetworkContext> (package private) Map
<ResourceLocation, Integer> private final Connection
private static final String
(package private) NetworkContext.NetworkMismatchData
(package private) Map
<String, ModVersions.Info> private Map
<String, ModVersions.Info> static final int
private int
(package private) Set
<ResourceLocation> private Set
<ResourceLocation> (package private) Set
<ResourceLocation> private ConnectionType
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
enhanceHostName
(String hostName) This is a hint that we are a modded client, This is sent in the first packet the client sends to the server.void
static NetworkContext
get
(Connection connection) Gets the associated NetworkContext from the connection, creating a new instance if necessary.A list of mods and their verisons reported by the other side of the connection.int
getType()
void
processIntention
(String hostName) (package private) void
-
Field Details
-
MARKER
- See Also:
-
NET_VERSION
public static final int NET_VERSION- See Also:
-
CHANNEL_KEY
-
connection
-
type
-
netVersion
private int netVersion -
remoteChannels
-
remoteChannelsView
-
sentChannels
-
modList
-
modListView
-
channelList
-
mismatchData
-
-
Constructor Details
-
NetworkContext
-
-
Method Details
-
get
Gets the associated NetworkContext from the connection, creating a new instance if necessary. -
getType
-
getNetVersion
public int getNetVersion() -
getRemoteChannels
-
getModList
A list of mods and their verisons reported by the other side of the connection. The remote side can and does lie about this, so not rely on it for any anti-cheat system. -
enhanceHostName
This is a hint that we are a modded client, This is sent in the first packet the client sends to the server. Unfortunately we do not have a modder facing value in this packet, so we have a long standing tradition of encoding it on the hostName field, which is a UTF string. Forge treats this string a null terminated list. With our value being anywhere in the list. Our identifier is currently FORGE, Optionally followed by a number indicating the network version. If the version is missing, we assume 0. TODO: Move out of the Intention packet and into a immediately sent Login custom payload? Which should arrive before we get to config stage? -
processIntention
-
finishTask
-
getMismatchs
-
setConnectionType
-