Fix ClientMovementPredictionSync packet
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
|
|
||||||
[Connection]
|
[Connection]
|
||||||
LocalAddress = "0.0.0.0:19132"
|
LocalAddress = "0.0.0.0:19132"
|
||||||
RemoteAddress = "play.venitymc.com:19132"
|
RemoteAddress = "play.venitymc.com:19132"
|
||||||
|
|||||||
@@ -6,7 +6,10 @@ import (
|
|||||||
"github.com/sandertv/gophertunnel/minecraft/protocol/packet"
|
"github.com/sandertv/gophertunnel/minecraft/protocol/packet"
|
||||||
)
|
)
|
||||||
|
|
||||||
const ClientMovementPredictionSyncBitsetSize = 123
|
const (
|
||||||
|
ClientMovementPredictionSyncBitsetSize786 = 123
|
||||||
|
ClientMovementPredictionSyncBitsetSize898 = 124
|
||||||
|
)
|
||||||
|
|
||||||
// ClientMovementPredictionSync is sent by the client to the server periodically if the client has received
|
// ClientMovementPredictionSync is sent by the client to the server periodically if the client has received
|
||||||
// movement corrections from the server, containing information about client-predictions that are relevant
|
// movement corrections from the server, containing information about client-predictions that are relevant
|
||||||
@@ -45,11 +48,19 @@ func (*ClientMovementPredictionSync) ID() uint32 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (pk *ClientMovementPredictionSync) Marshal(io protocol.IO) {
|
func (pk *ClientMovementPredictionSync) Marshal(io protocol.IO) {
|
||||||
if proto.IsProtoGTE(io, proto.ID786) {
|
var bitsetSize int
|
||||||
io.Bitset(&pk.ActorFlags, ClientMovementPredictionSyncBitsetSize)
|
if proto.IsProtoGTE(io, proto.ID898) {
|
||||||
|
bitsetSize = 127
|
||||||
|
} else if proto.IsProtoGTE(io, proto.ID844) {
|
||||||
|
bitsetSize = 126
|
||||||
|
} else if proto.IsProtoGTE(io, proto.ID818) {
|
||||||
|
bitsetSize = 125
|
||||||
|
} else if proto.IsProtoGTE(io, proto.ID786) {
|
||||||
|
bitsetSize = 123
|
||||||
} else {
|
} else {
|
||||||
io.Bitset(&pk.ActorFlags, 120)
|
bitsetSize = 120
|
||||||
}
|
}
|
||||||
|
io.Bitset(&pk.ActorFlags, bitsetSize)
|
||||||
io.Float32(&pk.BoundingBoxScale)
|
io.Float32(&pk.BoundingBoxScale)
|
||||||
io.Float32(&pk.BoundingBoxWidth)
|
io.Float32(&pk.BoundingBoxWidth)
|
||||||
io.Float32(&pk.BoundingBoxHeight)
|
io.Float32(&pk.BoundingBoxHeight)
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ func (c *Command) Marshal(r protocol.IO) {
|
|||||||
if IsProtoGTE(r, ID898) {
|
if IsProtoGTE(r, ID898) {
|
||||||
r.String(&c.PermissionLevel)
|
r.String(&c.PermissionLevel)
|
||||||
} else {
|
} else {
|
||||||
permLevel := uint8(0)
|
permLevel := byte(0)
|
||||||
r.Uint8(&permLevel)
|
r.Uint8(&permLevel)
|
||||||
c.PermissionLevel = "any"
|
c.PermissionLevel = "any"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user