Skip to content

Commit

Permalink
a bit of cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
olebeck committed Jul 22, 2024
1 parent 0f5c150 commit a7f55ec
Show file tree
Hide file tree
Showing 13 changed files with 262 additions and 252 deletions.
12 changes: 12 additions & 0 deletions cmd/bedrocktool/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"flag"
"fmt"
"io"
"net/http"
"os"
"os/signal"
"runtime/pprof"
Expand Down Expand Up @@ -68,6 +69,15 @@ func setupLogging(isDebug bool) {
}))
}

type logTransport struct {
rt http.RoundTripper
}

func (t *logTransport) RoundTrip(req *http.Request) (*http.Response, error) {
logrus.Tracef("Request %s", req.URL.String())
return t.rt.RoundTrip(req)
}

func main() {
isDebug := updater.Version == ""

Expand All @@ -80,6 +90,8 @@ func main() {
}
pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile()

http.DefaultTransport = &logTransport{rt: http.DefaultTransport}
}

log := logrus.WithField("part", "main")
Expand Down
102 changes: 0 additions & 102 deletions cmd/entity-test/main.go

This file was deleted.

2 changes: 1 addition & 1 deletion gophertunnel
9 changes: 5 additions & 4 deletions handlers/worlds/world.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,15 +443,16 @@ func (w *worldsHandler) saveWorldState(worldState *worldstate.World) error {
}
defer f.Close()
zw := zip.NewWriter(f)
utils.ZipCompressPool(zw)
err = zw.AddFS(os.DirFS(worldState.Folder))
if err != nil {
return err
}
zfs := &utils.ZipWriter{Writer: zw}
ofs := &utils.OSWriter{Base: worldState.Folder}
mfs := &utils.MultiWriterFS{FSs: []utils.WriterFS{zfs, ofs}}

err = w.AddPacks(worldState.Name, mfs)
err = w.AddPacks(worldState.Name, utils.MultiWriterFS{FSs: []utils.WriterFS{
utils.ZipWriter{Writer: zw},
utils.OSWriter{Base: worldState.Folder},
}})
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion subcommands/realms-list.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (c *RealmListCMD) Execute(ctx context.Context) error {
return err
}
}
realms, err := utils.Auth.Realms.Realms(ctx)
realms, err := utils.Auth.Realms().Realms(ctx)
if err != nil {
return err
}
Expand Down
Binary file modified subcommands/resourcepack-d/resourcepack-d.go
Binary file not shown.
2 changes: 1 addition & 1 deletion ui/gui/popups/realmsinput.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (r *RealmsList) Load() error {
if !utils.Auth.LoggedIn() {
return errors.New("not Logged In")
}
realms, err := utils.Auth.Realms.Realms(context.Background())
realms, err := utils.Auth.Realms().Realms(context.Background())
if err != nil {
return err
}
Expand Down
Loading

0 comments on commit a7f55ec

Please sign in to comment.