mirror of
https://github.com/ViaVersion/ViaForge.git
synced 2024-11-23 12:15:25 +01:00
Rename ViaForgeCommon attribute keys
This commit is contained in:
parent
b23a86b6ad
commit
9cde68c619
@ -43,8 +43,8 @@ import java.io.File;
|
|||||||
*/
|
*/
|
||||||
public class ViaForgeCommon {
|
public class ViaForgeCommon {
|
||||||
|
|
||||||
public static final AttributeKey<UserConnection> LOCAL_VIA_USER = AttributeKey.valueOf("local_via_user");
|
public static final AttributeKey<UserConnection> VF_VIA_USER = AttributeKey.valueOf("viaforge_via_user");
|
||||||
public static final AttributeKey<VFNetworkManager> VF_NETWORK_MANAGER = AttributeKey.valueOf("encryption_setup");
|
public static final AttributeKey<VFNetworkManager> VF_NETWORK_MANAGER = AttributeKey.valueOf("viaforge_network_manager");
|
||||||
|
|
||||||
private static ViaForgeCommon manager;
|
private static ViaForgeCommon manager;
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ public class ViaForgeCommon {
|
|||||||
final UserConnection user = new UserConnectionImpl(channel, true);
|
final UserConnection user = new UserConnectionImpl(channel, true);
|
||||||
new ProtocolPipelineImpl(user);
|
new ProtocolPipelineImpl(user);
|
||||||
|
|
||||||
channel.attr(LOCAL_VIA_USER).set(user);
|
channel.attr(VF_VIA_USER).set(user);
|
||||||
|
|
||||||
channel.pipeline().addLast(new ViaForgeVLLegacyPipeline(user, targetVersion));
|
channel.pipeline().addLast(new ViaForgeVLLegacyPipeline(user, targetVersion));
|
||||||
channel.closeFuture().addListener(future -> {
|
channel.closeFuture().addListener(future -> {
|
||||||
|
@ -44,7 +44,7 @@ public class MixinNetHandlerLoginClient {
|
|||||||
public void onlyJoinServerIfPremium(MinecraftSessionService instance, GameProfile profile, String authenticationToken, String serverId) throws AuthenticationException {
|
public void onlyJoinServerIfPremium(MinecraftSessionService instance, GameProfile profile, String authenticationToken, String serverId) throws AuthenticationException {
|
||||||
final VFNetworkManager mixinNetworkManager = (VFNetworkManager) networkManager;
|
final VFNetworkManager mixinNetworkManager = (VFNetworkManager) networkManager;
|
||||||
if (mixinNetworkManager.viaForge$getTrackedVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
|
if (mixinNetworkManager.viaForge$getTrackedVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
|
||||||
final UserConnection user = networkManager.channel().attr(ViaForgeCommon.LOCAL_VIA_USER).get();
|
final UserConnection user = networkManager.channel().attr(ViaForgeCommon.VF_VIA_USER).get();
|
||||||
if (user != null && user.has(ProtocolMetadataStorage.class) && !user.get(ProtocolMetadataStorage.class).authenticate) {
|
if (user != null && user.has(ProtocolMetadataStorage.class) && !user.get(ProtocolMetadataStorage.class).authenticate) {
|
||||||
// We are in the 1.7 -> 1.6 protocol, so we need to skip the joinServer call
|
// We are in the 1.7 -> 1.6 protocol, so we need to skip the joinServer call
|
||||||
// if the server is in offline mode, due the packet changes <-> networking changes
|
// if the server is in offline mode, due the packet changes <-> networking changes
|
||||||
|
@ -44,7 +44,7 @@ public class MixinClientLoginNetHandler {
|
|||||||
public void onlyJoinServerIfPremium(MinecraftSessionService instance, GameProfile profile, String authenticationToken, String serverId) throws AuthenticationException {
|
public void onlyJoinServerIfPremium(MinecraftSessionService instance, GameProfile profile, String authenticationToken, String serverId) throws AuthenticationException {
|
||||||
final VFNetworkManager mixinConnection = (VFNetworkManager) connection;
|
final VFNetworkManager mixinConnection = (VFNetworkManager) connection;
|
||||||
if (mixinConnection.viaForge$getTrackedVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
|
if (mixinConnection.viaForge$getTrackedVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
|
||||||
final UserConnection user = connection.channel().attr(ViaForgeCommon.LOCAL_VIA_USER).get();
|
final UserConnection user = connection.channel().attr(ViaForgeCommon.VF_VIA_USER).get();
|
||||||
if (user != null && user.has(ProtocolMetadataStorage.class) && !user.get(ProtocolMetadataStorage.class).authenticate) {
|
if (user != null && user.has(ProtocolMetadataStorage.class) && !user.get(ProtocolMetadataStorage.class).authenticate) {
|
||||||
// We are in the 1.7 -> 1.6 protocol, so we need to skip the joinServer call
|
// We are in the 1.7 -> 1.6 protocol, so we need to skip the joinServer call
|
||||||
// if the server is in offline mode, due the packet changes <-> networking changes
|
// if the server is in offline mode, due the packet changes <-> networking changes
|
||||||
|
@ -44,7 +44,7 @@ public class MixinClientHandshakePacketListenerImpl {
|
|||||||
public void onlyJoinServerIfPremium(MinecraftSessionService instance, GameProfile profile, String authenticationToken, String serverId) throws AuthenticationException {
|
public void onlyJoinServerIfPremium(MinecraftSessionService instance, GameProfile profile, String authenticationToken, String serverId) throws AuthenticationException {
|
||||||
final VFNetworkManager mixinConnection = (VFNetworkManager) connection;
|
final VFNetworkManager mixinConnection = (VFNetworkManager) connection;
|
||||||
if (mixinConnection.viaForge$getTrackedVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
|
if (mixinConnection.viaForge$getTrackedVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
|
||||||
final UserConnection user = connection.channel().attr(ViaForgeCommon.LOCAL_VIA_USER).get();
|
final UserConnection user = connection.channel().attr(ViaForgeCommon.VF_VIA_USER).get();
|
||||||
if (user != null && user.has(ProtocolMetadataStorage.class) && !user.get(ProtocolMetadataStorage.class).authenticate) {
|
if (user != null && user.has(ProtocolMetadataStorage.class) && !user.get(ProtocolMetadataStorage.class).authenticate) {
|
||||||
// We are in the 1.7 -> 1.6 protocol, so we need to skip the joinServer call
|
// We are in the 1.7 -> 1.6 protocol, so we need to skip the joinServer call
|
||||||
// if the server is in offline mode, due the packet changes <-> networking changes
|
// if the server is in offline mode, due the packet changes <-> networking changes
|
||||||
|
@ -44,7 +44,7 @@ public class MixinClientHandshakePacketListenerImpl {
|
|||||||
public void onlyJoinServerIfPremium(MinecraftSessionService instance, GameProfile profile, String authenticationToken, String serverId) throws AuthenticationException {
|
public void onlyJoinServerIfPremium(MinecraftSessionService instance, GameProfile profile, String authenticationToken, String serverId) throws AuthenticationException {
|
||||||
final VFNetworkManager mixinConnection = (VFNetworkManager) connection;
|
final VFNetworkManager mixinConnection = (VFNetworkManager) connection;
|
||||||
if (mixinConnection.viaForge$getTrackedVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
|
if (mixinConnection.viaForge$getTrackedVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
|
||||||
final UserConnection user = connection.channel().attr(ViaForgeCommon.LOCAL_VIA_USER).get();
|
final UserConnection user = connection.channel().attr(ViaForgeCommon.VF_VIA_USER).get();
|
||||||
if (user != null && user.has(ProtocolMetadataStorage.class) && !user.get(ProtocolMetadataStorage.class).authenticate) {
|
if (user != null && user.has(ProtocolMetadataStorage.class) && !user.get(ProtocolMetadataStorage.class).authenticate) {
|
||||||
// We are in the 1.7 -> 1.6 protocol, so we need to skip the joinServer call
|
// We are in the 1.7 -> 1.6 protocol, so we need to skip the joinServer call
|
||||||
// if the server is in offline mode, due the packet changes <-> networking changes
|
// if the server is in offline mode, due the packet changes <-> networking changes
|
||||||
|
@ -44,7 +44,7 @@ public class MixinClientHandshakePacketListenerImpl {
|
|||||||
public void onlyJoinServerIfPremium(MinecraftSessionService instance, GameProfile profile, String authenticationToken, String serverId) throws AuthenticationException {
|
public void onlyJoinServerIfPremium(MinecraftSessionService instance, GameProfile profile, String authenticationToken, String serverId) throws AuthenticationException {
|
||||||
final VFNetworkManager mixinConnection = (VFNetworkManager) connection;
|
final VFNetworkManager mixinConnection = (VFNetworkManager) connection;
|
||||||
if (mixinConnection.viaForge$getTrackedVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
|
if (mixinConnection.viaForge$getTrackedVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
|
||||||
final UserConnection user = connection.channel().attr(ViaForgeCommon.LOCAL_VIA_USER).get();
|
final UserConnection user = connection.channel().attr(ViaForgeCommon.VF_VIA_USER).get();
|
||||||
if (user != null && user.has(ProtocolMetadataStorage.class) && !user.get(ProtocolMetadataStorage.class).authenticate) {
|
if (user != null && user.has(ProtocolMetadataStorage.class) && !user.get(ProtocolMetadataStorage.class).authenticate) {
|
||||||
// We are in the 1.7 -> 1.6 protocol, so we need to skip the joinServer call
|
// We are in the 1.7 -> 1.6 protocol, so we need to skip the joinServer call
|
||||||
// if the server is in offline mode, due the packet changes <-> networking changes
|
// if the server is in offline mode, due the packet changes <-> networking changes
|
||||||
|
@ -44,7 +44,7 @@ public class MixinClientHandshakePacketListenerImpl {
|
|||||||
public void onlyJoinServerIfPremium(MinecraftSessionService instance, GameProfile profile, String authenticationToken, String serverId) throws AuthenticationException {
|
public void onlyJoinServerIfPremium(MinecraftSessionService instance, GameProfile profile, String authenticationToken, String serverId) throws AuthenticationException {
|
||||||
final VFNetworkManager mixinConnection = (VFNetworkManager) connection;
|
final VFNetworkManager mixinConnection = (VFNetworkManager) connection;
|
||||||
if (mixinConnection.viaForge$getTrackedVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
|
if (mixinConnection.viaForge$getTrackedVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
|
||||||
final UserConnection user = connection.channel().attr(ViaForgeCommon.LOCAL_VIA_USER).get();
|
final UserConnection user = connection.channel().attr(ViaForgeCommon.VF_VIA_USER).get();
|
||||||
if (user != null && user.has(ProtocolMetadataStorage.class) && !user.get(ProtocolMetadataStorage.class).authenticate) {
|
if (user != null && user.has(ProtocolMetadataStorage.class) && !user.get(ProtocolMetadataStorage.class).authenticate) {
|
||||||
// We are in the 1.7 -> 1.6 protocol, so we need to skip the joinServer call
|
// We are in the 1.7 -> 1.6 protocol, so we need to skip the joinServer call
|
||||||
// if the server is in offline mode, due the packet changes <-> networking changes
|
// if the server is in offline mode, due the packet changes <-> networking changes
|
||||||
|
@ -45,7 +45,7 @@ public class MixinClientHandshakePacketListenerImpl {
|
|||||||
public void onlyJoinServerIfPremium(MinecraftSessionService instance, UUID uuid, String authenticationToken, String serverId) throws AuthenticationException {
|
public void onlyJoinServerIfPremium(MinecraftSessionService instance, UUID uuid, String authenticationToken, String serverId) throws AuthenticationException {
|
||||||
final VFNetworkManager mixinConnection = (VFNetworkManager) connection;
|
final VFNetworkManager mixinConnection = (VFNetworkManager) connection;
|
||||||
if (mixinConnection.viaForge$getTrackedVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
|
if (mixinConnection.viaForge$getTrackedVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
|
||||||
final UserConnection user = connection.channel().attr(ViaForgeCommon.LOCAL_VIA_USER).get();
|
final UserConnection user = connection.channel().attr(ViaForgeCommon.VF_VIA_USER).get();
|
||||||
if (user != null && user.has(ProtocolMetadataStorage.class) && !user.get(ProtocolMetadataStorage.class).authenticate) {
|
if (user != null && user.has(ProtocolMetadataStorage.class) && !user.get(ProtocolMetadataStorage.class).authenticate) {
|
||||||
// We are in the 1.7 -> 1.6 protocol, so we need to skip the joinServer call
|
// We are in the 1.7 -> 1.6 protocol, so we need to skip the joinServer call
|
||||||
// if the server is in offline mode, due the packet changes <-> networking changes
|
// if the server is in offline mode, due the packet changes <-> networking changes
|
||||||
|
Loading…
Reference in New Issue
Block a user