From 8b763cde796ec7c574531df09537bdec478e0d25 Mon Sep 17 00:00:00 2001 From: olebeck <31539311+olebeck@users.noreply.github.com> Date: Sat, 11 Mar 2023 16:05:26 +0100 Subject: [PATCH] add skinid to customdata fields --- subcommands/world/world.go | 11 ++++++++++- utils/messages.go | 6 ++++++ utils/proxy.go | 4 ++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/subcommands/world/world.go b/subcommands/world/world.go index 640c0bc..8bd416c 100644 --- a/subcommands/world/world.go +++ b/subcommands/world/world.go @@ -248,6 +248,10 @@ func (w *WorldState) Reset() { w.chunks = make(map[protocol.ChunkPos]*chunk.Chunk) w.WorldName = fmt.Sprintf("world-%d", w.worldCounter) w.mapUI.Reset() + + w.gui.Message(utils.SavingWorldName, utils.SavingWorldPayload{ + Saving: false, + }) } // SaveAndReset writes the world to a folder, resets all the chunks @@ -256,6 +260,11 @@ func (w *WorldState) SaveAndReset() { w.Reset() return } + + w.gui.Message(utils.SavingWorldName, utils.SavingWorldPayload{ + Saving: true, + }) + logrus.Infof(locale.Loc("saving_world", locale.Strmap{"Name": w.WorldName, "Count": len(w.chunks)})) // open world @@ -477,7 +486,7 @@ func (w *WorldState) SaveAndReset() { fmt.Println(err) } logrus.Info(locale.Loc("saved", locale.Strmap{"Name": filename})) - // os.RemoveAll(folder) + os.RemoveAll(folder) w.Reset() } diff --git a/utils/messages.go b/utils/messages.go index 9909749..6d89d2d 100644 --- a/utils/messages.go +++ b/utils/messages.go @@ -40,3 +40,9 @@ var UpdateMapName = "update_map" type UpdateMapPayload struct { ChunkCount int } + +var SavingWorldName = "saving_world" + +type SavingWorldPayload struct { + Saving bool +} diff --git a/utils/proxy.go b/utils/proxy.go index 770d9a8..57f33a5 100644 --- a/utils/proxy.go +++ b/utils/proxy.go @@ -93,11 +93,13 @@ type CustomClientData struct { CapeFilename string SkinFilename string SkinGeometryFilename string + SkinID string PlayFabID string PersonaSkin bool PremiumSkin bool TrustedSkin bool ArmSize string + SkinColour string // misc IsEditorMode bool @@ -117,11 +119,13 @@ func (p *ProxyContext) LoadCustomUserData(path string) error { } p.CustomClientData = &login.ClientData{ + SkinID: customData.SkinID, PlayFabID: customData.PlayFabID, PersonaSkin: customData.PersonaSkin, PremiumSkin: customData.PremiumSkin, TrustedSkin: customData.TrustedSkin, ArmSize: customData.ArmSize, + SkinColour: customData.SkinColour, } if customData.SkinFilename != "" {