mirror of
https://github.com/ViaVersion/ViaFabric.git
synced 2024-12-20 16:07:36 +01:00
0.2.9, fix ProtocolViaFabricHostname, update README
This commit is contained in:
parent
24908febbc
commit
46cc0b729f
@ -89,6 +89,10 @@ Adding [ViaBackwards](https://viaversion.com/backwards) (and optionally [ViaRewi
|
|||||||
- You can disable it by resetting the anti-cheat warning in config file or by setting protocol version to -1
|
- You can disable it by resetting the anti-cheat warning in config file or by setting protocol version to -1
|
||||||
|
|
||||||
|
|
||||||
|
**How can I set the version for specific servers?:**
|
||||||
|
- Append ._v(VERSION).viafabric. Example: ``minigame.example.com._v1_8.viafabric``, ``native.example.com._v-1.viafabric``
|
||||||
|
|
||||||
|
|
||||||
**Does it work with multiconnect at same time on client?:**
|
**Does it work with multiconnect at same time on client?:**
|
||||||
- Yes, ViaFabric can be used with multiconnect. ViaFabric will send to their version auto detector their closest supported version. (multiconnect beta-supported versions (currently 1.10) aren't used)
|
- Yes, ViaFabric can be used with multiconnect. ViaFabric will send to their version auto detector their closest supported version. (multiconnect beta-supported versions (currently 1.10) aren't used)
|
||||||
- Example of setups:
|
- Example of setups:
|
||||||
|
@ -19,7 +19,7 @@ val branch = if (!travisBranch.isNullOrBlank()) travisBranch else try {
|
|||||||
"unknown"
|
"unknown"
|
||||||
}
|
}
|
||||||
|
|
||||||
version = "0.2.8-SNAPSHOT+" + try {
|
version = "0.2.9-SNAPSHOT+" + try {
|
||||||
gitVersion() + "-" + branch
|
gitVersion() + "-" + branch
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
"unknown"
|
"unknown"
|
||||||
|
@ -30,7 +30,9 @@ import com.github.creeper123123321.viafabric.config.VRConfig;
|
|||||||
import com.github.creeper123123321.viafabric.platform.VRInjector;
|
import com.github.creeper123123321.viafabric.platform.VRInjector;
|
||||||
import com.github.creeper123123321.viafabric.platform.VRLoader;
|
import com.github.creeper123123321.viafabric.platform.VRLoader;
|
||||||
import com.github.creeper123123321.viafabric.platform.VRPlatform;
|
import com.github.creeper123123321.viafabric.platform.VRPlatform;
|
||||||
|
import com.github.creeper123123321.viafabric.protocol.ViaFabricHostnameProtocol;
|
||||||
import com.github.creeper123123321.viafabric.util.JLoggerToLog4j;
|
import com.github.creeper123123321.viafabric.util.JLoggerToLog4j;
|
||||||
|
import com.google.common.collect.Range;
|
||||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||||
@ -46,6 +48,7 @@ import org.apache.logging.log4j.LogManager;
|
|||||||
import us.myles.ViaVersion.ViaManager;
|
import us.myles.ViaVersion.ViaManager;
|
||||||
import us.myles.ViaVersion.api.Via;
|
import us.myles.ViaVersion.api.Via;
|
||||||
import us.myles.ViaVersion.api.data.MappingDataLoader;
|
import us.myles.ViaVersion.api.data.MappingDataLoader;
|
||||||
|
import us.myles.ViaVersion.api.protocol.ProtocolRegistry;
|
||||||
|
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
@ -92,6 +95,8 @@ public class ViaFabric implements ModInitializer {
|
|||||||
|
|
||||||
Via.getManager().init();
|
Via.getManager().init();
|
||||||
|
|
||||||
|
ProtocolRegistry.registerBaseProtocol(ViaFabricHostnameProtocol.INSTANCE, Range.lessThan(Integer.MIN_VALUE));
|
||||||
|
|
||||||
FabricLoader.getInstance().getEntrypoints("viafabric:via_api_initialized", Runnable.class).forEach(Runnable::run);
|
FabricLoader.getInstance().getEntrypoints("viafabric:via_api_initialized", Runnable.class).forEach(Runnable::run);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
package com.github.creeper123123321.viafabric.mixin.client;
|
package com.github.creeper123123321.viafabric.mixin.client;
|
||||||
|
|
||||||
import com.github.creeper123123321.viafabric.ProtocolViaFabricHostname;
|
import com.github.creeper123123321.viafabric.protocol.ViaFabricHostnameProtocol;
|
||||||
import com.github.creeper123123321.viafabric.handler.CommonTransformer;
|
import com.github.creeper123123321.viafabric.handler.CommonTransformer;
|
||||||
import com.github.creeper123123321.viafabric.handler.clientside.VRDecodeHandler;
|
import com.github.creeper123123321.viafabric.handler.clientside.VRDecodeHandler;
|
||||||
import com.github.creeper123123321.viafabric.handler.clientside.VREncodeHandler;
|
import com.github.creeper123123321.viafabric.handler.clientside.VREncodeHandler;
|
||||||
@ -45,7 +45,7 @@ public class MixinClientConnectionChInit {
|
|||||||
private void onInitChannel(Channel channel, CallbackInfo ci) {
|
private void onInitChannel(Channel channel, CallbackInfo ci) {
|
||||||
if (channel instanceof SocketChannel) {
|
if (channel instanceof SocketChannel) {
|
||||||
UserConnection user = new VRClientSideUserConnection(channel);
|
UserConnection user = new VRClientSideUserConnection(channel);
|
||||||
new ProtocolPipeline(user).add(ProtocolViaFabricHostname.INSTANCE);
|
new ProtocolPipeline(user).add(ViaFabricHostnameProtocol.INSTANCE);
|
||||||
|
|
||||||
channel.pipeline().addBefore("encoder", CommonTransformer.HANDLER_ENCODER_NAME, new VREncodeHandler(user));
|
channel.pipeline().addBefore("encoder", CommonTransformer.HANDLER_ENCODER_NAME, new VREncodeHandler(user));
|
||||||
channel.pipeline().addBefore("decoder", CommonTransformer.HANDLER_DECODER_NAME, new VRDecodeHandler(user));
|
channel.pipeline().addBefore("decoder", CommonTransformer.HANDLER_DECODER_NAME, new VRDecodeHandler(user));
|
||||||
|
@ -23,8 +23,9 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.github.creeper123123321.viafabric;
|
package com.github.creeper123123321.viafabric.protocol;
|
||||||
|
|
||||||
|
import com.github.creeper123123321.viafabric.ViaFabricAddress;
|
||||||
import us.myles.ViaVersion.api.PacketWrapper;
|
import us.myles.ViaVersion.api.PacketWrapper;
|
||||||
import us.myles.ViaVersion.api.protocol.SimpleProtocol;
|
import us.myles.ViaVersion.api.protocol.SimpleProtocol;
|
||||||
import us.myles.ViaVersion.api.remapper.PacketRemapper;
|
import us.myles.ViaVersion.api.remapper.PacketRemapper;
|
||||||
@ -32,8 +33,8 @@ import us.myles.ViaVersion.api.remapper.ValueTransformer;
|
|||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
import us.myles.ViaVersion.packets.State;
|
import us.myles.ViaVersion.packets.State;
|
||||||
|
|
||||||
public class ProtocolViaFabricHostname extends SimpleProtocol {
|
public class ViaFabricHostnameProtocol extends SimpleProtocol {
|
||||||
public static final ProtocolViaFabricHostname INSTANCE = new ProtocolViaFabricHostname();
|
public static final ViaFabricHostnameProtocol INSTANCE = new ViaFabricHostnameProtocol();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void registerPackets() {
|
protected void registerPackets() {
|
Loading…
Reference in New Issue
Block a user