fix water rendering
This commit is contained in:
parent
da6312945e
commit
239c0c2d4f
10
go.mod
10
go.mod
|
@ -5,6 +5,7 @@ go 1.19
|
|||
require (
|
||||
github.com/df-mc/dragonfly v0.8.1
|
||||
github.com/df-mc/goleveldb v1.1.9
|
||||
github.com/flytam/filenamify v1.1.1
|
||||
github.com/go-gl/mathgl v1.0.0
|
||||
github.com/google/gopacket v1.1.19
|
||||
github.com/google/subcommands v1.2.0
|
||||
|
@ -12,7 +13,12 @@ require (
|
|||
github.com/sandertv/gophertunnel v1.24.5
|
||||
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e
|
||||
golang.org/x/oauth2 v0.0.0-20220808172628-8227340efae7
|
||||
github.com/flytam/filenamify v1.1.1
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/fatih/color v1.13.0 // indirect
|
||||
github.com/mattn/go-colorable v0.1.9 // indirect
|
||||
github.com/mattn/go-isatty v0.0.14 // indirect
|
||||
)
|
||||
|
||||
//replace github.com/sandertv/gophertunnel => ./gophertunnel
|
||||
|
@ -23,7 +29,7 @@ require (
|
|||
|
||||
replace github.com/sandertv/gophertunnel => github.com/olebeck/gophertunnel v1.24.8-4
|
||||
|
||||
replace github.com/df-mc/dragonfly => github.com/olebeck/dragonfly v0.8.3-0.20220902161600-2f9b3652bbb7
|
||||
replace github.com/df-mc/dragonfly => github.com/olebeck/dragonfly v0.8.3-2
|
||||
|
||||
require (
|
||||
github.com/brentp/intintmap v0.0.0-20190211203843-30dc0ade9af9 // indirect
|
||||
|
|
10
go.sum
10
go.sum
|
@ -7,6 +7,8 @@ github.com/df-mc/atomic v1.10.0 h1:0ZuxBKwR/hxcFGorKiHIp+hY7hgY+XBTzhCYD2NqSEg=
|
|||
github.com/df-mc/atomic v1.10.0/go.mod h1:Gw9rf+rPIbydMjA329Jn4yjd/O2c/qusw3iNp4tFGSc=
|
||||
github.com/df-mc/goleveldb v1.1.9 h1:ihdosZyy5jkQKrxucTQmN90jq/2lUwQnJZjIYIC/9YU=
|
||||
github.com/df-mc/goleveldb v1.1.9/go.mod h1:+NHCup03Sci5q84APIA21z3iPZCuk6m6ABtg4nANCSk=
|
||||
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
|
||||
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
|
||||
github.com/flytam/filenamify v1.1.1 h1:508gP8QR6vtbv46S3oz2ob9l7JGFdDFfqqMeh/TwzTk=
|
||||
github.com/flytam/filenamify v1.1.1/go.mod h1:Dzf9kVycwcsBlr2ATg6uxjqiFgKGH+5SKFuhdeP5zu8=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
|
@ -35,6 +37,11 @@ github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S
|
|||
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
||||
github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY=
|
||||
github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
|
||||
github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U=
|
||||
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
|
||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||
github.com/miekg/dns v1.1.50 h1:DQUfb9uc6smULcREF09Uc+/Gd46YWqJd5DbpPE9xkcA=
|
||||
github.com/miekg/dns v1.1.50/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME=
|
||||
github.com/muhammadmuzzammil1998/jsonc v1.0.0 h1:8o5gBQn4ZA3NBA9DlTujCj2a4w0tqWrPVjDwhzkgTIs=
|
||||
|
@ -45,6 +52,7 @@ github.com/olebeck/dragonfly v0.8.2-6 h1:h7GoXbNMS1OTOfm/QK7QQ3VF4By5Scfk/7Sd0LJ
|
|||
github.com/olebeck/dragonfly v0.8.2-6/go.mod h1:xgpCDhHoP03RygPaTrzzDwsSTcEZhxNPMV3CAxETj+I=
|
||||
github.com/olebeck/dragonfly v0.8.3-0.20220902161600-2f9b3652bbb7 h1:/JD6mWd0/hPcCEvLNB/GGJhqhMBHYV1Hce5vyM9Wy2s=
|
||||
github.com/olebeck/dragonfly v0.8.3-0.20220902161600-2f9b3652bbb7/go.mod h1:ObfYlB77fxGLqU2CLquvk8ibAEMYoixiXfs7pxrOGCI=
|
||||
github.com/olebeck/dragonfly v0.8.3-2/go.mod h1:ObfYlB77fxGLqU2CLquvk8ibAEMYoixiXfs7pxrOGCI=
|
||||
github.com/olebeck/gophertunnel v1.24.6 h1:Mnpzk9e+eMdfx/wbEsmwQabEbalNzFRu+3iMEBzaVSg=
|
||||
github.com/olebeck/gophertunnel v1.24.6/go.mod h1:dMOw79FHxr2azEqiGH20AwdljisAN1kqwu5SjPBnZ5k=
|
||||
github.com/olebeck/gophertunnel v1.24.7 h1:EMYLDMxGxzPtoI/Y77KHPcfelkGS+QcjdtStGIqtYFE=
|
||||
|
@ -107,6 +115,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ
|
|||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
|
|
|
@ -47,8 +47,7 @@ func (c *SkinProxyCMD) Execute(ctx context.Context, f *flag.FlagSet, _ ...interf
|
|||
return pk, nil
|
||||
}
|
||||
|
||||
err = proxy.Run(ctx, address)
|
||||
if err != nil {
|
||||
if err := proxy.Run(ctx, address); err != nil {
|
||||
logrus.Error(err)
|
||||
return 1
|
||||
}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 513 B |
|
@ -12,25 +12,35 @@ import (
|
|||
"github.com/df-mc/dragonfly/server/world/chunk"
|
||||
)
|
||||
|
||||
func blockColorAt(c *chunk.Chunk, x uint8, y int16, z uint8) color.RGBA {
|
||||
col := color.RGBA{0, 0, 0, 255}
|
||||
block_rid := c.Block(x, y, z, 0)
|
||||
if block_rid == 0 && y == 0 { // void
|
||||
col = color.RGBA{0, 0, 0, 255}
|
||||
func blockColorAt(c *chunk.Chunk, x uint8, y int16, z uint8) (blockColor color.RGBA) {
|
||||
blockColor = color.RGBA{255, 0, 255, 255}
|
||||
rid := c.Block(x, y, z, 0)
|
||||
if rid == 0 && y == 0 { // void
|
||||
blockColor = color.RGBA{0, 0, 0, 255}
|
||||
} else {
|
||||
b, found := world.BlockByRuntimeID(block_rid)
|
||||
b, found := world.BlockByRuntimeID(rid)
|
||||
if found {
|
||||
col = b.Color()
|
||||
if _, ok := b.(block.Water); ok {
|
||||
y2 := c.HeightMap().At(x, z)
|
||||
blockColor = blockColorAt(c, x, y2, z)
|
||||
depth := y - y2
|
||||
|
||||
bw := (&block.Water{}).Color()
|
||||
bw.A = uint8(utils.Clamp(int(150+depth*7), 255))
|
||||
blockColor = utils.BlendColors(blockColor, bw)
|
||||
} else {
|
||||
blockColor = b.Color()
|
||||
}
|
||||
}
|
||||
/*
|
||||
if col.R == 255 && col.B == 255 {
|
||||
if blockColor.R == 0 || blockColor.R == 255 && blockColor.B == 255 {
|
||||
name, nbt := b.EncodeBlock()
|
||||
fmt.Printf("unknown color %d %s %s %s\n", block_rid, reflect.TypeOf(b), name, nbt)
|
||||
fmt.Printf("unknown color %d %s %s %s\n", rid, reflect.TypeOf(b), name, nbt)
|
||||
b.Color()
|
||||
}
|
||||
*/
|
||||
}
|
||||
return col
|
||||
return blockColor
|
||||
}
|
||||
|
||||
func chunkGetColorAt(c *chunk.Chunk, x uint8, y int16, z uint8) color.RGBA {
|
||||
|
@ -71,22 +81,12 @@ func chunkGetColorAt(c *chunk.Chunk, x uint8, y int16, z uint8) color.RGBA {
|
|||
|
||||
func Chunk2Img(c *chunk.Chunk) *image.RGBA {
|
||||
img := image.NewRGBA(image.Rect(0, 0, 16, 16))
|
||||
hm := c.HeightMap()
|
||||
hml := c.LiquidHeightMap()
|
||||
hm := c.HeightMapWithWater()
|
||||
|
||||
for x := uint8(0); x < 16; x++ {
|
||||
for z := uint8(0); z < 16; z++ {
|
||||
height := hm.At(x, z)
|
||||
height_liquid := hml.At(x, z)
|
||||
|
||||
col := chunkGetColorAt(c, x, height, z)
|
||||
|
||||
if height_liquid > height {
|
||||
bw := (&block.Water{}).Color()
|
||||
bw.A = uint8(utils.Clamp(int(127+(height_liquid-height)*5), 255))
|
||||
col = utils.BlendColors(col, bw)
|
||||
}
|
||||
|
||||
img.SetRGBA(int(x), int(z), col)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package world
|
||||
|
||||
import (
|
||||
"image/png"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
|
@ -8,6 +9,15 @@ import (
|
|||
"github.com/df-mc/dragonfly/server/world/chunk"
|
||||
)
|
||||
|
||||
func Test(t *testing.T) {
|
||||
data, _ := os.ReadFile("chunk.bin")
|
||||
ch, _, _ := chunk.NetworkDecode(33, data, 6, cube.Range{0, 255}, true)
|
||||
i := Chunk2Img(ch)
|
||||
f, _ := os.Create("chunk.png")
|
||||
png.Encode(f, i)
|
||||
f.Close()
|
||||
}
|
||||
|
||||
func Benchmark_chunk_decode(b *testing.B) {
|
||||
data, _ := os.ReadFile("chunk.bin")
|
||||
for i := 0; i < b.N; i++ {
|
||||
|
|
|
@ -8,7 +8,6 @@ import (
|
|||
"hash/crc32"
|
||||
"image"
|
||||
"image/draw"
|
||||
"log"
|
||||
"os"
|
||||
"path"
|
||||
"strconv"
|
||||
|
@ -103,16 +102,16 @@ func init() {
|
|||
}
|
||||
|
||||
type WorldCMD struct {
|
||||
server_address string
|
||||
packs bool
|
||||
enableVoid bool
|
||||
Address string
|
||||
packs bool
|
||||
enableVoid bool
|
||||
}
|
||||
|
||||
func (*WorldCMD) Name() string { return "worlds" }
|
||||
func (*WorldCMD) Synopsis() string { return "download a world from a server" }
|
||||
|
||||
func (p *WorldCMD) SetFlags(f *flag.FlagSet) {
|
||||
f.StringVar(&p.server_address, "address", "", "remote server address")
|
||||
f.StringVar(&p.Address, "address", "", "remote server address")
|
||||
f.BoolVar(&p.packs, "packs", false, "save resourcepacks to the worlds")
|
||||
f.BoolVar(&p.enableVoid, "void", true, "if false, saves with default flat generator")
|
||||
}
|
||||
|
@ -122,7 +121,7 @@ func (c *WorldCMD) Usage() string {
|
|||
}
|
||||
|
||||
func (c *WorldCMD) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus {
|
||||
server_address, hostname, err := utils.ServerInput(c.server_address)
|
||||
server_address, hostname, err := utils.ServerInput(c.Address)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
return 1
|
||||
|
@ -166,7 +165,7 @@ func (w *WorldState) toggleVoid(cmdline []string) bool {
|
|||
}
|
||||
|
||||
func (w *WorldState) ProcessLevelChunk(pk *packet.LevelChunk) {
|
||||
ch, blockNBTs, err := chunk.NetworkDecode(uint32(pk.HighestSubChunk), pk.RawPayload, int(pk.SubChunkCount), w.Dim.Range(), w.ispre118)
|
||||
ch, blockNBTs, err := chunk.NetworkDecode(6692, pk.RawPayload, int(pk.SubChunkCount), w.Dim.Range(), w.ispre118)
|
||||
if err != nil {
|
||||
logrus.Error(err)
|
||||
return
|
||||
|
@ -289,7 +288,7 @@ func (w *WorldState) SaveAndReset() {
|
|||
|
||||
provider, err := mcdb.New(logrus.StandardLogger(), folder, opt.DefaultCompression)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
// save chunk data
|
||||
|
@ -306,7 +305,7 @@ func (w *WorldState) SaveAndReset() {
|
|||
for cp, v := range blockNBT {
|
||||
err = provider.SaveBlockNBT((world.ChunkPos)(cp), v, w.Dim)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
logrus.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,18 +45,18 @@ func ServerInput(server string) (address, name string, err error) {
|
|||
name = strings.Join(s[:len(s)-1], ".")
|
||||
address = server
|
||||
/*} else if strings.HasPrefix(server, "gathering:") {
|
||||
gathering_info := strings.Split(server, ":")
|
||||
if len(gathering_info) < 2 {
|
||||
return "", "", fmt.Errorf("use: gathering:<uuid>")
|
||||
}
|
||||
gathering_id := gathering_info[1]
|
||||
g := gatherings.NewGathering(GetTokenSource(), gathering_id)
|
||||
address, err = g.Address()
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
return address, gathering_id, nil
|
||||
} */
|
||||
gathering_info := strings.Split(server, ":")
|
||||
if len(gathering_info) < 2 {
|
||||
return "", "", fmt.Errorf("use: gathering:<uuid>")
|
||||
}
|
||||
gathering_id := gathering_info[1]
|
||||
g := gatherings.NewGathering(GetTokenSource(), gathering_id)
|
||||
address, err = g.Address()
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
return address, "gathering_"+gathering_id, nil
|
||||
*/
|
||||
} else {
|
||||
// if an actual server address if given
|
||||
// add port if necessary
|
||||
|
|
|
@ -5,6 +5,7 @@ import (
|
|||
"net"
|
||||
"reflect"
|
||||
|
||||
"github.com/fatih/color"
|
||||
"github.com/sandertv/gophertunnel/minecraft/protocol"
|
||||
"github.com/sandertv/gophertunnel/minecraft/protocol/packet"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
@ -14,57 +15,56 @@ import (
|
|||
var Pool = packet.NewPool()
|
||||
|
||||
var muted_packets = []string{
|
||||
"*packet.UpdateBlock",
|
||||
"*packet.MoveActorAbsolute",
|
||||
"*packet.SetActorMotion",
|
||||
"*packet.SetTime",
|
||||
"*packet.RemoveActor",
|
||||
"*packet.AddActor",
|
||||
"*packet.UpdateAttributes",
|
||||
"*packet.Interact",
|
||||
"*packet.LevelEvent",
|
||||
"*packet.SetActorData",
|
||||
"*packet.MoveActorDelta",
|
||||
"*packet.MovePlayer",
|
||||
"*packet.BlockActorData",
|
||||
"*packet.PlayerAuthInput",
|
||||
"*packet.LevelChunk",
|
||||
"*packet.LevelSoundEvent",
|
||||
"*packet.ActorEvent",
|
||||
"*packet.NetworkChunkPublisherUpdate",
|
||||
"*packet.UpdateSubChunkBlocks",
|
||||
"*packet.SubChunk",
|
||||
"*packet.SubChunkRequest",
|
||||
"*packet.Animate",
|
||||
"*packet.NetworkStackLatency",
|
||||
"*packet.InventoryTransaction",
|
||||
"packet.UpdateBlock",
|
||||
"packet.MoveActorAbsolute",
|
||||
"packet.SetActorMotion",
|
||||
"packet.SetTime",
|
||||
"packet.RemoveActor",
|
||||
"packet.AddActor",
|
||||
"packet.UpdateAttributes",
|
||||
"packet.Interact",
|
||||
"packet.LevelEvent",
|
||||
"packet.SetActorData",
|
||||
"packet.MoveActorDelta",
|
||||
"packet.MovePlayer",
|
||||
"packet.BlockActorData",
|
||||
"packet.PlayerAuthInput",
|
||||
"packet.LevelChunk",
|
||||
"packet.LevelSoundEvent",
|
||||
"packet.ActorEvent",
|
||||
"packet.NetworkChunkPublisherUpdate",
|
||||
"packet.UpdateSubChunkBlocks",
|
||||
"packet.SubChunk",
|
||||
"packet.SubChunkRequest",
|
||||
"packet.Animate",
|
||||
"packet.NetworkStackLatency",
|
||||
"packet.InventoryTransaction",
|
||||
}
|
||||
|
||||
func PacketLogger(header packet.Header, payload []byte, src, dst net.Addr) {
|
||||
var pk packet.Packet
|
||||
buf := bytes.NewBuffer(payload)
|
||||
r := protocol.NewReader(buf, 0)
|
||||
pkFunc, ok := Pool[header.PacketID]
|
||||
if !ok {
|
||||
pk = &packet.Unknown{PacketID: header.PacketID}
|
||||
} else {
|
||||
if pkFunc, ok := Pool[header.PacketID]; ok {
|
||||
pk = pkFunc()
|
||||
} else {
|
||||
pk = &packet.Unknown{PacketID: header.PacketID}
|
||||
}
|
||||
pk.Unmarshal(r)
|
||||
pk.Unmarshal(protocol.NewReader(bytes.NewBuffer(payload), 0))
|
||||
|
||||
dir := "S->C"
|
||||
src_addr, _, _ := net.SplitHostPort(src.String())
|
||||
if IPPrivate(net.ParseIP(src_addr)) {
|
||||
dir = "C->S"
|
||||
}
|
||||
|
||||
pk_name := reflect.TypeOf(pk).String()
|
||||
pk_name := reflect.TypeOf(pk).String()[1:]
|
||||
if slices.Contains(muted_packets, pk_name) {
|
||||
return
|
||||
}
|
||||
|
||||
switch pk := pk.(type) {
|
||||
case *packet.Disconnect:
|
||||
logrus.Infof("Disconnect: %s", pk.Message)
|
||||
}
|
||||
logrus.Debugf("%s 0x%x, %s\n", dir, pk.ID(), pk_name)
|
||||
|
||||
dir := color.GreenString("S") + "->" + color.CyanString("C")
|
||||
src_addr, _, _ := net.SplitHostPort(src.String())
|
||||
if IPPrivate(net.ParseIP(src_addr)) {
|
||||
dir = color.CyanString("C") + "->" + color.GreenString("S")
|
||||
}
|
||||
|
||||
logrus.Debugf("%s 0x%02x, %s", dir, pk.ID(), pk_name)
|
||||
}
|
||||
|
|
|
@ -164,7 +164,7 @@ func (p *ProxyContext) Run(ctx context.Context, server_address string) (err erro
|
|||
}
|
||||
serverConn.Close()
|
||||
packs = serverConn.ResourcePacks()
|
||||
p.log.Infof("%d packs loaded\n", len(packs))
|
||||
p.log.Infof("%d packs loaded", len(packs))
|
||||
}
|
||||
|
||||
_status := minecraft.NewStatusProvider("Server")
|
||||
|
@ -180,7 +180,7 @@ func (p *ProxyContext) Run(ctx context.Context, server_address string) (err erro
|
|||
}
|
||||
defer p.Listener.Close()
|
||||
|
||||
p.log.Infof("Listening on %s\n", p.Listener.Addr())
|
||||
p.log.Infof("Listening on %s", p.Listener.Addr())
|
||||
|
||||
c, err := p.Listener.Accept()
|
||||
if err != nil {
|
||||
|
|
|
@ -4,11 +4,11 @@ import (
|
|||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/google/subcommands"
|
||||
"github.com/sandertv/gophertunnel/minecraft/realms"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func get_realm(ctx context.Context, api *realms.Client, realm_name, id string) (name string, address string, err error) {
|
||||
|
@ -46,7 +46,7 @@ func (c *RealmListCMD) Execute(ctx context.Context, f *flag.FlagSet, _ ...interf
|
|||
api := realms.NewClient(GetTokenSource())
|
||||
realms, err := api.Realms(ctx)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
logrus.Error(err)
|
||||
return 1
|
||||
}
|
||||
for _, realm := range realms {
|
||||
|
|
|
@ -33,11 +33,13 @@ func create_replay_connection(ctx context.Context, log *logrus.Logger, filename
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// maximum packet size
|
||||
SetUnexportedField(reflect.ValueOf(reader).Elem().Field(5), uint32(0xFFFFFFFF))
|
||||
|
||||
proxy := NewProxy(logrus.StandardLogger())
|
||||
proxy.Server = minecraft.NewConn()
|
||||
|
||||
// on old captures, the packet header is missing
|
||||
var fake_header []byte
|
||||
if OLD_BROKEN {
|
||||
// FOR OLD BROKEN CAPTURES
|
||||
|
|
Loading…
Reference in New Issue