mirror of
https://github.com/ViaVersion/VIAaaS.git
synced 2024-11-21 11:55:15 +01:00
Fixed initial porting mistakes
This commit is contained in:
parent
4090a6eb12
commit
73fa4d249f
@ -117,7 +117,10 @@ public class AddressParser {
|
|||||||
if (protocolId == null) {
|
if (protocolId == null) {
|
||||||
protocol = ProtocolVersion.getClosest(arg.replace("_", "."));
|
protocol = ProtocolVersion.getClosest(arg.replace("_", "."));
|
||||||
} else {
|
} else {
|
||||||
protocol = ProtocolVersion.getProtocol(protocolId);
|
final ProtocolVersion ver = ProtocolVersion.getProtocol(protocolId);
|
||||||
|
if (ver.isKnown()) {
|
||||||
|
protocol = ver;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,21 +56,19 @@ object PacketRegistry {
|
|||||||
register(State.LOGIN, Direction.SERVERBOUND, ::LoginStart, Range.all(), 0)
|
register(State.LOGIN, Direction.SERVERBOUND, ::LoginStart, Range.all(), 0)
|
||||||
register(State.LOGIN, Direction.SERVERBOUND, ::CryptoResponse, Range.all(), 1)
|
register(State.LOGIN, Direction.SERVERBOUND, ::CryptoResponse, Range.all(), 1)
|
||||||
register(State.LOGIN, Direction.SERVERBOUND, ::PluginResponse, Range.atLeast(ProtocolVersion.v1_13), 2)
|
register(State.LOGIN, Direction.SERVERBOUND, ::PluginResponse, Range.atLeast(ProtocolVersion.v1_13), 2)
|
||||||
register(State.LOGIN, Direction.SERVERBOUND, ::PluginResponse, sharewareVersion.singleton, 2)
|
// register(State.LOGIN, Direction.SERVERBOUND, ::PluginResponse, sharewareVersion.singleton, 2)
|
||||||
|
|
||||||
register(State.LOGIN, Direction.CLIENTBOUND, ::LoginDisconnect, Range.all(), 0)
|
register(State.LOGIN, Direction.CLIENTBOUND, ::LoginDisconnect, Range.all(), 0)
|
||||||
register(State.LOGIN, Direction.CLIENTBOUND, ::CryptoRequest, Range.all(), 1)
|
register(State.LOGIN, Direction.CLIENTBOUND, ::CryptoRequest, Range.all(), 1)
|
||||||
register(State.LOGIN, Direction.CLIENTBOUND, ::LoginSuccess, Range.all(), 2)
|
register(State.LOGIN, Direction.CLIENTBOUND, ::LoginSuccess, Range.all(), 2)
|
||||||
register(
|
register(
|
||||||
State.LOGIN, Direction.CLIENTBOUND, ::SetCompression, mapOf(
|
State.LOGIN, Direction.CLIENTBOUND, ::SetCompression, mapOf(
|
||||||
Range.atLeast(ProtocolVersion.v1_8) to 3,
|
Range.atLeast(ProtocolVersion.v1_8) to 3
|
||||||
sharewareVersion.singleton to 3
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
register(
|
register(
|
||||||
State.LOGIN, Direction.CLIENTBOUND, ::PluginRequest, mapOf(
|
State.LOGIN, Direction.CLIENTBOUND, ::PluginRequest, mapOf(
|
||||||
Range.atLeast(ProtocolVersion.v1_13) to 4,
|
Range.atLeast(ProtocolVersion.v1_13) to 4
|
||||||
sharewareVersion.singleton to 4
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -48,7 +48,9 @@ class HandshakeState : ConnectionState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun handleNextState(handler: MinecraftHandler, packet: Handshake) {
|
private fun handleNextState(handler: MinecraftHandler, packet: Handshake) {
|
||||||
handler.data.frontVer = ProtocolVersion.getProtocol(packet.protocolId)
|
ProtocolVersion.getProtocol(packet.protocolId).apply {
|
||||||
|
if (this.isKnown) handler.data.frontVer = this
|
||||||
|
}
|
||||||
when (packet.nextState.ordinal) {
|
when (packet.nextState.ordinal) {
|
||||||
1 -> handler.data.state = StatusState()
|
1 -> handler.data.state = StatusState()
|
||||||
2 -> handler.data.state = LoginState()
|
2 -> handler.data.state = LoginState()
|
||||||
|
Loading…
Reference in New Issue
Block a user