0.2.9, fix ProtocolViaFabricHostname, update README

This commit is contained in:
creeper123123321 2020-08-25 10:22:18 -03:00
parent 24908febbc
commit 46cc0b729f
5 changed files with 16 additions and 6 deletions

View File

@ -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
**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?:**
- 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:

View File

@ -19,7 +19,7 @@ val branch = if (!travisBranch.isNullOrBlank()) travisBranch else try {
"unknown"
}
version = "0.2.8-SNAPSHOT+" + try {
version = "0.2.9-SNAPSHOT+" + try {
gitVersion() + "-" + branch
} catch (e: Exception) {
"unknown"

View File

@ -30,7 +30,9 @@ import com.github.creeper123123321.viafabric.config.VRConfig;
import com.github.creeper123123321.viafabric.platform.VRInjector;
import com.github.creeper123123321.viafabric.platform.VRLoader;
import com.github.creeper123123321.viafabric.platform.VRPlatform;
import com.github.creeper123123321.viafabric.protocol.ViaFabricHostnameProtocol;
import com.github.creeper123123321.viafabric.util.JLoggerToLog4j;
import com.google.common.collect.Range;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.mojang.brigadier.arguments.StringArgumentType;
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.api.Via;
import us.myles.ViaVersion.api.data.MappingDataLoader;
import us.myles.ViaVersion.api.protocol.ProtocolRegistry;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@ -92,6 +95,8 @@ public class ViaFabric implements ModInitializer {
Via.getManager().init();
ProtocolRegistry.registerBaseProtocol(ViaFabricHostnameProtocol.INSTANCE, Range.lessThan(Integer.MIN_VALUE));
FabricLoader.getInstance().getEntrypoints("viafabric:via_api_initialized", Runnable.class).forEach(Runnable::run);
try {

View File

@ -25,7 +25,7 @@
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.clientside.VRDecodeHandler;
import com.github.creeper123123321.viafabric.handler.clientside.VREncodeHandler;
@ -45,7 +45,7 @@ public class MixinClientConnectionChInit {
private void onInitChannel(Channel channel, CallbackInfo ci) {
if (channel instanceof SocketChannel) {
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("decoder", CommonTransformer.HANDLER_DECODER_NAME, new VRDecodeHandler(user));

View File

@ -23,8 +23,9 @@
* 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.protocol.SimpleProtocol;
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.packets.State;
public class ProtocolViaFabricHostname extends SimpleProtocol {
public static final ProtocolViaFabricHostname INSTANCE = new ProtocolViaFabricHostname();
public class ViaFabricHostnameProtocol extends SimpleProtocol {
public static final ViaFabricHostnameProtocol INSTANCE = new ViaFabricHostnameProtocol();
@Override
protected void registerPackets() {