fix issue with cubecraft

This commit is contained in:
olebeck 2023-01-29 23:07:42 +01:00
parent 3a5a13aa75
commit aed76d6372
7 changed files with 17 additions and 3 deletions

4
go.mod
View File

@ -6,7 +6,7 @@ go 1.19
replace github.com/sandertv/gophertunnel => github.com/olebeck/gophertunnel v1.26.2
//replace github.com/df-mc/dragonfly => ./dragonfly
replace github.com/df-mc/dragonfly => github.com/olebeck/dragonfly v0.9.1-8
replace github.com/df-mc/dragonfly => github.com/olebeck/dragonfly v0.9.1-9
require (
github.com/cloudfoundry-attic/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21
@ -24,6 +24,7 @@ require (
github.com/sandertv/gophertunnel v1.26.1
github.com/sirupsen/logrus v1.9.0
golang.design/x/lockfree v0.0.1
golang.org/x/crypto v0.5.0
golang.org/x/exp v0.0.0-20230125214544-b3c2aaf6208d
golang.org/x/image v0.3.0
golang.org/x/oauth2 v0.4.0
@ -44,7 +45,6 @@ require (
github.com/muhammadmuzzammil1998/jsonc v1.0.0 // indirect
github.com/sandertv/go-raknet v1.12.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
golang.org/x/crypto v0.5.0 // indirect
golang.org/x/mod v0.7.0 // indirect
golang.org/x/net v0.5.0 // indirect
golang.org/x/sys v0.4.0 // indirect

2
go.sum
View File

@ -74,6 +74,8 @@ github.com/olebeck/dragonfly v0.9.1-7 h1:2YECeaLboPrlC5mh8l6/W4tKhHPePmfOjjEUEXF
github.com/olebeck/dragonfly v0.9.1-7/go.mod h1:ZjzPME6I1nc73voUgr2s5lpkoTxnWuR54V6c1KbULX0=
github.com/olebeck/dragonfly v0.9.1-8 h1:93wppl6j81r6DF60IdbDn+SjdIkjeWI70SAOfjAs+L0=
github.com/olebeck/dragonfly v0.9.1-8/go.mod h1:ZjzPME6I1nc73voUgr2s5lpkoTxnWuR54V6c1KbULX0=
github.com/olebeck/dragonfly v0.9.1-9 h1:hTzWQ+TzZQOtWI1DmYHOzUvA97lppctKUqEMobuur4Y=
github.com/olebeck/dragonfly v0.9.1-9/go.mod h1:ZjzPME6I1nc73voUgr2s5lpkoTxnWuR54V6c1KbULX0=
github.com/olebeck/gophertunnel v1.26.2 h1:AbiZcmeR5LenSJ5NX/2BPxLC3ddlvgWjrjouPmOB6BA=
github.com/olebeck/gophertunnel v1.26.2/go.mod h1:dYFetA6r62huhc1EgR9p8VFAFtKOuGgVE/iXf5CzZ4o=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=

View File

@ -149,6 +149,8 @@ test_block_inv:
other: "aktiviere experimentelles Speichern des Blockinventars"
saved:
other: "Gespeichert: {{.Name}}"
empty_chunk:
other: "Leerer Chunk."
only_with_geometry:
other: "speichere nur Skins mit Geometrie"

View File

@ -149,6 +149,8 @@ test_block_inv:
other: "enable experimental block inventory saving"
saved:
other: "Saved: {{.Name}}"
empty_chunk:
other: "Empty Chunk."
only_with_geometry:
other: "only save skins with geometry"

View File

@ -149,6 +149,9 @@ test_block_inv:
other: "enable experimental bwock inventory saving"
saved:
other: "Saved: {{.Name}}"
empty_chunk:
other: "Empty Chunk."
only_with_geometry:
other: "only save skins with geometry"

View File

@ -75,7 +75,7 @@ func (c *CaptureCMD) Execute(ctx context.Context, f *flag.FlagSet, _ ...interfac
proxy := utils.NewProxy()
proxy.PacketFunc = func(header packet.Header, payload []byte, src, dst net.Addr) {
IsfromClient := dst.String() == proxy.Server.RemoteAddr().String()
IsfromClient := src.String() == proxy.Client.LocalAddr().String()
buf := bytes.NewBuffer(nil)
header.Write(buf)

View File

@ -29,6 +29,11 @@ func (w *WorldState) processLevelChunk(pk *packet.LevelChunk) {
return
}
// ignore empty chunks THANKS WEIRD SERVER SOFTWARE DEVS
if len(pk.RawPayload) == 0 {
logrus.Info(locale.Loc("empty_chunk", nil))
return
}
ch, blockNBTs, err := chunk.NetworkDecode(world.AirRID(), pk.RawPayload, int(pk.SubChunkCount), w.Dim.Range(), w.ispre118, w.bp != nil)
if err != nil {
logrus.Error(err)